Jump to content
The Dark Mod Forums

Newbie DarkRadiant Questions


demagogue

Recommended Posts

Thanks! This worked. I now get a red line. Sadly it's in empty space, rather short and I don't see anything where it points to...

Link to comment
Share on other sites

Have you added any entities that might somehow have their origins there? Edit: some suggestions at http://wiki.thedarkmod.com/index.php?title=Leaking_maps#Problems_finding_the_cause_of_the_leak

 

Does anything get highlighted if you drag-select around there?

 

--------

 

What's the recommended way to slow the player down (from a script) when running/walking/etc, without necessarily having the player hold anything or have anything equipped, regardless of the player's direction of movement in X and Y, and without reducing the jump height? Applying an impulse isn't working right for me because it moves me faster in the air than on the ground, presumably due to friction.

 

Edit: it looks from http://forums.thedarkmod.com/topic/10680-kalwins-questions/as though it might be setHinderance.

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

If I target a combined light entity (i.e. holder + light/flame, like a candle) from a trigger_multiple, the trigger_multiple toggles the light/flame on or off.

 

If I call the activate() script event on the entity, nothing happens.

 

If I replace activate(<activator>) with ResponseTrigger(<activator>, STIM_TRIGGER) that does toggle the light.

 

So does calling sys.trigger(<the light>).

 

Since the description for activate() in http://wiki.thedarkmod.com/index.php?title=TDM_Script_Referenceis 'Activates this entity as if it was activated by a trigger' I'm wondering why it isn't working like the other approaches.

 

I found an explanation of activate() versus sys.trigger() earlier in the thread, but it doesn't seem to explain this difference. I'm calling from a script object, if it helps.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

If I target a combined light entity (i.e. holder + light/flame, like a candle) from a trigger_multiple, the trigger_multiple toggles the light/flame on or off.

I'd class this as a bug report rather than a question. But I'm unsure whether the right fix is to change the behaviour of activate(), or to change its documentation.

 

The change to activate() would be to make the entities apply a stim_trigger when activated -- that's what the documentation you quoted implies will happen. Problem is, lights in holders share the spawnclasses of very common objects: they are idMoveables or idStaticEntities under the hood. Fixing the lights to bring them into line with that documentation would potentially change the behaviour of every func_static and moveable in every map!

 

In the meantime, other workarounds from scripts are to call the LightsToggle(), LightsOff(), or LightsOn() functions on the light holder's script object. Here are two ways to do that:

entity someLightHolder = $whatever;
someLightHolder.callFunction("LightsToggle");
tdm_light_holder someLightHolder = $whatever;
someLightHolder.LightsToggle();
  • Like 1
Link to comment
Share on other sites

Cheers. The question arose when making trigger_sequencer and trigger_random - owing to wesp5's questions I happened to have oil lamps in my test map - so I was looking for a general solution that works on combined lights and other things. What I posted uses sys.trigger().

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

its

$<lamp_name>.activate($player1); doesn't matter if player is miles from light it will go on/off.

 

if flame is bind to candle after using a check to see if the bind flame is off you can use

 

light_moving_ext lightObj = $<name of candle>;
if ( !lightObj )
{
return;
}
else
{
lightObj.frob_ignite();
}

 

~~~~~~~~~~~~~~~~~~~

 

bit like this

 

void light_forge_switch(entity mover_lever, boolean bOpen, boolean bLocked, boolean bInterrupted)
{
light_moving_ext lightobj1 = $forge_fire;
if ( bOpen )
{
sys.print("Lever on. \n");
lightobj1.frob_extinguish();
$forge_fire.Off();
forgestate = FALSE;
}
else
{
sys.print("Lever off. \n");
lightobj1.frob_ignite();
$forge_fire.On();
forgestate = TRUE;
}
}

Edited by stumpy
Link to comment
Share on other sites

I've got my finally smooth spherical lamps set up as lamp entities and they're working normally except that there seems to be a problem with the light origin.

 

My lamps don't illuminate the wall they're mounted on unless I move the model's origin or the whole lamp forward 16ish units.

 

It seems the light diamond is too close to the wall: in DarkRadiant the light diamond shows up at the model origin, which is always the backplate of the wall mounting. That's even though I've changed the spawnarg for light_centre_offset to put the light centre inside the bulb. (Note that I'm inheriting from the quiet electric light template)

 

Also, I've seen that the existing electric fancy wall lights have this problem too and fit the above description.

 

Is there an extra line in the def that can move the light diamond away from the wall? Or would it require changing the model origins?

  • Like 1
Link to comment
Share on other sites

Does shaderparm4 really change the flicker of light entities? I just setup some light entities with the texture "lights/biground_candleflicker_shadow" and tried using different settings for the shaderparm4 spawnarg but it doesn't seem to do anything. On the wiki it says anywhere between 0 to 1 will change the flicker but I have one set to 0.1 and one set to 0.9 and it doesn't do anything because both flicker at the same speed ingame.

 

For those in the know is the wiki out of date in regards to the shaderparms?

Link to comment
Share on other sites

Means that's where it's leaking. You might have some entity poking into the void somewhere and that's where DMAP is finding a leak, and that's where it stops.

Ah! Thank you. Somehow the middle point of several objects reappeared far out in the void when I copied a room.

Link to comment
Share on other sites

Does shaderparm4 really change the flicker of light entities? I just setup some light entities with the texture "lights/biground_candleflicker_shadow" and tried using different settings for the shaderparm4 spawnarg but it doesn't seem to do anything. On the wiki it says anywhere between 0 to 1 will change the flicker but I have one set to 0.1 and one set to 0.9 and it doesn't do anything because both flicker at the same speed ingame.

 

For those in the know is the wiki out of date in regards to the shaderparms?

Here's the shader definition, and I don't see any use of parm4:

lights/biground_candleflicker_shadow
{

	
	{
		forceHighQuality
		// tels: the candles cast a shadow downwards, being obscured by the wax
		//map	textures/lights/biground1_candleshadow
		// don't use black in the center
		//map	textures/lights/biground1_candleshadow_noblack
                map	lights/biground1  // switched back until shadow issues sorted out
		colored
		zeroClamp
		red	((.05 * sintable [(time * ( 2 + Parm3 ) ) ]) +.95) * Parm0
		green	((.05 * sintable [(time * ( 2 + Parm3 ) ) ]) +.95) * Parm1
		blue	((.05 * sintable [(time * ( 2 + Parm3 ) ) ]) +.95) * Parm2
	}


}

What happens if you vary shaderParm3 instead?

  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Here's the shader definition, and I don't see any use of parm4:

lights/biground_candleflicker_shadow
{

	
	{
		forceHighQuality
		// tels: the candles cast a shadow downwards, being obscured by the wax
		//map	textures/lights/biground1_candleshadow
		// don't use black in the center
		//map	textures/lights/biground1_candleshadow_noblack
                map	lights/biground1  // switched back until shadow issues sorted out
		colored
		zeroClamp
		red	((.05 * sintable [(time * ( 2 + Parm3 ) ) ]) +.95) * Parm0
		green	((.05 * sintable [(time * ( 2 + Parm3 ) ) ]) +.95) * Parm1
		blue	((.05 * sintable [(time * ( 2 + Parm3 ) ) ]) +.95) * Parm2
	}


}

What happens if you vary shaderParm3 instead?

 

Using shaderparm3 is what did the trick! Thank you very much.

 

Also to anyone with wiki access you should probably edit this page http://wiki.thedarkmod.com/index.php?title=List_of_shaderParm_variablesto reflect that its actually shaderparm3 not 4 that controls the flicker.

Link to comment
Share on other sites

 

Using shaderparm3 is what did the trick! Thank you very much.

 

Also to anyone with wiki access you should probably edit this page http://wiki.thedarkmod.com/index.php?title=List_of_shaderParm_variablesto reflect that its actually shaderparm3 not 4 that controls the flicker.

I'm looking through the light materials to make sure that's a consistent rule, and it looks as though lights/square_flicker, lights/square_flicker2, etc. use parm3 and parm4. Edit: also lights/square_strobe and lights/square_strobe_slow.

Edited by VanishedOne

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

Adding in glare particles for the lamps didn't work so well. They seem to stay active no matter if the lamp is on or off. I've tried using "start_off" or "extinguished", putting a "toggle light" or "trigger" response on the lamp entity, triggering the lamps with a premade lever, there's always the glare. The existing arc light also has particles that won't switch off, so it makes me wonder whether it's a bug?

 

What can be done instead is to leave it up to the mapper to put in their own particles, and it looks decent enough without particles. Although it saves some effort, and might help new mappers if the lamps already came premade with particles.

 

Here's the view at my testing range:

 

ftQdn6b.jpg

 

 

To lighten up the mood amid all this testing: lamps in all colours using _color spawnarg. Maybe for a christmas mission, or some sinister place that wants purple/dark blue lamps.

 

fYE4wdy.jpg

 

 

 

(The colour is much more evident when there's no particle, maybe that's going to be the main argument to make them appear without particles by default. This screenshot also shows the problem my lamps and some of the stock electric lamps have with barely lighting up their own walls.)

Edited by Dragofer
  • Like 1
Link to comment
Share on other sites

I wouldn't include particles by default for lights like this. Light glare tends to be an artistic choice--some mappers like them and others don't (players can also activate bloom to get glare from lights, can't they?)

Link to comment
Share on other sites

When I'm in the entity tab of an entity and try to change a variable (e.g. snd_open for a door), it often happens that it doesn't change the property even after hitting the green checkmark.

 

Is this also the case for you? Is there anything to be done about it?

Link to comment
Share on other sites

When I'm in the entity tab of an entity and try to change a variable (e.g. snd_open for a door), it often happens that it doesn't change the property even after hitting the green checkmark.

 

Is this also the case for you? Is there anything to be done about it?

I'm not sure what green checkmark you mean, so possibly this is platform-specific? (I'm on Windows.)

 

If it really isn't changing then presumably that's a DR bug. Just to check, though: are you looking at the inherited spawnargs list, and still seeing the old setting greyed out? What happens for me is that a new, non-greyed spawnarg is created with my chosen value, but near the top of the list with the other dark spawnargs, and the inherited value is still visible in the list of greyed-out inherited spawnargs.

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Link to comment
Share on other sites

One quick way to color those lamp glares is to set the "entity color" checkbox in the particle editor, and then you can use the "_color" spawnarg on the emitter to colour them.

 

I wouldn't include particles by default for lights like this. Light glare tends to be an artistic choice--some mappers like them and others don't (players can also activate bloom to get glare from lights, can't they?)

I agree with springheel, no glares by default. They suit misty environments but they'd look out of place on a clear summer night.

 

If you do want to use them by default on a switchable light, you could set them up like torch flames are now (light_torchflame in tdm_lights.def), with their own entity def and separate lit and unlit models. There are easy workarounds for some individual spots in maps: you can set spawnarg "cycletrigger" "1" on the func_emitter and just target them in some way to toggle them on and off, for example.

 

When I'm in the entity tab of an entity and try to change a variable (e.g. snd_open for a door), it often happens that it doesn't change the property even after hitting the green checkmark.

 

Is this also the case for you? Is there anything to be done about it?

I haven't noticed that problem, but I always hit Enter to set a spawnarg. You can see whether it's changed if you look at the panel above (you might need to turn off inherited spawnargs).

  • Like 1
Link to comment
Share on other sites

We do have lights using parm4 as well as parm3.

 

I haven't checked precisely what they use them for, but it seems related to flickering or strobing tables.

Yeah, shaderparm meanings were a point of confusion for me too while learning TDM. The shaderparms mean what the material definition says they mean, and it's not consistent. It probably *shouldn't* be consistent, because we have only 9 or so of them to play with, and we want different shaders to have different options. The wiki should probably reflect that. Most shaders respect the rule that shaderparms 0 to 3 are reserved for color and alpha information, but all other parms are up for grabs.

Link to comment
Share on other sites

Eleven years working on this mod and I still don't understand shaderparms.

  • 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.


  • Recent Status Updates

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • 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
×
×
  • Create New...