Jump to content
The Dark Mod Forums

Creating Candeliers


Springheel

Recommended Posts

I'm having a bit of mapper's block. I have a large chandelier in my map that I want to have at least six or more candles on. For performance's sake, I don't want each candle to have its own light, but I do want the candles to be extinguishable by water arrows.

 

What I thought I would try and do is add candle entities but remove the light (just keep the particle effects), and then bind the flames to a single large light. But this has turned out to be more difficult than I thought. Is it even possible to have the candle flame without a light? I could just make a func_emitter, but then it wouldn't be extinguishable.

 

For some reason I'm stuck here. Any suggestions?

 

Would it be a big problem performance-wise if I just changed the light radius of each candle so that it was really tiny and didn't overlap?

Link to comment
Share on other sites

Springs its easy (I think you or some one else answered this when I had the same prob)

 

  • place candle flame entities or candle entities that emit no light.
  • place light source at center.
  • target each flame/candle entities from the light.

 

So when you hit it with a WA, they all go out. I used a candle model, with func_emitters. I have attached a prefab I used in my cathedral map.

single_light_multi_flame.pfb.txt

Link to comment
Share on other sites

Another possibility would be to create one particle effect with the particle editor that spawns 6 candleflames. The result would (technically) be one particle effect that looks like 6 different flames but behaves exactly like a single flame...

 

This solution would require no scripting and no complex linking - but of course cost a little time to create such a particle effect. It's up to you, whether you prefer this way or not...

Link to comment
Share on other sites

I don't want the flames to all go out with one water arrow shot, though. This is a big chandelier made from a wagon wheel.

 

place candle flame entities or candle entities that emit no light.

 

This is the part that's confusing me (I'm too sleep-deprived to plow through complex problems right now). How do you make a flame entity with no light? The def_attach is inherited, and I can't seem to remove it. I thought "def_attach" "-" would work but it causes an error.

Link to comment
Share on other sites

I don't want the flames to all go out with one water arrow shot, though. This is a big chandelier made from a wagon wheel.

 

 

 

This is the part that's confusing me (I'm too sleep-deprived to plow through complex problems right now). How do you make a flame entity with no light? The def_attach is inherited, and I can't seem to remove it. I thought "def_attach" "-" would work but it causes an error.

 

Candle "flame entities" are simply a light which uses a particle effect as model.

 

So insted of:

 

entitydef light_candleflame
{
 "inherit"               "idLight"
 "light_radius"          "blah balh blah"
 "model_lit"             "tdm_fire_candle_glare.prt"
 ...
}

 

use this:

 

"inherit" "func_emitter"  // use just a func_emitter
"model" "tdm_fire_candle_glare.prt"

 

and place 6 of them. If your mission should run with v1.05 only, then you can also use 1 (!) func_emitter,

 

and add the 5 other particles with:

 

"offset_1" "10 10 0"
"offset_2" "-10 10 0"
"offset_3" "10 0 0"
"offset_4" "-10 0 0"
"offset_5" "10 0 0"

 

(Use DR to place 6 entities in a circle, then measure their offset from one of them, then change the values above)

 

(you do not need to specify the other models, the code should use whatever is in "model" and clone it)

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

use this:

 

"inherit" "func_emitter" // use just a func_emitter

"model" "tdm_fire_candle_glare.prt"

 

But if the flames are just a func_emitter, will it still react to water arrows?

Link to comment
Share on other sites

But if the flames are just a func_emitter, will it still react to water arrows?

 

No. If you want this, then you either need to:

 

* add the correct stim (but that would mean probably some scripting, too)

* OR: use candle flames, but set the following spawnargs:

 

"nodiffuse" "1"
"noshadows" "1"
"nospecular" "1"

 

(I have not tried this, but that should turn off all actual light casting stages).

 

Edit:

 

You might want to turn the wagon wheel into a light holder, then def_attach 6 non-casting candle flames and a casting light. I make you an example in an hour or so, but first I need to go back into the garden.

 

Edit #2: I am a bit confused by the remark that they should not go out together. Should they go out one-by-one then? In that case you also need a light with different light levels, which is doable, but needs defnitely some scripting.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

OR: use candle flames, but set the following spawnargs:

 

How do I pass those spawnargs to the flames? I tried: "set nospecular on flame" but that didn't seem to work.

Link to comment
Share on other sites

How do I pass those spawnargs to the flames? I tried: "set nospecular on flame" but that didn't seem to work.

 

Hm, that should work. I need to experiement.Sorry that I didn't answer yesterday, garden consumed all time. Tonight social life eats my time, so won't have time before tomorrow.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

For the moment I've just put regular candles and set the light radius to 2,2,2. Not sure how that will affect performance, but it works for now.

Link to comment
Share on other sites

For the moment I've just put regular candles and set the light radius to 2,2,2. Not sure how that will affect performance, but it works for now.

 

as far as i experienced, flickering light can affect performance a lot (sometimes more than you might suggest). i guess that in your case the effect won't be too high as the radius is very small, few polygons are hit by those light rays and the lights don't touch each other.

 

however, i strongly recommend that u set those lights to 'noshadow' - due to their small radius, that wont be noticeable anyway. but i guess that you have allready done that, hm?! unsure.gif

Link to comment
Share on other sites

however, i strongly recommend that u set those lights to 'noshadow' - due to their small radius, that wont be noticeable anyway. but i guess that you have allready done that, hm?!

 

I haven't, because I don't know how to pass that spawnarg on. But the only polys those lights will hit are the candle, and it's noshadows already.

 

One interesting/unusual thing...when I shoot one candle out, four or five other candles go out around the chandelier, even though they appear to be well outside the radius of the water stim. None of them are linked to each other, so it struck me as strange.

Link to comment
Share on other sites

I haven't, because I don't know how to pass that spawnarg on. But the only polys those lights will hit are the candle, and it's noshadows already.

 

Sorry, I did not have yet time to test this.

 

One interesting/unusual thing...when I shoot one candle out, four or five other candles go out around the chandelier, even though they appear to be well outside the radius of the water stim. None of them are linked to each other, so it struck me as strange.

 

Have you tried the debug stim command? It might be that the stim radius is simply quite big compared to the chandelier.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I still say my method was the simplest and for a big chandelier you would have more than 1 light source etc, so you could just target some of the flames to each func emitter..

 

Springs, if you like pm your chandelier and I will rig my way so you can see how is behaves.

Link to comment
Share on other sites

I still say my method was the simplest

 

I don't want the flames to all go out at once, though. What I *really* want to do isn't possible yet....I'd like to have each candle linked to a main light and have the light's intensity reduced for each candle that gets put out. But that will require code support and I don't want to wait that long. I'm hoping to have my mission ready to beta-test in another month or so.

Link to comment
Share on other sites

Lights (game/light.cpp) do have the ability to have multiple levels. You can set the number of levels the light has with the spawnarg "levels". For instance:

 

"levels" "6"

 

Creates 6 levels. Unfortunately, the only way to influence the light level from scripting (and thus also from stims) is by:

 

* calling On(); that sets the intensity to the maximum value (level 6 in this case)

* calling Off(); that sets the intensity to the minimum (level 0)

* calling ToggleOnOff(), which reduces the levels one by one (everytime you call it, by one) until the level is 0, then it sets it at the maximum. Thus the sequence would be "6 5 4 3 2 1 0 6 5 4 3 2 1 0" etc. This means you cannot f.i. reignite one candle, and have the light go back up one level.

 

Or in othr words, you can have one central light with multiple levels, but the light cannot be controlled easily from scripting, at least not without adding code support.

 

The only way you can have a central light is by writing a new script object which manipulates the light level manually, then you need to bind the 6 flames to that central light so that these flames trigger On() or Off() (or whatever you call them) and these on/off events then reduce/increase the light level.

 

Certainly doable, you just have to find someone who can implement it in scripting. Or find someone who can add it to the C++ code, as this sounds like a useful thing to have, but then you also have to wait until it becomes part of an official release so you can use it in your map.

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

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

      The FAQ wiki is almost a proper FAQ now. Probably need to spin-off a bunch of the "remedies" for playing older TDM versions into their own article.
      · 1 reply
    • 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 )
      · 3 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
       
      · 7 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...