demagogue Posted July 28, 2020 Author Report Posted July 28, 2020 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. Quote What do you see when you turn out the light? I can't tell you but I know that it's mine.
thebigh Posted July 28, 2020 Report Posted July 28, 2020 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: 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. Quote 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
demagogue Posted July 28, 2020 Author Report Posted July 28, 2020 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. 1 Quote What do you see when you turn out the light? I can't tell you but I know that it's mine.
thebigh Posted July 29, 2020 Report Posted July 29, 2020 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. Quote 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
thebigh Posted August 1, 2020 Report Posted August 1, 2020 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? Quote 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
VanishedOne Posted August 2, 2020 Report Posted August 2, 2020 (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 August 2, 2020 by VanishedOne 1 Quote Some things I'm repeatedly thinking about... - louder scream when you're dying
Obsttorte Posted August 2, 2020 Report Posted August 2, 2020 8 hours ago, thebigh said: 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? "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 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 ) 1 Quote 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
thebigh Posted August 2, 2020 Report Posted August 2, 2020 Those are excellent hints. Thanks for the advice. Quote 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
Destined Posted August 3, 2020 Report Posted August 3, 2020 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. Quote
Dragofer Posted August 3, 2020 Report Posted August 3, 2020 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.) 1 Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
Destined Posted August 3, 2020 Report Posted August 3, 2020 Thanks! I will try that. The switch calls a script, anyway, so I can simply add the one you wrote to that. Quote
Obsttorte Posted August 3, 2020 Report Posted August 3, 2020 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. 1 Quote 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
Dragofer Posted August 3, 2020 Report Posted August 3, 2020 @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. Quote FM: One Step Too Far | FM: Down by the Riverside | FM: Perilous Refuge Co-FM: The Painter's Wife | Co-FM: Written in Stone | Co-FM: Seeking Lady Leicester Dragofer's Stuff | Dragofer's Scripting | A to Z Scripting Guide | Dark Ambient Music & Sound Repository
Destined Posted August 3, 2020 Report Posted August 3, 2020 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! Quote
Obsttorte Posted August 3, 2020 Report Posted August 3, 2020 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. 1 Quote 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
Geep Posted August 3, 2020 Report Posted August 3, 2020 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. Quote
joebarnin Posted August 3, 2020 Report Posted August 3, 2020 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. Quote
Guest Posted August 3, 2020 Report Posted August 3, 2020 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. Quote
Geep Posted August 3, 2020 Report Posted August 3, 2020 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 Quote
Destined Posted August 4, 2020 Report Posted August 4, 2020 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. Quote
Obsttorte Posted August 4, 2020 Report Posted August 4, 2020 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. 1 Quote 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
VanishedOne Posted August 4, 2020 Report Posted August 4, 2020 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 Quote Some things I'm repeatedly thinking about... - louder scream when you're dying
RedNoodles Posted August 4, 2020 Report Posted August 4, 2020 Is there a way to make the "Start mission" button take the player directly to the Objectives screen? I'm playing around with the mainmenu_custom_defs.gui file but I can't figure it out. Quote
Obsttorte Posted August 4, 2020 Report Posted August 4, 2020 Wrong file. The "start mission" button and its behaviour is defined in mainmenu_main.gui. Quote 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
thebigh Posted August 11, 2020 Report Posted August 11, 2020 (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 August 11, 2020 by thebigh never mind Quote 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
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.