Jump to content
The Dark Mod Forums

Trigger after X amount of time?


Springheel

Recommended Posts

I'm trying to implement a 'hints' feature, where an on-screen help message will display if a player spends too long in a particular spot. Is there a straightforward way to make something trigger ONLY after a player has spent 5 seconds inside the trigger?

 

I know I can put a wait spawnarg on the trigger, but that just makes it fire 5 seconds after the player enters, even if they have already left by that time. I don't want to show the hint if the player has already moved on.

 

 

  • Like 1
Link to comment
Share on other sites

Trigger multiple, wait 2 sec between triggering --> trigger count 3 --> hint.

 

 

Very close to what I want to do...is there a way to keep it repeating every 3 counts? If I set to "repeat" "1", then the hint fires every 2 seconds.

Link to comment
Share on other sites

"repeat" "Defaults to zero, if 1 the trigger will reset and count up again, if 0 it will only fire once."

"count" "Number of times to be triggered before firing."

So first time fires at 0 sec when player in zone, third time fires at 4sec.

Edited by ERH+
  • Like 1

S2wtMNl.gif

Link to comment
Share on other sites

Working now.

 

There are two other circumstances where I'd like to trigger a hint, but I suspect triggers won't be able to do it...maybe scripts?

 

I'd like to trigger a hint the first time a player frobs an unconscious body.

 

I'd also like to trigger a hint the first time a player looks at a particular AI (it's a hint about his elite helmet).

Link to comment
Share on other sites

I'd like to trigger a hint the first time a player frobs an unconscious body.

 

Add response frob on body. This triggers a trigger_once that triggers whatever you want.

 

No idea about look-triggering, sorry. :(

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Add response frob on body. This triggers a trigger_once that triggers whatever you want.

 

 

There's no way to know which AI the player will KO and frob first...would I have to add that to all the AI? And then would it play each time they frob a new body?

Link to comment
Share on other sites

Oh, you would add the frob trigger to live AI. I do not know if the S&R is moved from a live AI to KOd AI body.

 

If you need to have for all AI, yes, all AI should have the S&R frob trigger. Since the frob trigger triggers a trigger_once, the desired effect only once.

 

Clarification

1) frob AI -> trigger_once -> your desired effect

2) frob AI -> trigger_once (was already fired) -> nothing happens.

  • Like 1

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I'd also like to trigger a hint the first time a player looks at a particular AI (it's a hint about his elite helmet).

 

Obs was working with a trigger_look he made in another thread.

 

If that doesn't fit your circumstance, you could run a short script every second that checks whether the player can see the AI with the helmet. If the player's supposed to voice-over some comment, then you play that and kill the script so it only happens once.

Link to comment
Share on other sites

Is there a good place to read about using stim/response? The wiki article I found doesn't help much at all.

 

I used the stim/response editor to add a frob response to an AI. Then I targeted the AI at a trigger_once entity, which targetted a gui_message. But nothing happened when I KO'd and frobbed the AI.

 

The stim/response editor seems to have a field for "response effects" but I'm not sure how to use it.

 

 

edit: I also tried adding:

 

"sr_effect_5" "target"

"sr_arg1_5" "message_body"

 

But that also didn't work.

Link to comment
Share on other sites

1) choose AI

2) Entity -> Stim/response editor

3) response tab

4) from the drop down menu choose Frob

5) right click response effects box on the right

6) add new effect

7) double click the newly added effect

8) effect: trigger (choose from drop down menu)

9) Target (name of your trigger_once)

 

Now if the AI (when he is alive) has "frobable 1", you should give him the frob effect and thus activate the response effect trigger, which triggers the entity you named in the "target" section. This *will* work, I did it in Transaction, when the player needs to frob (not Trump style) the tortured girl to give her the go-ahead to run to safety.

 

As said earlier, I am not sure if the Stim/Response setup is forwarded to the ragdoll, if the AI is knocked down. Please test. It would be useful to know if it is forwarded to the ragdoll or not.

 

If it is NOT forwarded to the ragdoll, this S&R approach will not work and some other, more complicated setup is needed, which goes beyond my level of expertise. Sorry about that. :(

  • Like 1

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Wow, that step 5 is really non-intuitive. I would never have tried that.

 

Now I'm stuck on step 8, because the list of effects goes off the bottom of my screen, and I can't scroll down to Trigger, nor can I type it in manually! :rolleyes:

 

edit: I moved my taskbar and was able to select it. Moving on....

Link to comment
Share on other sites

I got so interested that I had to test myself.

 

I set it up as I mentioned. When the AI is alive, frobbing him switches a light on and off as it should

When I KO the guy, the light can be switched by frobbing the KO's AI ragdoll.

 

Good times, the S&R can be used to implement the feature you need. Whoo! :D

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

 

Obs was working with a trigger_look he made in another thread.

 

Looks like that does exactly what I want: http://wiki.thedarkmod.com/index.php?title=Triggering_events_when_looking_at_something

 

Is there any reason why we never added this to the default script folder?

Link to comment
Share on other sites

 

 

I'd like to trigger a hint the first time a player frobs an unconscious body.

I've seen you already found an answer but just for completeness, each ai has a spawnarg equip_action_script and dequip_action_script which points to scripts that gets called when the player picks up or drops a body.

  • Like 1

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

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

    • 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.
      · 6 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
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...