Trigger when map starts

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
Quack
Posts: 82
Joined: Thu Sep 07, 2006 6:56 pm

Trigger when map starts

Post by Quack »

I need to make a trigger that fires when the map loads or restarts. I want to target a bunch of entities that will basically start a relay/delay system, so the trigger has to be dependable. I setup a func_timer with spawnflags=1 (start_on), wait=0 and I get this message, "func_timer at ( x y z ) has random >= wait". If I set random=0, then the message does not appear. I don't think this is an error and it seems to work correctly in both instances. Would this be a reliable way of triggering entities on a map_restart?
sock
Posts: 424
Joined: Sat Sep 09, 2000 7:00 am

Re: Trigger when map starts

Post by sock »

'trigger_always' entity always fires whenever you load the map or restart.
Well he was evil, but he did build alot of roads. - Gogglor
My [url=http://www.simonoc.com/]Website[/url] & [url=http://twitter.com/SimsOCallaghan]Twitter[/url]
Quack
Posts: 82
Joined: Thu Sep 07, 2006 6:56 pm

Re: Trigger when map starts

Post by Quack »

Is there a difference in the way 'trigger_always' & 'func_timer' entities trigger their targets? I setup a 'trigger_always' and it appears to work the same as 'func_timer' with wait=0,random=0, & spawnflags=1 (start_on). I'm guessing that they call the same code when the level starts. My concern is that clients may not receive the trigger immediately when the map restarts while playing online. Would one trigger method be preferred over the other?
Quack
Posts: 82
Joined: Thu Sep 07, 2006 6:56 pm

Re: Trigger when map starts

Post by Quack »

I have a few questions about triggers.

1) Do all entities and triggers (buttons, delays, timers, doors, targets) always get reset when a map restarts?
2) For mods, will a 'trigger_always' that triggers a relatively complex relay system work the same way?
3) If you want different relay systems for each gametype (DM, TDM, CTF), will using a 'trigger_always' with a different gametype key work with mods?

A few thoughts about questions three. You could have different 'trigger_always' for DM, TDM, CTF. Only one of these relay system would start depending on the gametype key. Only problem would be if the gametype is not DM,TDM,CTF. So, if it's a mod that specifies a different gametype or tourney mode, the relay system would not trigger which could cause problems if targetShader remaps are required.

Instead, have one global 'trigger_always' that triggers regardless of gametype key. This global 'trigger_always' would then be relayed using 'target_relay' to a DM, TDM, or CTF relay system depending on the gametype key. If these relay systems share a button, targetShader remap or target_speaker, you could target any common entities regardless of which gametype relay system was initiated. This way, if the gametype is not DM,TDM,CTF, the base relay system will always be triggered and depending on the gametype, a different relay system could be triggered for the appropriate gametype.
Post Reply