Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

The breakdown of the stim/response system is that entities can be set to emit stims around themselves, like a signal. If the stim reaches another entity that has a response to that type of stim, that entity will perform various response effects. For example a fire arrow emits a fire stim in a radius of x units every y milliseconds, so if an unlit candle with a fire response comes within that distance it'll perform the "relight self" response effect. The key part is that the stim is on one entity while the response is on a different entity.

You can also create your own custom stims, for example the audiographs consist of stim-emitting tapes and machines that respond to that stim type. If you bring them close enough together a script is called to insert the tape and start playing the sound.

Most stims are distance-based, but there are special cases such as frobbing and collision-based. Most of the stim types (fire, holy, visual etc.) only differ in name and ID #, and work the same way.

  • Thanks 2
Link to comment
Share on other sites

Regarding the earlier discussion about telling when an objective is complete from script, I just added a brief entry under the wiki's "Objective Editor/FAQ & Examples" called "Determining an Objective's Current State from a Script"

As for as Stim/Response... I often find it hard to wrap my head around too. I don't recall writing anything very authoritative about it, but maybe in some narrow context? Or maybe @JackFarmer, you were remembering someone else's explanation?

So, I can put it on my list of possible wiki topics for 2024, but it would require a lot of research by me, and likely @Dragofer or others could do it better & quicker.

  • Like 1
Link to comment
Share on other sites

On 12/15/2023 at 4:36 PM, JackFarmer said:

I know what you mean. Springheel used this once in a tutorial for traps, but in the end I just copied his methods and didn't understand much.

However, there is a different S/R application I understood and I find very handy. If you pick a random frobable entity, go to S/R and click on responses, you can select the Stim "Frob".

grafik.thumb.png.046a628af26dfc1d9f50d36da6886b9d.png

If you then press the right mouse button in the response effects area, you can activate effects such as:

  • clear/add targets on AI
  • turn off/on lights
  • play sounds
  • remove items
  • run scripts
  • change frobability
  • set skin
  • trigger entities
  • set light color

Unfortunately, the last one (changing the light color) doesn't work so well. I have noticed that this effect is reset when you save and reload the game. However, I have not yet noticed this with the other effects (and frobability/remove works perfectly, I use them all the time.

But that's only one of the possibilities, certain stims, as I understand it, work on approximation, and you can do cool things with them.

There's also a Wiki entry written by  Sparhawk, who coded it. Unfortunately I don't understand much there either.

I don't even dare to ask, because Geep has already done so much, if he could revise this section and provide understandable examples for both stims/responses.

@Geep Didn't you once open a topic in which you explained the use of stims? That was very informative, but unfortunately I can no longer find it.

 

This is really useful and should be added to the examples section on this page.  I recently added the one for the burn damage, as that seems like the type of thing a new mapper might want to try and do.  it took me a while to figure out how to do it and I felt quite dense, but after hearing that others didn't find it straightforward either I don't feel so bad now 😂

  • Thanks 1

TDM Community Github: https://github.com/thedarkmodcommunity

My fan missions: The Hare in the Snare, Part 1

The Lieutenant Series: In Plain Sight  High Expectations Foreign Affairs

Link to comment
Share on other sites

So, I wanted to build on my good experiences with the "Frob" stim/responses that are attached to all entities and find another use for them...and I failed again.

Task:

If the player extinguishes a certain flame (A) with a water arrow, a script should be started and A should be completely removed from the map (so that it cannot be ignited again with a fire arrow).

Solution idea:

Every flame has an inherited response to water/water arrows. You can also see this in the S/R editor.

So I thought, I'll just add another response to water on the flame and add the desired commands.

Result:

It doesn't work, the script won't start and A does not get removed.

What am I doing wrong?

grafik.png.d3ff74d06816e837892edca8c38c10d1.png

@Dragofer: Sorry for being such a pain, but this drives me crazy.

@grodenglaive@Frost_Salamander: For your information...Maybe we should start an extra topic for the the whole subject...?

 

  • Like 1
Link to comment
Share on other sites

3 hours ago, grodenglaive said:

I also tried to deactivate the inherited water S/R (right-click on it to select that option), but that didn't have any effect.

For a workaround, I guess you could apply the S/R to the whole torch and then add a third response to spawn an unlit torch model in it's place.

I really wish it had been my stupidity and that you could confirm that it works exactly as I described.  :(

I don't have a torch by the way. I have a magic light, but then I should be able to just create an invisible dummy func-static with the S/R properties...?

Even worse is that you can't seem to turn off the response to water. In addition I need a flame that can't be extinguished with water. To achieve that, I thought I could simply deactivate the water stim. (EDIT: this seems to work fine).

Edited by JackFarmer
Link to comment
Share on other sites

@JackFarmeryour new water response might be getting counted as a separate response. Something I'd try is to transfer your new response effects to the inherited version of the water response. To do so, look at the spawnargs that mention your new effects (maybe something like "sr_response_effect6" "run_script") and change the number to the same ID as the inherited water response. Delete your own water response afterwards.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, Dragofer said:

@JackFarmeryour new water response might be getting counted as a separate response. Something I'd try is to transfer your new response effects to the inherited version of the water response. To do so, look at the spawnargs that mention your new effects (maybe something like "sr_response_effect6" "run_script") and change the number to the same ID as the inherited water response. Delete your own water response afterwards.

You are right; this works! :)

 

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...
52 minutes ago, JackFarmer said:

Is there a way to

  • reduce the sound of the thunder? (s_volume on the entity does not work)
  • put the "ai_see - 0" property on the lightening?

 

grafik.png.d91b02ae1bb4edc94b16665c3be920c2.png

Id try calling a script event to fade the entity's volume to something lower than 0. Otherwise youll probably have to copy and modify the .fx definition.

  • Thanks 1
Link to comment
Share on other sites

Hello again, TDMers.

I am at a point where I need to lay monsterclip below uneven terrain to ensure sensible AI pathfinding.

Consider three methods that produce the same top surface profile, though I imagine more are possible:

1) Flat layers one on top of another but not overlapping.

2) Blocks that intersect through each other/overlap.

3)  Big central block with non-overlapping "steps" around that block.

Is there any best way to do this?  Any worst way? No real difference?  #1 and #2 use only two brushes while #3 uses more, so, I imagine fewer brushes is better.

Advice?

Clint

 

MonClip001.jpg

Link to comment
Share on other sites

On 12/29/2023 at 5:44 PM, Dragofer said:

 Otherwise youll probably have to copy and modify the .fx definition.

Went for the thunder def file and added the last lines as follows:

 

fx fx/thunder
{
	{	//creates light
		delay 0
		name "thunderlight1"
		duration 0.4
		restart 0
		light "lights/biground1", 0.35, 0.35, 0.7, 99999
		ai_see 0
	}

...

{ // sound
		delay 1.5
		name "thundersound"	
		sound "thunder"
		duration 10
		s_volume -15
	}
}

Repeated this for every other thunder/lightening def in the relevant file, but the added lines at the end do not work...

  • Like 1
Link to comment
Share on other sites

3 hours ago, JackFarmer said:
sound "thunder"

This should be a sound shader. In the soundshader, you can define the volume I think.

https://iddevnet.dhewm3.org/doom3/sounds.html

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

image.thumb.png.836692bd2331b4acaa5021e9fff5c0eb.png

So copy this file to your mission in the same path and edit the volume in the file.

 

Just my assumption. Sorry if it's nonsense.

Edited by datiswous
  • Thanks 1
Link to comment
Share on other sites

5 hours ago, joebarnin said:

s_volume or volume are not valid tokens in an FX file. So I think you have to do as @datiswous suggests, and clone (and modify) the soundshader.

Thank you for the info. What can I do about the lightening affecting the light gem?

Link to comment
Share on other sites

fwiw, I tried cloning the material def for lightbiground1 (materials/lights.mtr) and added ai_see 0, but that gives an unknown token error.

lights/biground1
{    
    description "Round point light."
    {
        forceHighQuality
        map    lights/biground1.tga
        colored
        zeroClamp
        ai_see 0
    }
}

 

Link to comment
Share on other sites

1 hour ago, grodenglaive said:

fwiw, I tried cloning the material def for lightbiground1 (materials/lights.mtr) and added ai_see 0, but that gives an unknown token error.

lights/biground1
{    
    description "Round point light."
    {
        forceHighQuality
        map    lights/biground1.tga
        colored
        zeroClamp
        ai_see 0
    }
}

 

Not a TDM developer so perhaps that is how it works but why would such a thing as "ai_see 0" be a surface/material token?! That to me sounds more like something that should be on the light entity definition the .def file not the .mtr file, but I don't really know.

Also if it is a real material token, try putting it at material global section, where the description is, outside the second pair of brackets. 

Edited by HMart
  • Like 2
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.


×
×
  • Create New...