Home   Help Search Login Register  

Author Topic: Trigger to activate the first time each player enters?  (Read 1023 times)

0 Members and 1 Guest are viewing this topic.

TheCaptn

  • Guest
I'm still working on the same mission. I've managed to figure out out everything except this.

I've got my three players and I want them to activate a trigger the first time each of them enters it's zone. But I only want to activate it on -that- player's computer.

You see they may be there as a group, but they may not... If the first person to reach it activates the trigger for all of them and the other two aren't present then that story element won't make any sense to them.

So far I'm calling the story.sqs (which contains each plot thread for each player) directly from my triggers but if this needs a seperate script I'll call the story.sqs from that and and call the new script from the trigger.
I'm just struggling to work out how I'd structure a script to do it.

AK-Chester

  • Guest
Re:Trigger to activate the first time each player enters?
« Reply #1 on: 28 Jan 2005, 18:48:03 »
Activation: Anybody (present, once)
Condition: this && player in thislist

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Trigger to activate the first time each player enters?
« Reply #2 on: 28 Jan 2005, 20:14:12 »
Name the units
W1
W2
W3

Init.sqs
tx_Runonce = false


Trigger
Activation: Anybody (repeating)
Condition: (vehicle player in thislist)
on Activation: (vehicle player in thislist) exec "myscript.sqs"

Myscript.sqs
? !(local Player): exit
? (tx_Runonce): exit
?(Player == W1):tx_Runonce = true
?(Player == W2):tx_Runonce = true
?(Player == W3):tx_Runonce = true
........ then state whatever lines you want in the script



this will make sure each one of the 3 players will only run the script in its entirity once and only when they activate the trigger
« Last Edit: 29 Jan 2005, 20:11:55 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Offline Fragorl

  • Coding Team
  • Former Staff
  • ****
Re:Trigger to activate the first time each player enters?
« Reply #3 on: 29 Jan 2005, 08:47:06 »
Do you only want the trigger to run once all three are there? If so try
condition: "_x == player" count (thislist) == 3
maybe that'll work

Also, the statement "player in thislist" returns a bool so saying
player in thislist exec "myscript.sqs"
is like saying
(true/false) exec "myscript" - perhaps that was a typo?