OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bootneckofficer on 26 Nov 2005, 17:36:26
-
heya all,
i want to have an addaction command make me(the player) sabotage a radio transmitter (t0) and do a switchmove (like hes fixing something to the transmitter) how would it be scripted? then when this is done how i get it to say "0" objstatus "done"???
bootneckofficer
-
OK, I think this will work, but i'm not too good at this type of thing ;)
Make a trigger where you want the action will come up. This might be a circle with a 5m diameter on the radio.
In the triggers 'on activation' line, put this:
action1 = player addaction ["Destroy Radio Transmitter","destroy.sqs"]
Then make a script. Put something like this in it:
player removeaction action1
player playmove "CombatToMedic"
~4
t0 setdamage 1
~3
player playmove "MedicToCombat"
hint "Radio transmitter sabotaged"
~1
"0" ObjStatus "DONE"
exit
Call it 'destroy.sqs'
That should work. I'm not sure if the animations are right, I just guessed. That might give you the animation the same as what a medic does when hes treating a wounded guy, it might not ;)
Experiment using this list:
http://www.ofpec.com/editors/resource_view.php?id=471
One problem is that the action will stay there if the player leaves the trigger without destroyig the radio. I'm not sure how to stop this offhand, but i'm sure someone else knows.
Good luck
-
Add the action to the object to be destroyed, not the player. It will automatically appear in the player's Action menu when he gets close enough. When the Action is used, remove it from the object so that it does not continue to appear.
Other than that, greg147's answer is spot on in principle.