Jump to content
The Dark Mod Forums

Triggers, Timers


Baddcog

Recommended Posts

Seems the wiki is basically void of info on triggers and maybe short on target info.

 

 

So I guess keeping this stuff in one spot will help gather info for the Wiki.

 

==============

Trigger_Relay

Works good for holding a signal for specified time, can be multiple trigger on time or a once only.

 

 

Trigger_Timer

 

Is currently confusing me. Seems it should be as simple as a wait time, and possibly a random time.

 

I used wait 30 and random 29 hoping that between 29 to 30 seconds the signal it recieves from a trigger or switch will be sent.

 

But it just seems to trigger right away.

 

I have start_on set to 0, as I don't want it sending signals from start of map. In fat I only want one signal sent, 30 seconds after switch is thrown.

 

---------------

Trigger_Count

 

Sends signal after time or after number of objects (collected, destroyed?)

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

I'm guessing from the way random works on other entities that it means plus or minus random. So a wait of 25 and a random of 10 (plus or minus 10) would be a random wait between 15 to 35

 

So wait 30 and random 29 might well trigger at 30 minus 29 = 1 second

 

I've not time to look but check for something like wait_for_trigger so it doesn't trigger immediately.

Link to comment
Share on other sites

Trigger_relay works. Just odd that trigger timer doesn't.

 

I am using 30/0 for the relay, so 30 seconds +- 0 = 30. I tried that on the timer too but it didn't wait at all.

 

I'll keep adding my findings to the first post though.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

My first wiki entry on the sound system I did involved triggers. It's not really worth reading for that though.

 

The only potentially insightful thing in there was my discovery that sometimes you can run through a trigger without it registering, which made me suspect that it checks in pulses, like (I'm making up a number here) 2 times a second or something, so if you were running through it, you'd want it thick enough to not be able to pass all the way through between the pulse times. And after some testing I thought a number around at least 32 units thick is good. The thing is, I don't actually know that was the issue. (It reminds me of someone's recent complaint that sometimes when you click a button many times quickly it doesn't register one. Sometimes the sys may just get busy and miss something.) But even if it's another problem like that, making the trigger brush thicker might also be a fix. Anyway, my hypothesis could probably use some more testing by other people to confirm that trigger brushes should be a certain thickness to be failsafe (if this isn't already a known thing), and what thickness is best.

 

Some other issues worth talking about is what things work directly with trigger brushes (just target it from the trigger) -- like doors, buttons, and lights -- and what things need to be mediated with it calling a script; how to deal with "toggle" events (where the trigger-brush toggles it on/off; on that my wiki entry is good to read); a few other things that may come to me later.

What do you see when you turn out the light? I can't tell you but I know that it's mine.

Link to comment
Share on other sites

Yes, always worth trying to test break a proximity trigger. The objectives info location entity has a spawnarg for how often it tests. Dunno if ordinary triggers do. This is also for performance. Testing every micro second is wasteful as I think they have to test every entity to see if it's a valid one like the player. So an EscZone might be an entire street area so one could increase the testing steps to say 2 or 3 seconds. So all these brushes want to be minimum size that works (so less volume to test and less entities inside) and maximum delay between tests that works (with a generous bias on working! ;))

Link to comment
Share on other sites

And another thing you have to worry about with thick trigger_multiple brushes is if you stay too long inside them, and they're toggling something.

 

The engine will find you there, toggle something on, find you there a second later, and toggle it off.

 

Just another factor to add to the problem of time vs. size.

Link to comment
Share on other sites

I will also include objectives triggers with this list because not everyone realizes they can be used purely to trigger stuff and need be nothing to do with objectives. In particular is using the location one to detect not only when the player (or any entity) enters it but when he leaves it. This needs two optional invisible objectives (one a do NOT type.) AFAIK the ordinary triggers can't do this, at least not directly.

Link to comment
Share on other sites

you can change the time on a trigger brush, for it to test whether a player is in the brush or not, I did that for the traveling cabinets in my vertical competition map, the triggers were set to test every 1/8th of a second, and other trigger brushes were set to test if player is in them every 8 seconds for triggering some sound effects.

Link to comment
Share on other sites

 

 

Show all inherited then mouse hover for info

 

I think that's OK, I've deffinately been reading them. But in most cases it doesn't tell you HOW to use exactly, just tells you generally what they should do.

 

Like the timing trigger, it says to set time and 'random time'. I was a bit confused with the random time thing (wasn't sure if it was add/subtract that time or not) but even after setting right or wrong (for the time I wanted) I still couldn't get it to work. So I still wasn't sure if I was doing it right. Now i'm sure it should have worked (but is broken) as the relay works perfectly with same settings.

 

So maybe someone else can test the trigger_timer and see if they can get it to work.

 

But I've always had problems figuring out these things (scripts, entities, etc..), seems like alot of those comments are 'expert level' and I'm usually at 'Dummy level', so hopefully the Wiki will be sorted for the LCD types like myself ;)

 

----------

As far as trigger brushes I've mostly been using trigger_once which I haven't had any issues with. Also nice to know it doesn't constantly check the bounds for player.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

from the def file

 

entityDef trigger_timer {

"inherit" "atdm:entity_base"

"editor_color" "0.3 0.1 0.6"

"editor_mins" "-8 -8 -8"

"editor_maxs" "8 8 8"

"editor_material" "textures/common/trigtimer"

"editor_displayFolder" "Triggers"

"editor_usage" "Repeatedly fires its targets. Can be turned on or off by using. "

"editor_usage1" "The basic time between firing is a random time between (wait - random) and (wait + random)."

 

"editor_var start_on" "whether timer should be active when the level starts."

"editor_var wait" "seconds between triggerings. Use '-1' to indicate one time only."

"editor_var call" "script function to call when triggered."

"editor_float random" "wait variance."

 

"spawnclass" "idTrigger_Timer"

 

"start_on" "0"

"wait" "0.5"

"random" "0"

}

Link to comment
Share on other sites

I'm using a trigger_timer for my cutscene Wiki work.

 

I have one set to go off every 5 seconds, with no random variation:

 

wait = 5

random = 0

 

For debugging, the trigger_timer also triggers a target_callscriptfunction that calls a script function to print the time (in seconds, from when the game began).

 

The printouts say the trigger_timer is triggering every 5 seconds, as advertised.

 

The trigger_timer has another property, start_on, which defaults to 0. If you've accidentally set this to 1, it will start triggering when the map starts. Depending on what you're having it do, it might not work correctly at the point you're trying to use it.

Link to comment
Share on other sites

I had

 

start_on 0 (as I trigger it from a trigger_once)

wait 25

random 1 (tried various settings on these times)

 

Then linked it to a switch. So I should see the switch flip at least once. But it never would.

 

I replaced the time trig with a relay trig with same time settings as above and the switch would flip as intended.

 

So either trigger_timer can't send to a switch, or maybe they only work if start_on = 1 (as that seems to work for grayman)

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

I had

 

start_on 0 (as I trigger it from a trigger_once)

wait 25

random 1 (tried various settings on these times)

 

Then linked it to a switch. So I should see the switch flip at least once. But it never would.

 

I replaced the time trig with a relay trig with same time settings as above and the switch would flip as intended.

 

So either trigger_timer can't send to a switch, or maybe they only work if start_on = 1 (as that seems to work for grayman)

 

As far as I understand the code and comments (from looking at it 2minutes), the trigger_timer is something that works as a timer it self while trigger_multi is a _relay_. So it only works if you first trigger it with another trigger, but you cannot run through it to trigger i t (it is non-touchable).

 

So you need to either:

 

* set it to "start_on" "1" (activates it at map start automatically)

* send it an Activate() signal (from another trigger)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

So either trigger_timer can't send to a switch, or maybe they only work if start_on = 1 (as that seems to work for grayman)

 

I was using start_on = 0.

 

Maybe you can describe exactly what entities are involved, i.e. how are you triggering the trigger_timer?

 

The way a trigger_timer works, when start_on = 0, is:

 

1. Trigger it somehow (run through a trigger_once brush or push a button or activate it from a script function).

2. It fires its targets.

3. It waits for a random time between (wait - random) and (wait + random).

4. Go back to step 2.

 

It will continue to do 2 and 3 until you trigger it again to turn it off (if you need to turn it off).

 

If start_on = 1, then it goes right to step 2 when the map starts.

 

 

 

Link to comment
Share on other sites

I know you guys are trying to help but I've gone through this stuff all day at work.... Tell someone what I did and they ask me what I did...

 

Maybe I'm speaking in tongues and don't realize it, lol.

 

I had

 

edit: It's triggered by a trigger_once:

 

start_on 0 (as I trigger it from a trigger_once brush)

wait 25

random 1 (tried various settings on these times)

 

Then linked it to a switch. So I should see the switch flip at least once. But it never would.

 

I replaced the time trig with a relay trig with same time settings as above and the switch would flip as intended.

 

So either trigger_timer can't send to a switch, or maybe they only work if start_on = 1 (as that seems to work for grayman)

 

With an edit as grayman said he used start_on 0. And in that post I didn't say how I triggered it.

 

Like I said, it wasn't working with timing trigger but was with relay trigger with same settings.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

When something like this doesn't work I always set up a very simple test then gradually modify it to what I want until it breaks so that tells me what wasn't working.

 

Make a numberwheel lever frobbox_size 8 and target the trigger timer and from the timer trigger a light.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 3 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...