Community Forum

Changing Time between repairs

Forum Overview >> Scripting

CategoryScripting
Created04.05.2019 11:14


Kaj-aage Henneberg (kahfs) 04.05.2019 11:14
A user of my mod FS19_RealLifeNumbers is asking, if the time between repairs could be made more realistic. I have changed a parameter called lifetime for each equipment category. But, I don't know, if "lifetime" really is the correct parameter to change in this regard. Does anybody have some experience with the meaning/effect of g_storeManager.items.lifetime? All the best. ...Kaj-Åge

Bilbo Beutlin (BBeutlin) 04.05.2019 15:52
AFAIK the xml tag <lifetime> represents the loss in value during time.

The repair interval is calculated by the xml attribute <wearable wearDuration=".."

Kaj-aage Henneberg (kahfs) 04.05.2019 17:36
Hi Bilbo, thank you for confirming my further research.

if g_currentMission.vehicles ~= nil then
for k,vehicle in pairs(g_currentMission.vehicles) do
if vehicle.spec_wearable ~= nil then
vehicle.spec_wearable.wearDuration = RN.wearDuration;
vehicle.spec_wearable.fieldMultiplier = RN.fieldMultiplier;
vehicle.spec_wearable.workMultiplier = RN.workMultiplier;
print("vehicle "..k);
end;
end;
end;

The test code above seems to do what I want.
...Kaj-Åge


Note: Log in to post. Create a new account here.