Jump to content
Sign in to follow this  
Baphomet

infantry vehicle repair script

Recommended Posts

Has anyone been able to make a more versatile repair script for infantry with the improvement of scripting commands way back when?

Gandalf's infantry repair script is probably the one I most liked, however you must define vehicles by name for them to be repaired.

I don't suppose it's possible to define repairables by their parent vehicle classes, otherwise someone might have already done it.

That script is fine for missions that don't randomly spawn vehicles, but otherwise, it's not as useful.

I know it's possible to add transportrepair=xxxxx to an infantryman; the only problem is you need two people to repair the vehicle, and it's just ridiculously fast how the vehicle gets repaired, I'd like something a bit more balanced.

I was considering a check at OFPEC, but since they're down. I'm asking here. I've also poked around OFP.info for any addons that may have addressed this issue.

Share this post


Link to post
Share on other sites

I'm not sure on the parent class of vehicles but the following should work::

/////////////////////////////////////////////

; Script One, Infantry Vehicle Repair Script

; By XCess

rprMan = _this select 0

allowAdd true

#loop

XSRprVeh = nearestObject [_rprMan, "vehicle"]

? (getDammage XSRprVeh> 0.4) && allowAdd : goto "adAction"

? !(alive rprMan) : exit

~1

goto "loop"

#adAction

allowAdd false

~0.1

vehRprAct = rprMan addAction ["Repair Vehicle","repairIt.sqs"]

~1

goto"loop"

/////////////////////////////////////////////////////////

; repairIt.sqs

; Script 2, Infantry vehicle Repair Script

; By XCess

_x = 0

;rprMan switchMove "combatToMedic"

#loop

_x = (getDammage XSRprVeh) - 0.1

XSRprVeh setDammage _x

?(getdammage XSRprVeh) <= 0 : got"end"

~4

goto"loop"

#end

;rprMan switchMove ""

allowAdd true

~0.1

exit

//////////////////////////////////////////////////////

Keep in mind this is totally untested and may have a few bugs. It is also pure theory, without testing I cannot give my garuntee this will work in game.

Hopefully it will wink_o.gif

**EDIT**

Oh, and you might want to add this:

_rprMan switchMove "combatToMedic"

but I'm not sure if that's the right animation name.. i'll add it in the appropriate place and comment it out. Remove the comments if u want to try it.

I put those lines in bold.

Share this post


Link to post
Share on other sites

I created a beta script system, for what could have been a vehicle mechanic and recovery vehicle system for a mod I was working on

I never developed further from the beta "Addaction" stage to the config "User action" stage

However, to get away from the BIS instant repair truck

You have a

1) Vehicle mechanic

(this guy using an addaction system is able to slowly repair any

vehicle that isnt totally destroyed

If memory serves me correct, takes something like 20 minutes to fully repair something that was at 0.9 damage

If you have 2 mechanics working on the vehicle, they repair it at double speed etc etc

The mechanic would walk up to the target vehicle, assess the damage and report back, with an estimated time of repair

He then dumps his weapons on the ground and loops through a series of animations until either the vehicle is repaired or certain "Break out of loop" conditions have occured

2) Recovery vehicle

This has the ability to Winch an overturned target vehicle back onto its feet and recover it to within 10m of the recovery vehicle

This i thought would make a much better system than the insta repair truck that BIS use

This system was designed to be mp compatible, hence not using local setvelocity and minimising setpos during winching

mission.sqm uses wgl classnames, if you dont want to download wgl, then simply edit the mission.sqm with bis classnames

I was gonna try and get a toolbox model and specific recovery vehicle models made, this is the point at which i stopped developing

Download the test mission here

NB>>>

This was a test beta for an idea, so dont expect optimised scripting, i just uploaded the system as i last left it

Recovery system test mission

Share this post


Link to post
Share on other sites

Two replies! This is great, thanks for taking the time to give me a hand!

@ Terox, that's not half bad. Only I personally find the repair times to be sitting at the other extreme as far as time consumption goes. I'll probably fiddle with it to see if I can cut down the time, thanks for posting it.

@Xcess, that looks pretty simple and straightforward, except I'm not sure about implementation of it as far as the first script goes, and what I should put in the initstring of the unit using these scripts.

Share this post


Link to post
Share on other sites

[unitname] exec "repairScrpt.sqs"

there is one problem with this, you can only have one repairMan as prpMan is a global variable. I don't know if there is a way to pass variables to another script executed by an action. If it can be done then the script can be used

multiple people. Or you could just maybe switch rprMan with player.

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  

×