Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New feature: advanced repair/dirt system
New feature: advanced repair/dirt system[message #308926] Sat, 11 August 2012 15:17 Go to previous message
Flugente

 
Messages:3507
Registered:April 2009
Location: Germany
Repair threshold for items and consideration of dirt on guns

I made two new small features. They are of course fully optional.

Advanced repair:
  • Weapons and armour now have an internal repair threshold. When an item gets damaged (and thus its status is lowered), there is a (xml-based) chance that its internal repair threshold is lowered as well.
  • A gun can only be repaired up to its internal repair threshold by your mercs, not above that (not even by engineers). The only way to restore it up to a 100% is by having on of Arulco's smiths repair it in their shops.
  • The goal of this feature is force the player to be more careful with his equipment. Either have spare weapons, maintain fire discipline (thus damage your equipment less), or make use of the local smiths (which were to much underused imho).
  • As the chance to damaging the internal repair threshold is xml-based, weapons can differ here up to your own wishes. With my stock values, AK-based rifles have a lower chance to internal damage, representing their durability. Thus these guns are easier to maintain, especially if you have no access to spare equipment or the smiths.

Dirt system:
  • Every gun now has a 'dirt value'. Firing a shot adds dirt to the gun's dirt level. This can get modified by attachments and the ammunition type.
  • The sector you are in has a very high influence on the amount of dirt added. It is not much in cities, but swamps and especially deserts add a lot of dirt.
  • Your weapon will also slowly get dirtier just by being in a sector or your inventory. Note that by keeping a gun in a holster or bags, you will reduce the amount of additional dirt they get.
  • The higher a gun's dirt level is, the higher the chance that it will jam.
  • The dirt value is also xml-based. Some weapons, like the M16A1, a very vulnerable to dirt, a clean M16 will have severe problems after jsut 2 magazines in the desert. Others, like the SCAR, can fire a lot more until they jam.
  • There are two ways to clean a gun:
    • if you repair a gun up to 100% (or its current internal repair threshold), it will also get cleaned.
    • use a cleaning kit (new item #1576). Just have one in your inventory and press 'Ctrl' + '.' and click on the 2nd button. All your guns will get cleaned (if they are dirty to begin with). If you are currently in combat, this will cost APs (ini-value), and only one gun will get repaired, starting with your hand slots.
    • cleaning kits can degrade by use, but it'll take a long time to use up one.

These features can be controlled via the JA2Options.ini.

;------------------------------------------------------------------------------------------------------------------------------
; advanced repair/dirt system
;------------------------------------------------------------------------------------------------------------------------------

; determines wether a gun can suffer permanent damage that cannot be repaired by anyone other than local smiths.
ADVANCED_REPAIR = TRUE

; the only items we can repair are guns and armour
ONLY_REPAIR_GUNS_AND_ARMOUR = FALSE

; allows a gun to get dirty when used, thereby increasing the chance of weapon jamming
DIRT_SYSTEM = TRUE

; repairing a gun to its currently possible maximum value also cleans the gun (always so on repair shopkeepers)
FULL_REPAIR_CLEANS_GUN = FALSE;

; every turn, a gun suffers a dirt increase equal to a singleshot dirt increase divided by this number
SECTOR_DIRT_DIVIDER = 1000


XML entries:

Items.xml:

  • is an UINT8 value. It describes the chance that upon lowering the item's status, the internal repair threshold will be lowered as well.
  • is a FLOAT value. It is the base value of dirt generated with every shot, as well as the base for time-based dirt generation.

AmmoTypes.xml:

is a FLOAT value. It describes the additional dirt generation if using this type of ammunition.

Map/SectorNames.xml:

is an UINT16 value. It describes how many percent of dirt will be generated. For example, deserts have a value of 1000, which means that in a desert you will generate 10 times as much dirt as in a clean city.

And now a few demo pics:

http://i47.tinypic.com/2dq29v.jpg
Spam's M16 is already very dirty. It jams, even though its status is very high and its temperature is 0.

http://i45.tinypic.com/212dbly.jpg
Dirt modifier description. The gun's value of 60 is increased by 20% due to using AP ammo (ammo types add/substract a percentage of dirt). Note the status bar on the left side indicates that the internal repair threshold is lower than 100%.

http://i48.tinypic.com/eo64o.jpg
Ammo dirt modifier.

http://i46.tinypic.com/35kq5x1.jpg
This flak jacked is highly damaged, and thus, it can onyl be repaird up to 77%

I will add this to the trunk if nobody is against that, but now, discuss this, and please give feedback/critique/suggestions.

This is now in the trunk r5480, necessary GameDir is 1498.

[Updated on: Thu, 07 March 2013 03:15] by Moderator

Report message to a moderator

Captain

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New feature: creature raids
Next Topic: New feature: individual militia
Goto Forum:
  


Current Time: Sat Nov 30 09:34:47 GMT+2 2024

Total time taken to generate the page: 0.03819 seconds