Home   Help Search Login Register  

Author Topic: addactions and distance  (Read 1785 times)

0 Members and 1 Guest are viewing this topic.

BAD ASS JACK

  • Guest
addactions and distance
« on: 26 Jun 2003, 17:49:44 »
ok where do i start...?

hi, im trying to set up a trigger system that uses distance from player the exec script, but using distance from wasent accurent enough and you could use the addaction on the other side of the wall! ::)

so now i got a trigger set up so if player is in place addaction an addaction apears, and when u are out of place the addaction disapears, and if u go back into the trigger it comes back again, now the problem is making it removeaction again?, which it wont do  ??? and because it wont remve action but can keep adding them your action list can get pretty screwed up with all the actions :-\

any help would be great  ;D

Knut Erik

  • Guest
Re:addactions and distance
« Reply #1 on: 27 Jun 2003, 13:36:15 »
About your second Qs. You'll have to give the action an ID. Like this..

MyActionID = Player addaction ["BlahBlah","Blah.sqs"]

And then in the deActivation field

Player RemoveAction MyActionID

The first Qs.
I dunno...  :P

max_killer_payne

  • Guest
Re:addactions and distance
« Reply #2 on: 28 Jun 2003, 10:09:00 »
Something along the lines of this, of course you would need to edit it for your own purposes.

_unit = _this select 0
_player = _this select 1
?runonce: goto "whenadd"
actionnumber = 0

this means at 5m the addaction will come on, and when you leave 5m, it will come off

#whenadd
?(_player distance _unit < 5): goto "action"
~0.3
goto "action"

#action
runonce=true
action = _player AddAction ["Do Thingy","thingy.sqs"]
;here I am IDing the action, to a name which is action, so when you use the action in the game OFP will recognise you just used 'action'
~0.3
goto "start"

#start
?nameofthisscript: goto "whathappens"
?(_player distance _unit) < 5: goto "start"
_player RemoveAction (action)
actionnumber = (actionnumber + 1)
goto "action"

#whathappens
titletext["Yes! We got it","plain",2]
;or whateva u want to happen here
goto "nomore"

#nomore
nameofurscript=false
_player removeaction action
actionnumber = (actionnumber + 1)
exit


Offline Kommiekat

  • Members
  • *
Re: addactions and distance
« Reply #3 on: 26 Aug 2011, 10:40:29 »
So, where exactly does that code go?
Into a Triggers On Act field??

Thx