Data Realms Fan Forums
http://45.55.195.193/

Attaching a MOPixel as an Emitter to an MOPixel Round
http://45.55.195.193/viewtopic.php?f=1&t=16101
Page 1 of 1

Author:  Triad0626 [ Tue Aug 04, 2009 4:18 am ]
Post subject:  Attaching a MOPixel as an Emitter to an MOPixel Round

I have a device that fires an MOPixel as its Round, and I was hoping to have it emit glowing pixels as a sort of tail. Is there a way to attach the glowing MOPixel to the MOPixel Round as an emitter?

Round:

Code:
 AddAmmo = Round
   PresetName = Round Proton Rifle
   ParticleCount = 1
   Particle = MOPixel
      ScreenEffect = ContentFile
         FilePath = Deus.rte/Daeis Weapons/Proton Rifle/Effects/Proton Hit Glow.bmp
      InstanceName = Particle Proton Rifle
      Mass = 0.03
      RestThreshold = 500
      LifeTime = 450
      Sharpness = 100
      HitsMOs = 1
      GetsHitByMOs = 0
      Color = Color
         R = 105
         G = 252
         B = 105
      Atom = Atom
         Material = Material
            CopyOf = Bullet Metal
         TrailColor = Color
            R = 105
            G = 252
            B = 105
         TrailLength = 4
   Shell = AEmitter
      CopyOf = Shell Proton Rifle
   FireVelocity = 100
   ShellVelocity = 10
   Separation = 0


Pixel that I'm hoping to have emitted as the tail:

Code:
 AddEffect = MOPixel
   PresetName = Proton Glow 1
   Mass = 0.01
   LifeTime = 20
   Sharpness = 0
   HitsMOs = 1
   GetsHitByMOs = 0
   Color = Color
      R = 105
      G = 252
      B = 105
   Atom = Atom
      Material = Material
         CopyOf = Bullet Metal
         PresetName = Proton Energy
         Bounce = -1
      TrailColor = Color
         R = 105
         G = 252
         B = 105
      TrailLength = 0
   ScreenEffect = ContentFile
      FilePath = Deus.rte/Daeis Weapons/Proton Rifle/Effects/Proton Bit Glow.bmp
   EffectStartStrength = 1
   EffectStartTime = 0
   EffectStopStrength = 1
   EffectStopTime = 100
   EffectAlwaysShows = 1


Thanks in advance.

Author:  Grif [ Tue Aug 04, 2009 4:35 am ]
Post subject:  Re: Attaching a MOPixel as an Emitter to an MOPixel Round

Not directly, no.

The simplest way would actually be a lua script; basically creating a timer, then whenever that timer is past X MS, create a particle.

If you can't figure it out I'll drop a script in here.

Author:  CaveCricket48 [ Tue Aug 04, 2009 4:41 am ]
Post subject:  Re: Attaching a MOPixel as an Emitter to an MOPixel Round

You can't attach a MOPixel as an AEmitter. It's like researching lizards with a book on mammals. I don't think MOPixels can have attached stuff either. You could have the fired round be an AEmitter that emmits glowing trail particles with very low emission velocities(MinVel, MaxVel) and AirResistance = 1 to keep the trail from moving. The AEmitter can gib on impact and have a few damaging sharp particles.

Edit: Shoot, I got ninja'd for the first time!

Author:  Triad0626 [ Tue Aug 04, 2009 6:33 pm ]
Post subject:  Re: Attaching a MOPixel as an Emitter to an MOPixel Round

The only problem I've come across with firing an AEmitter is that when you don't babysit your actors they accidentally fire into the ground, and an AEmitter that gibs will just destroy the gun or kill them, whereas a MOPixel won't do them any harm.

How would I write the LUA Script?

Author:  Areku [ Wed Aug 05, 2009 1:36 am ]
Post subject:  Re: Attaching a MOPixel as an Emitter to an MOPixel Round

You should have searched the forums first. That question was already asked about two hours ago, and was answered. ( By me, by the way.)

Anyway,
Allow me to draw back the curtain... :pipe:
Code:
function Create(self)
   self.timer = Timer();
   trail = CreateMOPixel("Plasma Cutter Trail","Apollocalipse.rte");
   
end


function Update(self)


   if self.timer:IsPastSimMS(10) == true then
      self.timer:Reset();   
      trail = CreateMOPixel("Plasma Cutter Trail","Apollocalipse.rte");
      trail.Pos = self.Pos;            
      MovableMan:AddParticle(trail);
   end      
end

Just replace "plasma cutter trail" with the name of your trail particle, and "Apollocalipse" with the folder of your mod.

EDIT: Also, it's Lua, not LUA.

Author:  Joe [ Fri Aug 07, 2009 3:34 am ]
Post subject:  Re: Attaching a MOPixel as an Emitter to an MOPixel Round

Or, if I am not mistaken, you can do what the Coalition Heavy Sniper does, only have it to where the slug is 1 pixel by 1 pixel, is trailed by a MOPixel emitter, and from there you can add whatever effects you want to it (again, I could be mistaken, so ask a DRL developer).

Author:  Grif [ Fri Aug 07, 2009 2:39 pm ]
Post subject:  Re: Attaching a MOPixel as an Emitter to an MOPixel Round

Or you could look at the entirely free-to-browse, use, modify, and distribute code that comes with the game.

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