Data Realms Fan Forums
http://45.55.195.193/

Two questions about directional emitters
http://45.55.195.193/viewtopic.php?f=1&t=22151
Page 1 of 1

Author:  Entropy [ Wed Mar 23, 2011 1:32 pm ]
Post subject:  Two questions about directional emitters

Hey guys.

First question: I'm making an airstrike target designator, and to do this I want to have it fire a shot that gibs into an emitter which drops a bomb from up high. Unfortunately I can't work out how to make a gib (the emitter) always face one direction on the map when it appears - it instead faces the direction that it was shot (with an 0 rad gib spread) or anywhere (with a 3.14 rad gib spread) when I want it to go straight up no matter what direction it came from. Is this do-able? I'm going to try making the emitter be slightly negatively affected by gravity so it should orient itself upwards but this seems... unreliable. It could snag on things and start pooping bombs out sideways.

I've also got plans to use this emitter to check if there is open sky above the target area, by firing a particle upwards and seeing if it hits anything for X distance and calling the airstrike only if it does not hit anything. This means I'm quite keen to get the fixed-emitter idea to work rather than using a workaround.

--- --- ---


Second question: I'm also making a cluster bomb. At the moment it breaks open 20m above ground level using Lua, gibbing an open bomb casing and two emitters which spit bombs left and right as it falls. Naturally the emitters don't -always- line up with the bomb casing which looks pretty strange when it goes wrong. I'd like to fix the emitters to the bomb casing (an MOSRotating), but Cortex Command doesn't like me attaching emitters to an MOSRotating. I lifted the code for attaching parts to things from the Dreadnought code, so what am I doing wrong? Is it impossible to do add emitters to something which isn't and actor or helddevice?

Here's the code:
Code:
AddAttachable = AEmitter // Spits bombs one way
   PresetName = Cluster Bomb Emitter 1
*the rest of the emitter data*

AddAttachable = AEmitter // Spits bombs the other
   PresetName = Cluster Bomb Emitter 2
*the rest of the emitter data*

AddEffect = MOSRotating
   InstanceName = Cluster Bomb Open // The open casing of the cluster bomb
*the rest of the cluster bomb casing data*
   AddAttachable = Attachable
      CopyOf = Cluster Bomb Emitter 1
      ParentOffset = Vector
         X = 0
         Y = -3
   AddAttachable = Attachable
      CopyOf = Cluster Bomb Emitter 2
      ParentOffset = Vector
         X = 0
         Y = 3

AddAmmo = TDExplosive
   InstanceName = Cluster Bomb // The bomb itself, which is Lua'd to gib above ground level.
*cluster bomb data*
   AddGib = Gib
      GibParticle = MOSRotating
         CopyOf = Cluster Bomb Open
      Count = 1
      Spread = 0.0
      MaxVelocity = 0
      MinVelocity = 0
      InheritsVel = 1
   AddGib = Gib
      GibParticle = AEmitter
         CopyOf = Cluster Bomb Emitter 1
      Count = 1
      Spread = 3.14
      MaxVelocity = 0
      MinVelocity = 0
      InheritsVel = 1
   AddGib = Gib
      GibParticle = AEmitter
         CopyOf = Cluster Bomb Emitter 2
      Count = 1
      Spread = 3.14
      MaxVelocity = 0
      MinVelocity = 0
      InheritsVel = 1
   GibImpulseLimit = 350
   GibWoundLimit = 2
   GibSound = Sound
      AddSample = ContentFile
         Path = Rigal Corporation.rte/Q Device/Cluster Bomb/Bomb.wav
   Buyable = 1

Author:  dragonxp [ Wed Mar 23, 2011 5:05 pm ]
Post subject:  Re: Two questions about directional emitters

In those AEmitters, make sure they their EmissionAngle = 270 so that it shoots down. And make sure the AEmitters have OrientToVel = 0.

Author:  Kettenkrad [ Thu Mar 24, 2011 10:16 am ]
Post subject:  Re: Two questions about directional emitters

Entropy wrote:
Code:
AddAttachable = AEmitter // Spits bombs one way
   PresetName = Cluster Bomb Emitter 1
*the rest of the emitter data*

AddAttachable = AEmitter // Spits bombs the other
   PresetName = Cluster Bomb Emitter 2
*the rest of the emitter data*

AddEffect = MOSRotating
   InstanceName = Cluster Bomb Open // The open casing of the cluster bomb
*the rest of the cluster bomb casing data*
   AddAttachable = Attachable
      CopyOf = Cluster Bomb Emitter 1
      ParentOffset = Vector
         X = 0
         Y = -3
   AddAttachable = Attachable
      CopyOf = Cluster Bomb Emitter 2
      ParentOffset = Vector
         X = 0
         Y = 3


AddEffect = AEmitter
PresetName = Cluster Bomb Emitter 1


bomb:
AddEmitter = AEmitter
CopyOf = Cluster Bomb Emitter 1
ParentOffset = Vector
X = 0
Y = -3

I think.

Author:  Entropy [ Fri Apr 08, 2011 1:21 am ]
Post subject:  Re: Two questions about directional emitters

Thanks Kettenkrad! I was using AddAttachable (guess that only works for actors) instead of AddEmitter.

I figured out why the emitters were not working anyway when attached to the bomb. It's because the bomb casing gibbed to easily, and the force of the bombs being emitted broke it after only a couple of bombs were released.

Now to get the airstrike working correctly...

Author:  thesoupiest [ Sun Apr 10, 2011 9:55 pm ]
Post subject:  Re: Two questions about directional emitters

The Red Loki pack contains the Area Strike Caller. Feel free to take a look at its code and use it as you wish.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/