GlasWolf on 15/1/2006 at 14:36
Not doing very well with the newbie questions today. :erg: Well I can't help either but I have one too.
I've added a DustExplosion emitter and I'm trying to trigger it when the player enters a volume, but it doesn't work. I have a script to change the EmitterSpawnState from EDS_NoParticles to EDS_NormalSpawning, wait 3 seconds then turn it to EDS_NoNewParticles. This works for a DrippingWater emitter but not for the DustExplosion. I'm guessing this is because it's a once-only effect rather than constant like the water drips, but I don't know how else to do it. Am I doing it the wrong way?
Ziemanskye on 15/1/2006 at 14:49
Does the dustemiiter start on?
(put the start point so you can look at it right at the start of the map - it might be triggering and then it's done before you get to it.)
I think it's Emitters>(each bit of the emitter)>General>bStartActive, but I'm not sure. You'll just need to twiddle it on with the volume, it'll fire once then then stop anyway so you don't need to deactivate it yourself.
GlasWolf on 15/1/2006 at 15:34
It's not *visibly* triggering, but I think you're absolutely right about the problem - basically I can't find the correct property to "fire" the emitter rather than just turn the particles on and off. The General category only contains CoordinateSystem, EffectAxis, MaxParticles and ResetAfterChanges. There is a property called disabled under Local, but it's not scriptable. I've also tried EmitterState but no joy, the description suggests this is more to do with off-screen rendering.
Edit: Oh and that reminds me, talk about a newbie question - how do you rotate the start direction? I've seen it mentioned several times (including in this thread) but never answered.
Ziemanskye on 15/1/2006 at 15:48
You rotate the start direction the same you do anything else.
Unfortunately it doesn't work unless you teleport to it from what I remember, so in the editor "play map" always points you the same way...
There may be something I'm missing on that too.
As for the local>disabled property, you should be able to script it - just type it in manually.
Or you could always just try bOutofWorld-ing it.
Krypt on 15/1/2006 at 21:00
Quote Posted by GlasWolf
Not doing very well with the newbie questions today. :erg: Well I can't help either but I have one too.
I've added a DustExplosion emitter and I'm trying to trigger it when the player enters a volume, but it doesn't work. I have a script to change the EmitterSpawnState from EDS_NoParticles to EDS_NormalSpawning, wait 3 seconds then turn it to EDS_NoNewParticles. This works for a DrippingWater emitter but not for the DustExplosion. I'm guessing this is because it's a once-only effect rather than constant like the water drips, but I don't know how else to do it. Am I doing it the wrong way?
I'm not entirely sure this would work, but this is how I would try to set it up: Manually add a Spawn link from your volume to DustExplosion. Type in the target in the browser, so it links to the archetype in gamesys itself, rather than an instance. Then add an invisible marker in your map and create a Triggerscript link going from the volume to the marker. Now add this script to the volume.
CONDITIONS
-When linked volume [MYSELF] is breached
ACTIONS
-Spawn object type at end of [Spawn] at all locations at the end of [TriggerScript]
What this will do is spawn an emitter from gamesys. This way if it is indeed a one-time emitter, it should spawn and play and then disappear when it's done.
GlasWolf on 15/1/2006 at 22:39
Quote Posted by Krypt
Manually add a Spawn link from your volume to DustExplosion. Type in the target in the browser, so it links to the archetype in gamesys itself, rather than an instance. Then add an invisible marker in your map and create a Triggerscript link going from the volume to the marker. Now add this script to the volume.
CONDITIONS
-When linked volume [MYSELF] is breached
ACTIONS
-Spawn object type at end of [Spawn] at all locations at the end of [TriggerScript]
What this will do is spawn an emitter from gamesys. This way if it is indeed a one-time emitter, it should spawn and play and then disappear when it's done.
Works perfectly. Krypt, you're a star. :thumb: Thanks Z for your efforts too.
GlasWolf on 23/1/2006 at 19:03
Wahey, triple post - I'm turning into a less useful version of New Horizon! Anyway, slightly OT from the original question but is there any way I can script or link to objects after spawning them from the gamesys? Say I wanted to spawn a light then be able to turn it on and off, for example.
veledan on 23/1/2006 at 19:13
Quote Posted by GlasWolf
is there any way I can script or link to objects after spawning them from the gamesys? Say I wanted to spawn a light then be able to turn it on and off, for example.
You can create the links between archetypes in the object browser then I think it'll work. If you just want one GEN_Light or whatever to turn on and off and don't want any more you place to do so, sub-class the light first to create a new archetype, create a link from your switch (or whatever object you'll attach the script to) to the new archetype and then spawn the new archtype.
What you
can't do (not that you are trying to) is create links between archetypes in the gamesys and then expect existing objects to inherit the links. But newly spawned concretes and ones you place in the level after setting up the link should pick up the links you create between their archetypes.
Krypt on 23/1/2006 at 19:28
Quote Posted by GlasWolf
Wahey, triple post - I'm turning into a less useful version of New Horizon! Anyway, slightly OT from the original question but is there any way I can script or link to objects after spawning them from the gamesys? Say I wanted to spawn a light then be able to turn it on and off, for example.
Yes, this is possible. Use one of the following actions for the spawning:
-Spawn object of [Class] and create a [LinkFlavor] link from spawned object to this object
-Spawn object type at end of [LinkFlavor] at my location plus X= [Float] Y= [Float] Z= [Float] , inheriting all my links
The first action will allow you to create a new link from the spawner (which is the Invisible marker in the example I gave earlier) to the spawned object, and the second will allow you to create whatever links you want on the spawner and have them transfer to the spawned object. You should be able to reference these links through script after the object is spawned.