Home   Help Search Login Register  

Author Topic: How triggers passes variables to a script?  (Read 461 times)

0 Members and 1 Guest are viewing this topic.

Offline myke13021

  • Contributing Member
  • **
  • Myke
How triggers passes variables to a script?
« on: 31 Mar 2004, 16:45:40 »
I got a little problem. I did read the Basic trigger tutorial, but i think it is too basic because i didn't found an answer there. I also tried a search on the Forum but didn't got an answer to my problem.
So i try it directly  ;D

I have a trigger, activated by anybody present repeatedly. In the on activation box i put:

myaction = player addAction ["Hello", "hello.sqs"]

this is an example i'm working with to check if and how it works, the final action will have different name  ;)

As far as good, till now all works. But now i get stucked.

I want the Script to check if the player is WEST or Civilian (Well, actually it checks only if it's west and it presumes when not, he is Civilian since i have no other side on map)

these lines i tried:

?(player == WEST): goto "westguy"

and:

?(_x == WEST): goto "westguy"

The part the script should do when it's civilian follows right after this part and when it's west it jumps to #westguy

I tested this with a west unit, but the script showed me only the Civilian hint i made so it doesn't recon the player (me) as a west guy.

what did i wrong?

Hope you can help me  :-\

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:How triggers passes variables to a script?
« Reply #1 on: 31 Mar 2004, 16:56:20 »
how about


_dude = _this select 1
?(side _dude == WEST): goto "westguy"
hint "you're not a westguy"; exit
#westguy
hint "You're a westguy";exit
Not all is lost.

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re:How triggers passes variables to a script?
« Reply #2 on: 31 Mar 2004, 17:00:57 »
omg...i'm so fucking stupid... >:(
just forgot the side param

?(side player == WEST): goto "westguy"

this works fine

what a single missin word can fuck up...lol ;D

hay thx alot Artak for your fast reply...you're a hero  ;)