Ok... This ain't funny anymore.
I keep getting errors that look like this:
Just a ton of symbols and words with no meaning what so ever. At first I thought it was funny and ignored it, but its really starting to get on my nerves.
This is what triggers it:
Code:
function Create(self)
self.curDist = 20;
local i = Vector(0,0);
i.X = math.cos(self.RotAngle) * self.curDist * -1;
i.Y = math.sin(self.RotAngle) * self.curDist;
local ParentID = SceneMan:CastMORay(self.Pos, i, self.ID, -1, false, 0);
if ParentID ~= 255 then
local j = MovableMan:GetRootMOID(ParentID);
self.Parent = MovableMan:GetMOFromID(j);
if self.Parent:IsActor() then
for i = 0, MovableMan:GetMOIDCount() do
if MovableMan:GetRootMOID(i) == self.Parent.ID and MovableMan:GetMOFromID(i).PresetName == "Grapple Gun" then
self.gun = MovableMan:GetMOFromID(i);
end
end
if ToHeldDevice(self.gun):IsActivated() and ToHeldDevice(self.gun):IsFull() ~= true then
local Smoke = CreateAEmitter("Smoke Emitter");
Smoke.Pos = self.Pos;
Smoke.RotAngle = ToActor(self.Parent):GetAimAngle(true);
MovableMan:AddParticle(Smoke);
end
end
end
self.Lifetime = 1;
end
Or more specifically, this:
Code:
ToHeldDevice(self.gun):IsFull() ~= true
What I have here is a MOSRot emitted off of a gun. It finds the actor I'm using and its gun, runs the script, and deletes. All in one update.
What I'm trying to do with that line is fire some effect particles when the gun is fired, but if you keep holding the fire button it shoots the effects out non stop. This is where the broken line comes in, it limits the particle creation to as long as the gun still has ammo (A few frames). Is there is any way to limit the creation without using the broken part, or fixing it so the broken part still works?