Home   Help Search Login Register  

Author Topic: Checking if anyone is in a trigger - condition  (Read 1232 times)

0 Members and 1 Guest are viewing this topic.

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Checking if anyone is in a trigger - condition
« on: 29 Mar 2007, 20:59:48 »
Hi

2nd Question..

I have an enemy attack mission where you must hold a base.

I need to make it so the enemy enter the base and enter a trigger. They get there ok and activate the trigger. However this makes the ending instant.

How would I have a script to check if any member of a group is still in the trigger, with a 1 second loop for 10 seconds?

I have a feeling it's something like this:

Code: [Select]
_group = group1
_i = 0

#loop
?!(_group in trigger) : exit
?(_i >= 10) : goto "end"
~1
_i = _i + 1
goto "loop"

#end
;script if 10 seconds is up and someone is still in that trigger from a certain side - meaning the team loose

exit

It doesnt work :S

Thanks for your help.

Offline Cheetah

  • Former Staff
  • ****
Re: Checking if anyone is in a trigger - condition
« Reply #1 on: 30 Mar 2007, 00:12:43 »
Attached is a working example (tested various things so should always work and should keep working).

I use two triggers, one for detecting if the player is inside the trigger radius, the other for ending the mission. Check it out, mission file in the zip - mission takes place at the small Rahrani map.

If you want to use the script, let me know.

EDIT: did the two trigger thing, because I dislike using scripts for things that can be easily accomplished with triggers.
EDIT1: oops, atttached
« Last Edit: 31 Mar 2007, 09:30:25 by Cheetah »
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline JasonO

  • OFPEC Patron
  • ****
  • Oh no...
    • The New Life RPG
Re: Checking if anyone is in a trigger - condition
« Reply #2 on: 31 Mar 2007, 04:36:18 »
Did you attach it?  ???

Exactly what I wanted, Thanks cheetah  8)
« Last Edit: 08 Apr 2007, 18:13:19 by JasonO »