Jump to content
Sign in to follow this  
Somerville

Rearming an AV8-GBU

Recommended Posts

Having problems here guys.

For -{GOL}-'s training map, we need to be able to rearm an AV8 when it lands. However close I get the rearm truck to the plane, it just won't let me rearm when I get back in the plane.

Any ideas fellas? Cheers

Share this post


Link to post
Share on other sites

Sounds like the old OFP rearm script bug. The wiki suggests it has been fixed for land vehicles but not air units.

You can make a new rearming script, use removeMagazine then addMagazine.

Share this post


Link to post
Share on other sites

Christ. Could anyone whip me up a quick rearming script at all? Ha, cheers for any help!

Share this post


Link to post
Share on other sites

I have a rearming script that works for chopper, haven't tried it on planes, but you are welcome to try it:

put a trigger in the rearm area, and call this script with it:

Landing.sqs

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

_koef = 4;

#Again

PlayerOut = true

@ ({vehicle player == _x} count list AirportIn > 0) and vehicle player != player and speed (vehicle player) > -2 and speed (vehicle player) < 2

_timeNow = _time;

@ !(({vehicle player == _x} count list AirportIn > 0) and vehicle player != player and speed (vehicle player) > -2 and speed (vehicle player) < 2) or (_time-_timeNow >= _koef)

? !(({vehicle player == _x} count list AirportIn > 0) and vehicle player != player and speed (vehicle player) > -2 and speed (vehicle player) < 2) : goto "Again"

; Now he is at the airport!

? side player == east : EastWho = player;

? side player == west : WestWho = player;

PlayerOut = false;

player exec "Repairs.sqs";

? side player == east : goto "EastSide"

WestScored = true;

publicVariable "WestWho";

publicVariable "WestScored";

goto "SideEnd";

#EastSide

EastScored = true;

publicVariable "EastWho";

publicVariable "EastScored";

#SideEnd

@ not alive player or ((getPos player select 2)>20 and (({vehicle player == _x} count list AirportIn == 0)))

goto "Again";

Then put this script in your mission folder as landing.sqs calls it:

repairs.sqs

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

_who = _this;

? not local (_who) : exit

; Rearming

@ (vehicle _who != _who) or not alive _who

? not alive _who : exit

_veh = vehicle _who;

;;to be edited soon for rearm

; Repairing

_koef = 0.5;

_who sidechat "Crewchief, requesting service"

CrewChief sidechat "Roger, service on the way"

~5

CrewChief sidechat "Commencing service"

#LoopRepair

? PlayerOut : goto "getback";

_timeDif = _time;

@ !(({vehicle player == _x} count list AirportIn > 0) and vehicle player != player and speed (vehicle player) > -2 and speed (vehicle player) < 2) or (_time-_timeDif >= _koef)

? !(({vehicle player == _x} count list AirportIn > 0) and vehicle player != player and speed (vehicle player) > -2 and speed (vehicle player) < 2) : goto "LoopRepair"

? getDammage _veh > 0 : _veh setDammage ((getDammage _veh)-0.0125);

? getDammage _veh <= 0 : CrewChief sidechat "Repairs complete, commencing refueling"; goto "gasup";

goto "LoopRepair";

#gasup

? PlayerOut : goto "getback"

? fuel _veh < 1 : _veh setfuel ((fuel _veh) + 0.0125);

? fuel _veh >= 1 : CrewChief sidechat "Commencing rearm"; _level = 0; _veh setvehicleammo .1; goto "rearm"

~1

goto "gasup"

#rearm

? PlayerOut : goto "getback";

_level = _level + .1

_veh setvehicleammo _level

~2

?_level < 1 : goto "rearm"

goto "end"

#getback

CrewChief sidechat "Wait! Service incomplete"

goto "endi"

#endi

CrewChief sidechat "OK then, we didn't finish but there you go anyway"

exit

#end

CrewChief sidechat "Service complete, be careful out there!"

exit

Share this post


Link to post
Share on other sites

@Zombie

I tried your script, with the trigger. I can not get it to work.

I must be setting up the trigger wrong.

Please list how to setup the trigger correctly.

If you have a demo mission showing how to do this, I would like to grab it, if that is possible.

Share this post


Link to post
Share on other sites

@Zombie

I got this to work. My fault, I assumed that once you land, and had no damage it would rearm. Once I figured out, that I could only rearm / refuel if I had damaged, it worked fine.

Any plans to modify this so that if you have no damage, it will still rearm / refuel? That would be great if you could get that to happen.

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  

×