Your modified one. I need something to make my lasers look better, and that's it.
Fri Jun 17, 2011 5:49 pm
Mehman
Joined: Tue Nov 17, 2009 7:38 pm Posts: 909 Location: France
Re: AmmoSquall Beta Release UPDATE DEUX
Here it is, I just slightly modified Non's code so you should credit him.
lua attached to the MOPixel fired by the rifle:
Code:
function Create(self) self.weaponname = "Laser Rifle"; local curdist = 50; for i = 1,MovableMan:GetMOIDCount()-1 do gun = MovableMan:GetMOFromID(i); if gun.PresetName == self.weaponname and gun.ClassName == "HDFirearm" and (gun.Pos-self.Pos).Magnitude < curdist then actor = MovableMan:GetMOFromID(gun.RootID); if MovableMan:IsActor(actor) then local bombcheck = ToActor(actor):Inventory(); self.parent = ToActor(actor); self.parentgun = ToHDFirearm(gun); self.parentid = ToActor(actor).ID; end end end self.length = SceneMan:CastObstacleRay( (self.Pos-(self.Vel*TimerMan.DeltaTimeSecs)), Vector(2000,0):RadRotate(self.parent:GetAimAngle(true)), Vector(0, 0), Vector(0, 0), self.parentid, 0, 0); --print(self.length); if self.length == -1 then self.length = 2000; end local velCorrection = self.Vel * (FrameMan.PPM * TimerMan.DeltaTimeSecs); local trueLength = self.length + velCorrection.Magnitude; local iters = (math.ceil(trueLength)); local initPos = self.Pos - velCorrection; local increment = (trueLength / iters); for i=0,iters,1 do particle = CreateAEmitter("Violet Burster"); particle.Pos = initPos + (self.Vel.Normalized * (i * increment)); particle.Vel = Vector(0,0); MovableMan:AddMO(particle); end for i=0,iters,1 do particle = CreateMOPixel("Particle LASERSLS"); particle.Pos = initPos + (self.Vel.Normalized * (i * increment)); particle.Vel = Vector(120,0):RadRotate(self.parent:GetAimAngle(true)); MovableMan:AddMO(particle); end
self.ToDelete = true; end
it creates aemitters that emit glowy particles in a straight line, but doesn't do any damage(shoot sharp MOPixels with it do deal damage)
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