Jump to content
The Dark Mod Forums

Triggering func_emitters


SteveL

Recommended Posts

I have a tracker action to make one-shot particles controllable by triggering ( previous discussion ). I want to check briefly how people think they should work.

Particles that cycle for ever can be turned on and off by triggering the func_emitter. When you restart them by triggering, they start up again with random timing so that you can trigger two or more of the same type at the same time, and the particles won't look identical or move in sync with one another. What you can't do using the current system is trigger one-shot particles, because the random timing usually means they don't show up at all (see prev discussion for details). So you can't have a puff of smoke come out of a sewer when the door is opened, or a bunch of sparks shoot out of a rusty lever or button when used. Not easily, anyway.

I've fixed that up in my test build so that when triggered "off" the particle does nothing, when triggered "on" it fires. But after trying it in a test map, I think the better way to handle one-shot particles would be to have them always fire when triggered. After all, once they've fired they stop doing anything and they look "off" anyway. I can't think of any reasons we'd want to distinguish between "on" and "off" for particles that don't carry on puffing away forever. The only possible reason I can think of is, if the particle lasts a long time before stopping, you might want to trigger it off before it finishes. I haven't thought of any realistic situations though.

 

Does anyone think that it needs a spawnarg? Or should we just have one-shotters always fire when triggered?

Link to comment
Share on other sites

One scenario to consider is that func_emitters can apparently have more than one particle attached to them, using "model1", "model2" etc spawnargs. That's supported in the code (if it works), but no published maps do it (I just did a quick check). Someone might want to attach both one-shot and cycling particles and have the cycling one turn on and off but the one-shotter always fire. But that would be very complicated to set up and the mapper would have an easy workaround, i.e. use two func emitters like everyone has until this point, so I'm still liking the simple option.

Link to comment
Share on other sites

For one-shot particles there is the spawnarg cycleTrigger. This will reset the particle timer to zero upon triggering. The only downside is that upon map start each partice fires once. This may be circumventable by using startoff, but I can't remember if triggering it will turn it on then if cycleTrigger is used. Would have to test it.

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

I don't think cycletrigger will work for one-shots, although I didn't test it. What it does is change the behaviour of triggering so that triggering means always on, not on/off, which covers my question here now I come to think about it. It'll still need the fix for one-shots though, because it doesn't override the random time offset that stops them being seen. But it's an alternative to the fix I had in mind, which was to automatically detect non cycling particles and make activation work differently.

Link to comment
Share on other sites

For one-shot particles there is the spawnarg cycleTrigger. This will reset the particle timer to zero upon triggering.

 

Thanks for this, I have changed the plan since checking it out. "cycleTrigger" was clearly the original solution to this problem, and fixing it has resulted in far simpler code than the fix I tested yesterday evening.

 

"cycleTrigger" got broken when someone gave func_emitters the ability to use multiple particle models. They also introduced a random time offset to make the particles look different. That overrode what cycleTrigger does, and broke the ability to trigger one-shot particles. Every other particle effect uses a "diversity" shaderparm instead of a time offset. Replacing the time offset with the standard diversity setting makes it all work again, and without the need for the func_emitter code to work out whether the particle is cycling or not (which is what I coded up yesterday).

 

The one extra change I'll make is to add some DR documentation for "cycleTrigger" because its purpose isn't at all clear from its name. I'd have changed the name, but it's been used in a published map, so I'll just add DR help notes and make sure it shows up in the default spawnargs.

Link to comment
Share on other sites

 


 

when someone gave func_emitters the ability to use multiple particle models

 

 

Tels did this to allow SEED to randomize particle distribution. If I understand the fix correctly, this shouldn't

break that functionality... Tels?

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

  • 2 weeks later...

 

Tels did this to allow SEED to randomize particle distribution. If I understand the fix correctly, this shouldn't

break that functionality... Tels?

 

I have no idea without delving into that code again - which I'd rather avoid at this time :)

"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

.

Edited by Tels

"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

Oops, that one was probably me: Mea culpa!

 

"cycleTrigger" got broken when someone gave func_emitters the ability to use multiple particle models. They also introduced a random time offset to make the particles look different. That overrode what cycleTrigger does, and broke the ability to trigger one-shot particles.

"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

    • 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.
      · 6 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
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...