Jump to content
The Dark Mod Forums

Recommended Posts

Posted

There's a spawnarg on lights that turn off shadowcasting (for optimization reasons), and these lights will go through all objects and brushes. So the first thing I'd check is that that shadowcasting spawnarg is turned so that it casts shadows.

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

Posted

It's definitely on, and it's definitely casting shadows... everywhere except a tiny polygonal bright patch on a wall, as through it's shining through a little irregular hole. Except that little hole doesn't exist.

In case my earlier explanation was unclear, here's a rough schematic:

 

weirdo.png.419ca1cad0bc73fb32a50e84c56e7ade.png

The beam of light is passing through two func_statics comprising part of my cellar wall, a brush making up the cellar ceiling/house floor, and a pillar that's currently made of brushes. No light falls on the cellar ceiling behind the func_statics or on the pillar, but there's a small illuminated bit on the wall right behind the pillar. It's definitely that light: it's the only one that I made a lurid blue colour.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Posted

Looking at that image, that wall is the 4th element hit by the light after the first func_stat that creates the shadow. That makes it sound like the render engine isn't backtracking far enough to the shadowcasting element. You could test that by moving or temporarily getting rid of some of the middle brushwork and see if the shadow casts then.

But one way you could at least fix the problem if it's a rendering hiccup is to reduce the light radius so it doesn't reach that wall, and then maybe have some invisible lights in the other directions if you want the light to spread in other directions.

  • Like 1

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

Posted

Thanks for the advice. It put me on the right track and I finally found what I think was going on.

Moved the pillar -> problem solved

Replaced it with a simple square brush -> no problem

So I took a very close look at my pillar and found a tiny little bit of caulk from my extensive use of the clipper tool that I'd somehow missed retexturing. When I fixed that, the rendering issue disappeared. I'd guess backtracking and finding some caulk tricks the renderer into doing some sort of hasty and stupid "optimization".

No big deal. My major worry was that light shining from the cellar to the dining room would nullify all the visportals between those areas and lead to performance issued down the track.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Posted

Two more beginner questions:

How come lanterns don't respect the extinguished spawnarg, and how do I make a lantern start switched off?

I have a door that I'd like opened by a key inserted into a secret button, but only if the generator powering the door's mechanism is running. That is, key activated but only if a certain switch is on. Turn the generator off and the door cannot be opened or closed. How would I go about making that?

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Posted (edited)
1 hour ago, thebigh said:

How come lanterns don't respect the extinguished spawnarg, and how do I make a lantern start switched off?

From a glance at one of the lantern entity classes, it doesn't use a scriptobject (which would read the "extinguished" spawnarg). You could try giving it "scriptobject" "tdm_light_holder". If that fails you could investigate the def_attached light entity if there is one (as an actual light it should respect "start_off" even if you can't get "extinguished" working on it or its holder). I'm looking at atdm:moveable_lantern_bullseye, which actually attaches light_lantern_bullseye_spotlight_unlit by default.

Edited by VanishedOne
  • Like 1

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Posted
8 hours ago, thebigh said:

Two more beginner questions:

  1. How come lanterns don't respect the extinguished spawnarg, and how do I make a lantern start switched off?
  2. I have a door that I'd like opened by a key inserted into a secret button, but only if the generator powering the door's mechanism is running. That is, key activated but only if a certain switch is on. Turn the generator off and the door cannot be opened or closed. How would I go about making that?
  1. "extinguished" is for flames (candles, torches, fireplaces etc...), electric lights use "start_off" (you cannot extinguish an electric light ;) ) As VanishedOne stated the respective entity probably needs to use the tdm_light_holder scriptobject
  2. you could change the frobability via the generator. So the switch that turns on the generator also changes the frobability of the secret button, which starts unfrobable. Use a target_setfrobable entity for that purpose (that's thesame entity used on footlockers etc... to change the frobability of the items inside, check the respective prefabs to see how it works and you can read up here )
  • 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

Posted

Those are excellent hints. Thanks for the advice.

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

Posted

Is it possible to target all lights of of a spcific type with a single command? I have a switch that turns on a generator, which in turn should switch on all electrical lights. I could target each light with this switch, but since there are over 20 of them, I would prefer, if I could simplify this somehow.

Posted
37 minutes ago, Destined said:

Is it possible to target all lights of of a spcific type with a single command? I have a switch that turns on a generator, which in turn should switch on all electrical lights. I could target each light with this switch, but since there are over 20 of them, I would prefer, if I could simplify this somehow.

Could call a script like this from the switch:

entity previous_entity = $null_entity;		//assign a starting value to this variable

void lamps_toggle()
{
	float i;
	for (i=0;i<30;i++)			//repeat this up to 30 times
	{
	//look for all lamps with a specific classname
		entity lamp = sys.getNextEntity("classname", "atdm:lamp_type_a", previous_entity);
		previous_entity	= lamp;			//store the search result so the next search doesnt start from scratch

	//if the search has found a valid lamp, trigger it
		if(lamp != $null_entity)
		{
			sys.trigger(lamp);
		}
                       
	//otherwise terminate the search
		else						
		{
			return;
		}                 
	}
}

(Haven't confirmed that this is formatted correctly, might be that I use previous_entity incorrectly. There's probably a way to automatically determine how many times the script needs to repeat.)

  • Thanks 1
Posted
void lamps_toggle()
{
	light lamp; // using light instead of entity allows access to light specific script functions, although not needed in this specific case
	do 			// using do makes more sense, as you can have as much lamps as you want without having to adjust the script
	{
		lamp = sys.getNextEntity("lightType","AIUSE_LIGHTTYPE_ELECTRIC",lamp); // all electric lights are of the same lightType (I guess ;) )
		if (lamp != $null_entity) sys.trigger(lamp); // brackets not needed if there is only one command to execute		
	} while (lamp != $null_entity); // don't forget the semicolon at the end :)
}

This versions turns lights off that are on and lights on that are off. This should work in your case if all lights start in the same state and there is no other way to change their state (like a button or so). Note that this affects all electric lights, including outdoor street lamps for example.

  • 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

Posted

@Obsttorte good to see how you'd shorten it and what alternative methods exist to achieve this.

Regarding how it affects all lights of that type, Destined could add a custom spawnarg to all lamps that he wants to be affected i.e. "power_source" "generator_basement1" and then let the script search for that instead:

lamp = sys.getNextEntity("power_source","generator_basement1",lamp);

He'll probably want only the generator to control their lit state, because otherwise the script will need to make the switches become ineffective for as long as the generator is off.

Posted

My plan was to have one type of lights (to be more accurate: atdm:sphere_brass_ceiling) that will get turned on with the generator in the basement. Having them controlled by additional switches was not planned. So, if I understand "getNextEntity" correctly, I could use "lamp = sys.getNextEntity("classname","atdm:sphere_brass_ceiling",lamp);" to get all lamps of this type? It is very nice to see how a short script can do something that would require a lot of handywork otherwise (it is currently 23 lamps that should be affected).

Thanks a lot!

Posted
1 hour ago, Destined said:

So, if I understand "getNextEntity" correctly, I could use "lamp = sys.getNextEntity("classname","atdm:sphere_brass_ceiling",lamp);" to get all lamps of this type?

Yep.

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

Posted

I'm trying to create a .tga with transparency, that I can use as a decal. I erased part of the image in Photoshop (old Elements 8 ) to add transparency. I can save as a .png file, and all appeared to be good. But if I try to save as .tga (32 bit, uncompressed), the transparent section comes out white (on reload into PSE, or in TDM). I gather from the Photoshop forums that you have to do backflips and blood sacrifices to get .tga with alpha channel to be emitted. A trip of the .png file through GIMP and exported out resulted in a corrupted .tga

I know there are online file converters, so maybe it will come to that. But I'd like to hear your recommendations.

Posted
14 minutes ago, Geep said:

I'm trying to create a .tga with transparency, that I can use as a decal. I erased part of the image in Photoshop (old Elements 8 ) to add transparency. I can save as a .png file, and all appeared to be good. But if I try to save as .tga (32 bit, uncompressed), the transparent section comes out white (on reload into PSE, or in TDM). I gather from the Photoshop forums that you have to do backflips and blood sacrifices to get .tga with alpha channel to be emitted. A trip of the .png file through GIMP and exported out resulted in a corrupted .tga

I know there are online file converters, so maybe it will come to that. But I'd like to hear your recommendations.

In my version of Photoshop, the Save As dialog has a Save Alpha Channels checkbox. That does the trick for me. 

Disclaimer: my Photoshop version is very old (CS2) and I'm no graphics expert.

Posted

Tga with transparency works fine. I'm using Gimp, but Photoshop should work fine too. Gimp requires you to use the layer mask, as selecting and deleting stuff from an image with alpha can cause errors. Otherwise it's just the matter of tweaking alphatest parameter during a diffuse stage.

Posted

Maybe it just doesn't work if I erase parts of the background directly; the Save As doesn't ask about alpha channels. I guess I'll try to figure out how to do transparency with a layer mask... was trying to avoid that. Thanks

Posted
12 hours ago, Obsttorte said:

Yep.

The script worked like a charm. Thanks again! Only one thing: TDM does not know the variable type "light", so it has to be entity. Apart from that everything works as intended.

Posted

tdm_light_holder is the respective type (my fault, it's been a while :) ), but as said in your case it is not required anyways.

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

Posted

In case anyone's interested for future reference, the way id handled control of multiple lights was via the FX system.

Quote

attachlight <light>Attach to external light (a light not defined in the effect) for fading. This is what causes all the lights to fade in/out in alphalabs 2

 

Some things I'm repeatedly thinking about...

 

- louder scream when you're dying

Posted

Wrong file. The "start mission" button and its behaviour is defined in mainmenu_main.gui.

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

Posted (edited)

Is it possible for a readable to display text in-game without being frobable?

 

edit: nvm, I fixed it by setting frob_distance to 1. Still technically frobable, but can't be reached.

Edited by thebigh
never mind

My missions:           Stand-alone                                                      Duncan Lynch series                              

                                      Down and Out on Newford Road              the Factory Heist

                                The Wizard's Treasure                             A House Call

                                                                                                  The House of deLisle                                                                                                  

                              

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

    • datiswous

      I moved from Manjaro Linux (rolling release) to Linux Mint (LTS). One of the reasons was that I found the updates a bit too often and long. But now on Mint I get updates every day, although they're usually small updates.
      · 3 replies
    • JackFarmer

      "Hidden Hands: Vitalic Fever" - new update available including subtitles & compressed briefing video (thanks to @datiswous) and several fixes.
      · 0 replies
    • Wolfmond

      🇬🇧

      2025-04-20
      I'd like to track my level design progress a bit more often now, so I'm using the feed in my profile here.
      I've been working intensively on Springheel's YouTube course over the past few days. I'm currently up to lesson 8. There is so much information that needs to be processed and practiced. 
      I have started to create my own house. As I don't have the imagination to create a good floor plan, I grabbed a floor plan generator from Watabou and experimented with it. I chose a floor plan that I will modify slightly, but at least I now have an initial idea. 
      I used two guards as a measuring tape: The rooms are two guards high. It turned out that I can simply double the number of boxes in DarkRadiant in grid size 8 that are drawn in the floor plan. 
      I practiced the simplest things on the floor plan first. Drawing walls, cutting walls, inserting doors, cutting out frames, creating VisPortals, furnishing rooms.
      I have had my first success in creating a book. Creating a book was easier than I thought. I have a few ideas with books. The level I'm creating will be more or less a chill level, just for me, where I'll try out a few things. I don't have an idea for my own mission yet. I want to start small first.
      For the cellar, I wanted to have a second entrance, which should be on the outside. I'm fascinated by these basement doors from the USA, I think they're called Bilco basement doors. They are very unusual in Germany, but this type of access is sometimes used for deliveries to restaurants etc., where barrels can be rolled or lifted into the cellar. 
      I used two Hatch Doors, but they got completely disoriented after turning. I have since got them reasonably tamed. It's not perfect, but it's acceptable. 
      In the cellar today I experimented with a trap door that leads to a shaft system. The rooms aren't practically finished yet, but I want to continue working on the floor plan for now. I'll be starting on the upper floor very soon.

      __________________________________________________________________________________
      🇩🇪

      2025-04-20

      Ich möchte nun mal öfters ein bisschen meinen Werdegang beim Leveldesign tracken, dazu nutze ich hier den Feed in meinem Profil.
      Ich habe mich in den vergangenen Tagen intensiv mit dem Youtube-Kurs von Springheel beschäftigt. Aktuell bin ich bis zu Lektion 8 gekommen. Das sind so viele Informationen, die erstmal verarbeitet werden wollen und trainiert werden wollen. 

      Ich habe mich daran gemacht, ein eigenes Haus zu erstellen. Da mir die Fantasie fehlt, einen guten Raumplan zu erstellen, habe ich mir einen Grundrissgenerator von Watabou geschnappt und damit experimentiert. Ich habe mich für einen Grundriss entschieden, den ich noch leicht abwandeln werde, aber zumindest habe ich nun eine erste Idee. 

      Als Maßband habe ich zwei Wächter genommen: Die Räume sind zwei Wächter hoch. Es hat sich herausgestellt, dass ich in DarkRadiant in Gittergröße 8 einfach die doppelte Anzahl an Kästchen übernehmen kann, die im Grundriss eingezeichnet sind. 

      Ich habe bei dem Grundriss erstmal die einfachsten Sachen geübt. Wände ziehen, Wände zerschneiden, Türen einsetzen, Zargen herausschneiden, VisPortals erstellen, Räume einrichten.

      Ich habe erste Erfolge mit einem Buch gehabt. Das Erstellen eines Buchs ging leichter als gedacht. Ich habe ein paar Ideen mit Bücher. Das Level, das ich gerade erstelle, wird mehr oder weniger ein Chill-Level, einfach nur für mich, bei dem ich ein paar Sachen ausprobieren werde. Ich habe noch keine Idee für eine eigene Mission. Ich möchte erst einmal klein anfangen.

      Beim Keller wollte ich gerne einen zweiten Zugang haben, der sich außen befinden soll. Mich faszinieren diese Kellertüren aus den USA, Bilco basement doors heißen die, glaube ich. Diese sind in Deutschland sehr unüblich, diese Art von Zugängen gibt es aber manchmal zur Anlieferung bei Restaurants etc., wo Fässer dann in den Keller gerollt oder gehoben werden können. 
      Ich habe zwei Hatch Doors verwendet, die allerdings nach dem Drehen vollkommen aus dem Ruder liefen. Inzwischen habe ich sie einigermaßen gebändigt bekommen. Es ist nicht perfekt, aber annehmbar. 
      Im Keller habe ich heute mit einer Falltür experimentiert, die zu einem Schachtsystem führt. Die Räume sind noch quasi nicht eingerichtet, aber ich möchte erstmal am Grundriss weiterarbeiten. In Kürze fange ich das Obergeschoss an.



      · 2 replies
    • JackFarmer

      On a lighter note, thanks to my cat-like reflexes, my superior puzzle skills and my perfect memory, I was able to beat the remastered version of "Tomb Raider: The Last Revelation" in a new superhuman record time of 23 h : 35 m, worship me!
      · 5 replies
    • Goblin of Akenash

      My mapping discord if anyone is interested, its more of a general modding thing rather than just for TDM 
      https://discord.gg/T4Jt4DdmUb

       
      · 0 replies
×
×
  • Create New...