Maybe more a scripting question, but has anyone done any work on a system of weapon and armor breakdown, and having to repair it using tools and materials? If you've played Fallout 3 or Fallout New Vegas, I'm interested in something like that, weapon wears down with use and can be repaired using a like weapon, or on a toolbench.
Weapon and Armor degradation
#1
Posté 19 mai 2015 - 05:22
#2
Posté 19 mai 2015 - 10:39
It could certainly be done using OnHit tag-based scripts, but every weapon, shield and set of armour would have to have a generic OnHit property added to it. Adding OnHit properties to all weapons, armour and shields would make their description screens look ugly, and would also count as an enchantment slot for magical crafting, reducing the number of properties the player could potentially add to an item.
Another option would be to hijack the default OnDamage script for creatures to determine when a weapon has hit them. You could also give all creatures and NPCs in the game custom weapons or creature items that have the OnHit property (which the player would never see) and associated tag-based OnHit scripts to determine when they hit players. That would involve some much more complex scripting.
#3
Posté 20 mai 2015 - 03:58
If just for the PC, you could use a heartbeat script that just looks at the PC and whether they're in combat. If so, check for the equipped weapon and add something to it's wear-and-tear variable.
#4
Posté 20 mai 2015 - 04:37
If just for the PC, you could use a heartbeat script that just looks at the PC and whether they're in combat. If so, check for the equipped weapon and add something to it's wear-and-tear variable.
That's certainly a quick-and-dirty method that would avoid a lot of hassle. However you'd end up getting wear-and-tear damage even if your attacks missed (which only makes sense for ranged weapons that use a launcher). And just because the game detects that you're in combat doesn't mean you're actually doing anything - you can be 'in combat' simply by standing still while being attacked.
Spellcasters might also find their weapons wearing out while they do nothing but cast spells at enemies.
#5
Posté 20 mai 2015 - 01:27
Quick and dirty indeed, but parried attacks wear down weapons more than clean cuts, and armor gets torn more when it absorbs a blow than when the wearer absorbs all the damage. Even an idle bow gets nicked and scraped when running through the bush.
Hacking the on-end-combat round script for the PC could glean some more precise combat information, though.
#6
Posté 21 mai 2015 - 02:14
Prepare for a long winded list of ideas that you can use or ignore...
This is something that can be a simple system or grow into a complex thing that looks at numerous variables.
I would suggest writing an include script to handle all your functions of the system, then you can just put you single function on the default scripts to wear down your weapons. The more variables you look at the more realism you can add. And with those variable you need to determine which ones effect the items total durability number and which ones effect the durability wear rate.
Scripts and variable to consider
-On equip:
First Time an item is equipped a base durability is set. I would suggest this as a dynamic value base on the weapon type. A Great sword should be able to take more punishment when compared to a rapier.
Enchantments- These should increase that durability either on a flat value or variable. (Exp +1 adds 100 durability or 2x base durability). Magic weapons are suppose to last longer and keep their edge.
Weapon Properties: As a player you may expect your prized item with numerous magic properties to degrade slower, or you can be an evil modder and say to hell with them.
On hit and Damage taken:
These may be the best way to deal with weapon and armor degrading. While you won't get misses it will get most of it. For the base damage I would use a dice roll then your modifiers so the damage isn't a constant. So some times you hit a sweet spot and nave negligible damage or he hit that parried block and have a good notch taken from your blade.
Weapons:
What is getting hit?
A well armored or stone foe will inflict more durability damage to your scimitar than to your war hammer, likewise your wooden club will not last beyond a couple of strikes against a blade golem.
This can handled several different ways depending how complex and ambitious you feel. An script in your include can determine the Racial type or subtype or even the specific creature tag them the durability can be modified.
What is the weapon made of?
An adamantine weapon should wear much slower than a standard weapon while a silver weapon may wear faster. So a player would have to keep their werewolf hunting dagger safely in their pack until they encountered that fabled beast.
Armor:
Again material types should affect the durability wear rate
Damage type also plays into armor wear and tear. War Hammers do more damage to plate armor, slashing damages leather and piercing damages mail.
Then there is the bonus and spell damage. Acid corrodes and decreases the durability of metal.
Random Damage:
This is where you could have some fun to do those little wear from use. Done with HB and a low percent chance since it happens every 6 seconds.
If you hit that chance a selected item is damaged and a speak string appears over your head and a voice chat cuss to top it off.
"Darn, I snagged my robe and tore it!"
"I dribbled have my soup on my armor and forgot to clean it"
"I dropped my sword and nicked the blade"
If you are making your own game you can have a swamp that will slowly corrode any metal armor and weapons that are equipped.
Repairing:
I would suggest looking at ingots already included in the game as a way to return durability to items, so that way a mithril armor would need a mithril ingot to repair it. You would need a script to break weapons down into their ingots. The game already has the crafting skills so the amount or repair per ingot and ingot breakdown ration can be controlled by those skills.
You can also look at writing a spell so your mages and clerics can repair items through arcane/divine means. That will include 2da editing.
Since the durability will most likely be handled as a variable, I would suggest making a book like item for the player. The item would explain your system, weapon and armor vulnerabilities and whatnot. It also could have an unique spell-like ability to loop through the players inventory and display the item name and current and total available durability. (IE Long Sword +1 76/200)
I did write some durability scripts to allow oozes and slimes to dissolve weapons and armor, feel free to go through them and pilfer what you need.
http://www.nexusmods...nter2/mods/23/?
#7
Posté 26 mai 2015 - 03:20
Thank you all for the replies, just returned from vacation and now I can finally sit down here at work and look at this! (NWN is work, right?)
- GCoyote aime ceci
#8
Posté 01 juin 2015 - 03:05
Maybe more a scripting question, but has anyone done any work on a system of weapon and armor breakdown, and having to repair it using tools and materials? If you've played Fallout 3 or Fallout New Vegas, I'm interested in something like that, weapon wears down with use and can be repaired using a like weapon, or on a toolbench.
Hi,
Yes, I have incorporated a "Weapon Damage" system for my up and coming Althéa Campaign. It works via a creature's OnDamaged Script. Damaged weapons can be repaired (or even improved) with the right skills, equipment and/or items. I hope to have the campaign released this year if all goes to plan.
An old link : http://worldofalthea...ad-weapons.html
EDIT: I also took into account the ooze stuff that Shaughn mentions, which I believe I helped with some of the coding if I recall correctly.
Lance.





Retour en haut






