Home   Help Search Login Register  

Author Topic: sabotage addaction script  (Read 731 times)

0 Members and 1 Guest are viewing this topic.

bootneckofficer

  • Guest
sabotage addaction script
« 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

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:sabotage addaction script
« Reply #1 on: 26 Nov 2005, 19:51:55 »
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:
Code: [Select]
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
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:sabotage addaction script
« Reply #2 on: 26 Nov 2005, 23:40:27 »
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.
Plenty of reviewed ArmA missions for you to play