Home   Help Search Login Register  

Author Topic: Alarm after being detected for x seconds  (Read 816 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Alarm after being detected for x seconds
« on: 21 Jan 2005, 17:58:06 »
I have been trying to set up a trigger so that when a player is detected by the enemy for a length of time, say 30 seconds, an alarm is sounded.  I only want the alarm to be sounded if the enemy is not killed quickly enough and has detected me.  If I am detected but then manage to hide in under 30 seconds, I do not want the  alarm to sound.

I have placed a large trigger with "east detected by west" "repeatly" and "timeout max min mid  = 30,30,30". If I as an east soldier kill all the west soldiers within the trigger in under 30 secs, but then remain within the trigger, the alarm still sounds.  
« Last Edit: 21 Jan 2005, 17:58:37 by Mr.Peanut »
urp!

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Alarm after being detected for x seconds
« Reply #1 on: 21 Jan 2005, 18:23:14 »
m'kay, well i'm not sure not having the thing in front of me, but i suspect if you create a variable like 'all_west_dead' which is true when all the badguys are gone, and then in your alarm trigger add the condition that 'all_west_dead' has to be false, it should work.

good luck :)

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Alarm after being detected for x seconds
« Reply #2 on: 21 Jan 2005, 18:58:20 »
I did this successfully in a mission I am now working on.  I do not remember off the top of my head how I did it (I am at work).  But as soon as I get home I will look at how I did it.  I think I made an array of all the pertinent units and then put {! alive _x} count PERTINENT == 0 in the condition field.  So that after the timeout time, if all the units are dead, the alarm will not sound.  But I am not exactly sure of the syntax and also how I made the array (probably a "thislist" tigger), so I will repost when I am sure. I think it required a third trigger also.  One to make the thislist array, one to do the detected and timeout and one to actually trigger the allarm, but only if the some of the units are alive.

Offline markb50k

  • Members
  • *
  • That's a bunch of bunk
    • Galactic Simulation
Re:Alarm after being detected for x seconds
« Reply #3 on: 21 Jan 2005, 19:41:31 »
but wouldn't that mean that the player would have to kill ALL west in that trigger area for the alarm not too sound?

I think the original poster wants it so that if he kills the "detecting" west dudes (anyone who actually sees him) in time, it prevents the alarm.

is there a function like "isDetected" that can be run on a unit to see if someone is still detecting him?  perhaps that would be the way.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Alarm after being detected for x seconds
« Reply #4 on: 21 Jan 2005, 21:57:16 »
Your trigger sounds okay, but change the  Countdown option to Timeout.

The trigger will then only fire if the condition has been true for the whole 30 seconds.  If it becomes false after 29 seconds and then true again the 30 seconds timer starts again.
« Last Edit: 21 Jan 2005, 22:06:00 by THobson »

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Alarm after being detected for x seconds
« Reply #5 on: 22 Jan 2005, 03:32:17 »
OK, my version is a bit different.  I made it so that if detected, certain enemy units are designated alarm trippers.  These units will run to a tent next to a tower (I put a falshing red light in the tower that turns on/off while the alarm also sounds).  If these are killed a script selects a new group of alarm trippers (5 at a time from all the units in the base area at the time the enemy is detected).  Anyway, if any of the units reach the tent they will trip the alarm after being present and alive for 3 seconds.  If they are killed before they have time to trip the alarm, then all is well until another unit runs to the tent.  Right on the "alarm tent", I have a square trigger the size of the tent (3 X 3) that is set to east present,  repeatedly.  It has a countdown of 3,3,3 (max, mid, min).  In the condition field I have:  This
In the on activation field I have:  alarmmen = thislist; alarmcheck = true.  On the deactivation feild I have:
alarmcheck = false (but I do not think I need this)

On the tower (which is the location of both the alarm sound and flashing red light) I have a trigger set up thusly:

Condition feild: alarmcheck && {alive _x} count alarmmen > 0
Activation feild: [twrlight] exec "flash.sqs"

Then in EFFECTS I have Alarm in the trigger catagory (so the alarm sounds while the light flashes on and off).

So my verison is not exaclty what you are doing.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Alarm after being detected for x seconds
« Reply #6 on: 22 Jan 2005, 10:57:34 »
I think if instead of countdown you had timeout set for the first trigger then it would only fire if any of the loons are still alive at the end of the 3 second period.  I believe that is what you want, and that way you could do it all with one trigger.

The Activation field woud be: [twrlight] exec "flash.sqs"
Condition : this

You would set it repeatedly if there will be multiple alarms or to fire once if there will only ever be one alarm

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re:Alarm after being detected for x seconds
« Reply #7 on: 25 Jan 2005, 17:04:40 »
THobson,

I think you are right.  But if one wants to use the idea of there being a certain place the enemy must go to set off the alarm, then you need multiple triggers and a repeated trigger (so that you can have repeated "waves" of bad guys attempting to get to the alarm "button" to set it off.  I think this is more realistic than the alarm spontaneously going off just because they have seen you.  They are, after all, supposed to be "human" and not the "Borg Collective" where they can call for an alarm by telepathy. ;D