Jump to content
Sign in to follow this  
cleanrock

Repair Bug (1.96)

Recommended Posts

I am posting this in case that BIS will release a version after 1.96.

When you repair a vehicle at a Repair Truck the damage will not go down to 0, it will stay at a very small number (~10E-10).

The repair script/code will never exit since the damage will never go down to 0.

This has two bad effects on game:

1.

AI will not board vehicles that have previously been rendered immobile. If you use "setDamage 0" on the vehicle AI will board the vehicle.

2.

Vehicles that are not moved after a repair action has been initiated will be repairing forever. This can and has been used as an exploit in CTI-games (damage ur MHQ slightly, start repairs, get out).

To see this effect you can do the following in the mission editor:

1. Place an empty jeep and rep truck in mission

2. Start mission and drive the jeep to the rep truck

3. Get out of jeep and damage it slightly with ur M16

4. Get in jeep and start repairs

5. Get out of jeep and try to damage/destroy the jeep with ur M16 smile_o.gif

Share this post


Link to post
Share on other sites

Moving to troubleshooting, I'm pretty sure this bug has been brought up before but you've provided additional clear details so the thread can stay open.

Share this post


Link to post
Share on other sites
I'm pretty sure this bug has been brought up before but you've provided additional clear details so the thread can stay open.

I searched the forums a lot before posting this.

If you can show me a previous post about this I am interested in reading it.

Share this post


Link to post
Share on other sites

If you loop on CanMove=False then you can fix the problem:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_Vehicle=_This Select 0

#Loop

~2

If (CanMove _Vehicle) Then {goto #Loop}

#Loop1

~2

If !(CanMove _Vehicle) Then {goto #Loop1}

_Vehicle SetDamage 0

goto "Loop"

If you run this for every vehicle then you can at least avoid the problem of AI not boarding a repaired vehicle.

Share this post


Link to post
Share on other sites

I've experienced this bug, it seriously buggered up one of the Campaign missions for Resistance....

it's the mission where you have the choice to either infiltrate alone and steal some tanks or bring your guys on a frontal assault type thing... I forget the mission name but it's the first one where nicking tanks is the theme...

Basically, I sent a T-72 to repair before leaving in my newly aquired vehicles and the damn tank kept returning to the spot where the repair-truck was.... regardless of whether or not the truck was there or not, despite ordering it to move elsewhere.

Then, in the same mission, the stupid AI crashed the ammo-truck, which I promptly repaired, but the AI refused to get in the truck again, so I had to choose between driving the T-72 or the ammo-truck myself.... not a difficult choice really, but it does mean I'm down an ammo-truck load of... erm... ammo *cough*

Share this post


Link to post
Share on other sites
I searched the forums a lot before posting this.

If you can show me a previous post about this I am interested in reading it.

Unfortunately I only recall vague references in other thread, iirc it never had a thread of its own before, it may be mentioned in one of the large 1.9 bug threads, but it would take some doing to find it, if you're certain you could use forsearch and look for the search term "repair" smile_o.gif

Share this post


Link to post
Share on other sites

this explains alot of things, thxs for posting cleanrock.

and thxs unnamed_ for ur idea for fixing, though in cti this is not atall an ideal way to fix this, though i guess it will help in other circumstances. also wouldnt this make all vehicles auto repairing? maybe a script that checks for dammage between 0.05 & 0 and then fixes it after about 10 seconds, this way vehicles that have not been repaired will probably not get fixed as they would have more than 0.05 dammage, and if u use a slow loop it should be ok. (but still not perfect)

or would that not work with: (~10E-10). as i have never seen that kind of figure before,

anyway just my 1st thoughts, but im very glad i now know why this is happening. I just kept cursing at the AI before. biggrin_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]

You could run a slow loop on every vehicle that looks like this.

_veh = _this

?!(local Server): exit

#start

_dmg = getDammage _veh

~5

?(_dmg > getDammage _veh): _veh setDammage 0; _dmg = 0

goto "start"

Theoretically it will detect when a vehicle has been partially repaired and nudge it back to full repairedness. The only time a vehicle's dammage decreases is when it uses a repair truck (or a script repairs it). Might have to toy with where the script is running, as vehicles change locale and getDammage can be inaccurate for remote vehicles (maybe it's always accurate on the server?).

by Tactician

Share this post


Link to post
Share on other sites
@ July 20 2004' date='09:08)']
Quote[/b] ]

You could run a slow loop on every vehicle that looks like this.

_veh = _this

?!(local Server): exit

#start

_dmg = getDammage _veh

~5

?(_dmg > getDammage _veh): _veh setDammage 0; _dmg = 0

goto "start"

Theoretically it will detect when a vehicle has been partially repaired and nudge it back to full repairedness. The only time a vehicle's dammage decreases is when it uses a repair truck (or a script repairs it). Might have to toy with where the script is running, as vehicles change locale and getDammage can be inaccurate for remote vehicles (maybe it's always accurate on the server?).

by Tactician

this is a clean but expensive way to fix it, in a cti game u will have ~50 of those scripts running on the server all the time

.. and u should add an exit in the loop if the vehicle is destroyed (damage==1)

Share this post


Link to post
Share on other sites

yeah that is kind of how i was thinking, but really it would be best to not have this problem atall, and for BIS to fix it back to how it was.

So if any1 from BIS sees this can u make a note for ur next update pls, thxs.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×