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
|
|
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:
Spam's M16 is already very dirty. It jams, even though its status is very high and its temperature is 0.
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%.
Ammo dirt modifier.
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
|
|
|
|
|
|
|
|
|
|
Re: New feature: advanced repair/dirt system[message #309242]
|
Sat, 18 August 2012 02:16
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
This is in the trunk now. Exe built on r5480 is in my sig, it requires GameDir r1498 when using this feature.
Be warned, THIS BREAKS SAVEGAME COMPATIBILITY!!!
It is smart to have few cleaning kits (item 1576). They can be bought from BR, Tony, Keith, Sam and Jake.
[Updated on: Sat, 18 August 2012 02:49] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: New feature: advanced repair/dirt system[message #312164]
|
Sat, 17 November 2012 07:01
|
|
Bombrik |
|
Messages:17
Registered:October 2011 Location: Tantallon, Axius |
|
|
Break Lights, Grenades, Misc Items that are not Armor and Weapons seem unable to be repaired by a merc, and anything below 40% is basically "vendor trash". This works well for Grenades as you can sell them to Tony, but unless you make the trek to Estoni, or Keith's minor sum of cash ($1,500 a day) has been increased, you'll just have to LMB-Sell them or buy 100% items straight from BR's.
I have not seen excessive cases of repair thresholds being lowered, but maybe I am just rough with my weapons. My real complaint is that, with the inability the Mercs have to repair Grenades, Break Lights and other items, you have to either buy brand new, or you have to deal with the repairmen. Which wouldn't be a problem if there was a way to increase their repairspeed (Don't even care if it costs more) or if they can take more than 4 items at a time. Sending a single merc in to get his gear all patched up, ends up putting them on the sidelines for almost a week.
Edit: I suppose my real issue is that this makes mech-able mercs rather useless to the team. They can't repair as much as they used to be able to. Right now, they can, at best, do minor repairs to weapons and armor. Everything else, they can't touch.
[Updated on: Sat, 17 November 2012 07:03] by Moderator Report message to a moderator
|
Private
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: New feature: advanced repair/dirt system[message #316134]
|
Sun, 10 March 2013 16:09
|
|
merc05 |
|
Messages:90
Registered:January 2013 |
|
|
I was wondering, maybe a small piece like this or similar can be added to the code:
Assingments.cpp
// Flugente: if using the new advanced repair system, we can only repair up to the repair threshold
INT16 threshold = 100;
if ( gGameExternalOptions.fAdvRepairSystem && ( (Item[pObj->usItem].usItemClass & IC_WEAPON) || (Item[pObj->usItem].usItemClass & IC_ARMOUR) ) )
{
if ( gGameExternalOptions.fMercsCanDoAdvancedRepairs )
{
if ( ( !HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) ) )
threshold = (*pObj)[ubLoop]->data.sRepairThreshold;
}
else
{
threshold = (*pObj)[ubLoop]->data.sRepairThreshold;
}
}
// repairable, try to repair it
DoActualRepair( pSoldier, pObj->usItem, &((*pObj)[ubLoop]->data.objectStatus), threshold, pubRepairPtsLeft );
if ( gGameExternalOptions.fAdvRepairSystem && gGameExternalOptions.fMercsCanDoAdvancedRepairs && ( HAS_SKILL_TRAIT( pSoldier, TECHNICIAN_NT ) ) && ( (Item[pObj->usItem].usItemClass & IC_WEAPON) || (Item[pObj->usItem].usItemClass & IC_ARMOUR) ) )
(*pObj)[ubLoop]->data.sRepairThreshold = (*pObj)[ubLoop]->data.objectStatus;
GameSettings.cpp
gGameExternalOptions.fMercsCanDoAdvancedRepairs = iniReader.ReadBoolean("Strategic Gameplay Settings","MERCS_CAN_DO_ADVANCED_REPAIRS", FALSE);
GameSettings.h
BOOLEAN fMercsCanDoAdvancedRepairs; // allow mercs with technician/engineer trait to raise weapon threshold
JA2_Options.ini
; if set to true mercs with technician/engineer trait can repair item treshold much like local weaponsmiths can
MERCS_CAN_DO_ADVANCED_REPAIRS = FALSE
Then we can have a customized option to allow mercenaries with technician/engineer trait to be able to repair weapons to 100% threshold for those who want it. While this new repair system is quite balanced, it does make those mercs whose main specialization is being a repairman, not a soldier, kinda underappreciated. You know, hiring someone who is a specialist highly experienced in dealing with military equipment and instead I need to go to some local of a backwater town of a third world country to get my items fixed properly .
Another thing which is bugging me is why do the blades get internal damage applied to them even though they have a DamageChance factor set to 0. They do use up pretty fast BTW. Much faster than the guns. It would be OK I guess (having to sharpen them once in a while) if not for having this internal damage thing afflicting them as well.
Report message to a moderator
|
Corporal 1st Class
|
|
|
|
Re: New feature: advanced repair/dirt system[message #316479]
|
Fri, 22 March 2013 20:22
|
|
Faalagorn |
|
Messages:153
Registered:February 2012 Location: Poland |
|
|
FlugenteWhile I personally won't use that option (I always use a dedicated repair team that mostly consists of technicians/engineers, which would render this feature pointless with the option), this seems to be a much-demanded point... Committed in in r5917 and GameDir r1619. Thank you, merc05
Hm... maybe I'm doing something wrong, but the feature is not working for me... I'm using Jagged Alliance 2 v1.13 r5927 & r1622 data, AFS 4.30, and have the option set to TRUE in ini, but when I set Maddog (Engineer, new trait system) to do repairs, with just the broken pistol (3%) in whole squad inventory, it can't go beyond 3% anyway. it keeps saying "Maddog lacks the necessary skill to repair anything" and stops the time compression. here's my ini: http://pastebin.com/yJfbQZ6S
EDIT: A thought, maybe it works with technicians only, and not ENGINEERS?
EDIT2: Just hired Barry and checked this; it does not work with him as well.
EDIT3: It's also worth mentioning an oddity - since I was fiddling with ini anyway, I tried to disable the advanced repair system altogether, fix the gun, save the game and enable it to see what happens - everything works fine, to my surprise . Just one oddity - the repaired gun is now at 40% but after re-enablind advanced repair system, it's threshold is still at 3% . I guess theren't nothing to do about it though, since it works as intended.
[Updated on: Fri, 22 March 2013 21:54] by Moderator Report message to a moderator
|
Staff Sergeant
|
|
|
Re: New feature: advanced repair/dirt system[message #316513]
|
Sun, 24 March 2013 01:45
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
FaalagornFlugenteWhile I personally won't use that option (I always use a dedicated repair team that mostly consists of technicians/engineers, which would render this feature pointless with the option), this seems to be a much-demanded point... Committed in in r5917 and GameDir r1619. Thank you, merc05
Hm... maybe I'm doing something wrong, but the feature is not working for me... I'm using Jagged Alliance 2 v1.13 r5927 & r1622 data, AFS 4.30, and have the option set to TRUE in ini, but when I set Maddog (Engineer, new trait system) to do repairs, with just the broken pistol (3%) in whole squad inventory, it can't go beyond 3% anyway. it keeps saying "Maddog lacks the necessary skill to repair anything" and stops the time compression. here's my ini: http://pastebin.com/yJfbQZ6S
EDIT: A thought, maybe it works with technicians only, and not ENGINEERS?
EDIT2: Just hired Barry and checked this; it does not work with him as well. Fixed in r5950.
Faalagorn
EDIT3: It's also worth mentioning an oddity - since I was fiddling with ini anyway, I tried to disable the advanced repair system altogether, fix the gun, save the game and enable it to see what happens - everything works fine, to my surprise . Just one oddity - the repaired gun is now at 40% but after re-enablind advanced repair system, it's threshold is still at 3% . I guess theren't nothing to do about it though, since it works as intended. Yes, it is intentional. Can't have players cheating by disabling the feature, repairing, and enabling it again, can we now?
Report message to a moderator
|
|
|
|
Goto Forum:
Current Time: Mon Dec 02 13:51:53 GMT+2 2024
Total time taken to generate the page: 0.03536 seconds
|