Jump to content
The Dark Mod Forums

Recommended Posts

Posted

I'm trying to set up a Stim/Response system for a furnace that powers a room (lights, doors, etc). One thing I want to do is activate a speaker to play the generator startup sound/running loop from a fire stim, and stop the speaker from a water stim.

The problem is that the only way to activate a speaker I know of is by trigger, and triggers don't differentiate between Activating and Deactivating. Lights and Frob settings can be toggled On/Off with Responses, but there's nothing for speakers. So right now I have a Fire and Water stim activating a trigger targeting the speaker, and either stim can start or stop the speaker. If the player uses a fire stim originally (as intended) and a water stim to stop it, everything works as intended. If, however, a player starts by using a water arrow on the furnace, the generator noise will start, and the Fire stim will stop it.

I'd like to set it up so only a Fire stim will start the speaker, and only a Water stim will stop it. Do I have any options in DarkRadiant for this, or would I need to do scripting?

Posted (edited)
  1. Water arrow shot at entity in question : Machine off shall play
  2. Fire arrow shot at entity in question: Machine on shall play
  3. Fire arrow shot AGAIN at entity in question: nothing shall happen
  4. Water arrow shot at entity in question: Machine off shall play
  5. Water arrow shot AGAIN at entity in question: nothing shall happen

 

correct?

Edited by JackFarmer
Posted
1 minute ago, JackFarmer said:
  1. Water arrow shot at entity in question : Machine off shall play
  2. Fire arrow shot at entity in question: Machine on shall play
  3. Fire arrow shot AGAIN at entity in question: nothing shall happen
  4. Water arrow shot at entity in question: Machine off shall play
  5. Water arrow shot AGAIN at entity in question: nothing shall happen

 

correct?

Yes, that is correct. The generator is in an off state at map start, so the first arrow would be Fire (generator on), but otherwise this is the situation I'm aiming at.

Posted

You can probably do this by creating two identical entities, one that responds only to a fire arrow stim and one that responds only to a water arrow stim, and use the atdm:teleport entity to swap between them as required.

  • Like 1

My missions:      Stand-alone                                                  Duncan Lynch series           Collabs                             

                                 Down and Out on Newford Road          the Factory Heist                  A Collector's Errand (with Bikerdude)

                           The Wizard's Treasure                          A House Call

                                                                                           The House of deLisle                                                                                                  

                              

Posted
30 minutes ago, thebigh said:

You can probably do this by creating two identical entities, one that responds only to a fire arrow stim and one that responds only to a water arrow stim, and use the atdm:teleport entity to swap between them as required.

@Jnon

This might be the easiest approach (if you do not want to script something). Doing so would also remove the need to check whether a water or a fire arrow has been fired as at this particular moment only one item is in place and does only react according to the defined stim property.

  • Like 2
Posted

This functionality is already integrated into extinguishable flame entities' scroptobjects (check the light sources folder for i.e. torch flames that play sounds when lit and extinguished). You can also tag on your other stim effects to that entity's water and fire responses.

The best way is still to make a pair of short scripts that share a global variable for the speaker state.

Posted
On 9/19/2025 at 2:35 PM, Dragofer said:

The best way is still to make a pair of short scripts that share a global variable for the speaker state.

I'd need to read through some scripting tutorials, I don't have much experience with that side of things yet.

Posted
9 hours ago, Jnon said:

I'd need to read through some scripting tutorials, I don't have much experience with that side of things yet.

There's this guide that I wrote:

https://wiki.thedarkmod.com/index.php?title=A_to_Z_Scripting

in particular:

https://wiki.thedarkmod.com/index.php?title=A_to_Z_Scripting:_Ways_of_calling_a_script#Stim/Response
https://wiki.thedarkmod.com/index.php?title=A_to_Z_Scripting:_More_scripting_basics#Where_to_create_variables
https://wiki.thedarkmod.com/index.php?title=A_to_Z_Scripting:_More_scripting_basics#Using_the_TDM_Script_Reference

2 hours ago, datiswous said:

Do you know a mission that uses this?

I think Goldwell likes to use such setups. But basically all you need is to have an extinguishable light entity with its snd_lit and snd_extinguished spawnargs matching the sounds you need, as well as a tiny light radius and maybe some low-profile lit/extinguished particles so it can be hidden more easily.

  • Like 1

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.

×
×
  • Create New...