Page 1 of 1
Yet another trigger question
Posted: Tue Mar 16, 2004 10:41 pm
by blue60007
OK I need a trigger_multiple but I want it to be 'triggered' for say 10 seconds before it is triggered. Basically I have a room that I want the person to be in for a certain amount of time before triggering. Also how do I set it so it works for only one team?
THanks!
Re: Yet another trigger question
Posted: Wed Mar 17, 2004 12:02 am
by dcoshea
Hi there,
blue60007 wrote:OK I need a trigger_multiple but I want it to be 'triggered' for say 10 seconds before it is triggered. Basically I have a room that I want the person to be in for a certain amount of time before triggering. Also how do I set it so it works for only one team?
I'm not sure on either of these things, so you might want to wait on confirmation from an expert (experts: please confirm what I have to say, or correct me!) but I think that to delay the calling of your 'setthread', you should set the 'delay' for the trigger:
Game Module Classes wrote:delay( Float delay_time )
Set the delay time (time between triggering and firing) for this trigger
As for only triggering for a certain team, I don't think you can do that, so I think you have to just put some code like this in the top of your 'setthread' thread:
Code: Select all
local.player = parm.other
if (local.player.dmteam != "allies") { // or "axis" if that's the team you want
end // exit the thread immediately since the player is not on the team we're interested in
}
// do processing here, knowing the player is on the correct team
Hope this helps.
Regards,
David
Posted: Wed Mar 17, 2004 12:30 am
by blue60007
Well thanks but I've decided just to forget this feature of the map, it won't be triggerable it'll just go on its own. But as for the delay thats say I walk through it but it won't fire for another x seconds.
Posted: Wed Mar 17, 2004 12:34 am
by dcoshea
blue60007 wrote:But as for the delay thats say I walk through it but it won't fire for another x seconds.
Sorry, I thought that was what you wanted

I guess you don't need that functionality now, but if you do, let me know and we can try and figure out a solution that meets your requirements.
Regards,
David
Posted: Wed Mar 17, 2004 1:00 am
by blue60007
I guess what you could do is set the wait to something like .5 then in the script:
Code: Select all
level.triggercount = 0
trigger:
{
level.triggercount ++
}
if (level.triggercount == 10)
{
level.triggercount = 0
goto whatever
}
else
{
goto trigger
}
then maybe you could incorporate a feature that resets triggercount to 0 if when it is > 0 and doesn't reach 10 within 30 seconds or something...
nope
Posted: Wed Mar 17, 2004 1:19 am
by tltrude
In your thread, if it runs at all, the count will reach 10 in the blink of an eye. It needs a "wait 1" to make it slow down to one loop per second.
You don't need brackets around "level.triggercount ++" and "goto trigger". Also, it is not a good idea to name the thread "trigger" because that is a command word.
level waittill prespawn
level.triggercount = 0
level waittill spawn
end
trigger_timer:
level.triggercount ++
if (level.triggercount == 10)
{
level.triggercount = 0
goto whatever
end
}
wait 1
goto trigger_timer
end
Posted: Wed Mar 17, 2004 2:07 am
by blue60007
but would you need the wait 1 if you set a key/value of wait/1 in the trigger because then wouldn't that make it 2 seconds wait??
oh yeah, I forgot you don't need brackets there, I've been doing a little bit of C++ lately...