Jump to content
The Dark Mod Forums

Trailing particles


SteveL

Recommended Posts

A quick "Did you know" post because I don't think many people do know this. I certainly didn't until tonight. TDM has a "func_smoke" entity that works like a func_emitter but emits particles that are independent of the emitter once released. Using a func_emitter, the particles follow the emitter even after release. But if you attach a func_smoke to a moving entity, the particles will trail behind:

 

 

Both flasks in the vid use the same particle effect. The one on the left is a func_emitter, the one on the right is a func_smoke. The left particle looks faster but I think that's an optical illusion: the steam isn't being trailed so it looks like it's reaching the top of its plume instantly. Both are the same particle at the same speed.

 

I added a script event to let mappers use these trailing particles in 2.03, but it turns out it's not really needed. Func_smoke does almost everything the script event can, and it's much easier.

 

There's one catch: you need to change the "model" spawnarg in DR to be called "smoke" instead of "model". You still use it to specify the particle effect. I've corrected the default spawnarg for TDM 2.04, but in the meantime, just overtyping it works.

 

I've added info to the wiki article

 

Here's the original script demo that I did while working on the script event for 2.03, where a candle wick spouts an improbable amount of smoke. You'll find the script on the wiki article, although you could do the same thing with a func_smoke:

 

  • Like 4
Link to comment
Share on other sites

Well that's cool...how would I add this functionality to the candle entity?

 

It could be as simple as swapping the func_emitter Nope, I just checked and candles don't use a func_emitter. It'd be possible to get the tdm_lights.script to spawn a func_smoke instead of swapping the light model for a particle, but we'd probably be better off using the script I put on the wiki article to produce the smoke. It'd save an extra entity being spawned. It's too late for me to try tonight but I'll give it a go tomorrow if no-one beats me to it :)

Link to comment
Share on other sites

In general, if you bind particle effects on AI, they must be func_smoke, as I learned when making the U:G automatons. Using func_emitter looks accelerated in time and weird like in your video.

Edited by Sotha

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

I think lights don't use func_emitter either. The light entities use the particle as a model. I don't know if they understand the smoke spawnarg either, at least it is not listed in the spawnarg list.

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

Link to comment
Share on other sites

@Obs: I think so too. But the model switch is done by the script object, so it could spawn smokes instead without needing to spawn a func smoke.

 

@moonbo, Sotha: you guys reminded me I have more to put on that wiki article. You don't need a func smoke entity for AI or projectiles. They support trailing particles natively. Prev discussion: http://forums.thedarkmod.com/topic/16710-particle-request-candle-smoke/page-5?do=findComment&comment=360338

Link to comment
Share on other sites

Are the smoke and the lamp glare part of the same particle effect, added via an emitter? Then yes swapping the func_emitter for a func_smoke should fix it. The lamp glare will in theory trail too, but that shouldn;t matter because individual lamp glare quads last only a fraction of a second.

 

For flame lights in general, we could make the default model_extinguished (smoke particle) use the trailing particle system, spawning the particle quads by script instead of spawning a func_smoke. The script will only run for a second or two after the player extinsguishes the light, just until all the smoke has been released.

 

I'll commit the script changes after work so we can try it.

Link to comment
Share on other sites

Wow I really love this! Now we can build a fog monster like in "Wheel Of Time" :)

I don't know what that looks like and a few google searches didn't help me! But yes you could make an AI with an invisible skin, only seen because of particle effects trailing from each joint. That could be pleasantly freaky :)

  • Like 2
Link to comment
Share on other sites

I don't know what that looks like and a few google searches didn't help me! But yes you could make an AI with an invisible skin, only seen because of particle effects trailing from each joint. That could be pleasantly freaky :)

 

There you go SteveL. I shit my pants back when I was a fawn. :)

 

WOT-2010-10-27-00-47-49-51.jpg

  • Like 1

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

Hehe. So it's a streak of fog that comes at you? We could make it distinctly AI-shaped but made of fog and trailing fog :ph34r:

 

Well that's cool...how would I add this functionality to the candle entity?

 

Here's an amended tdm_lights.script tdm_lights.script.txt that uses the trailing particle effect for the "model_extinguished". It trails smoke ok on a candle, but with 2 things we'd want to tackle:

  1. The smoke will need to be thicker to allow for it being more spread out.
  2. 2-stage effects where one has an offset don't really work well with it. In the current candle effect, the thicker plume of smoke that appears 10 or so units above the candle doesn't connect with the smaller particles that rise from the wick, if the candle is moving.

For (1) we have the option of amplifying the particle effect through a spawnarg instead of thickening the particle effect itself. There's nothing to stop the script emitting 3 times as many particles as the particle def says, for example. For (2), we'd probably want to use a single stage that just gets bigger.

 

NB this hacked script will break lights with non-particle-based "model_extinguished" spawnargs. That doesn't matter, it'll be easy to amend the script to make it distinguish between particle-based and model-based "model_extinguished" lights. I just didn't put that distinction in this test.

Link to comment
Share on other sites

Me neither. I played the solo campaign a bit and later on we tried to play it in Multiplayer which is really cool, because you can setup traps and monsters for the enemy. But we were only 2 people - I guess this is even more fun with 8 folks xD

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...