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!
Yet another trigger question
Moderator: Moderators
-
dcoshea
- Colour Sergeant
- Posts: 94
- Joined: Thu Mar 04, 2004 3:00 am
- Location: Sydney, Australia
- Contact:
Re: Yet another trigger question
Hi there,
Hope this helps.
Regards,
David
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: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?
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:Game Module Classes wrote:delay( Float delay_time )
Set the delay time (time between triggering and firing) for this trigger
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 teamRegards,
David
-
dcoshea
- Colour Sergeant
- Posts: 94
- Joined: Thu Mar 04, 2004 3:00 am
- Location: Sydney, Australia
- Contact:
Sorry, I thought that was what you wantedblue60007 wrote:But as for the delay thats say I walk through it but it won't fire for another x seconds.
Regards,
David
I guess what you could do is set the wait to something like .5 then in the script:
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...
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
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
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
