View unanswered posts | View active topics It is currently Sat Jan 11, 2025 10:30 am



Reply to topic  [ 5 posts ] 
 Two questions about directional emitters 
Author Message
User avatar

Joined: Fri Jan 26, 2007 8:27 pm
Posts: 40
Location: England
Reply with quote
Post 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


Wed Mar 23, 2011 1:32 pm
Profile
User avatar

Joined: Wed Sep 09, 2009 3:16 am
Posts: 3032
Location: Somewhere in the universe
Reply with quote
Post 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.


Wed Mar 23, 2011 5:05 pm
Profile
User avatar

Joined: Mon Oct 25, 2010 5:51 am
Posts: 1198
Location: Sydney
Reply with quote
Post 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.


Thu Mar 24, 2011 10:16 am
Profile
User avatar

Joined: Fri Jan 26, 2007 8:27 pm
Posts: 40
Location: England
Reply with quote
Post 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...


Fri Apr 08, 2011 1:21 am
Profile
User avatar

Joined: Thu Dec 16, 2010 11:06 pm
Posts: 276
Reply with quote
Post 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.


Sun Apr 10, 2011 9:55 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.061s | 14 Queries | GZIP : Off ]