Finicky scripts and errors?
I am having some weirdness with a script. More specifically, a script I know normally works, but is throwing up errors all of a sudden;
Code:
function Create(self)
self.ExplosiveName = "EXPLOSIVENAME"; --the name of the AEmitter used for the explosion effect
self.acc = 0; --the relative acceleration of the bolt per second
self.Vel = self.Vel.Normalized*self.Velocity;
end
function Update(self)
self.Vel = self.Vel.Normalized*(self.Vel.Magnitude*(1+(self.acc*TimerMan.DeltaTimeSecs)));
local ray = SceneMan:CastMORay(self.Pos , self.Vel*1*TimerMan.DeltaTimeSecs*FrameMan.PPM , self.ID ,self.Team, 0, false , 0);
if ray ~= 255 or self.Vel.Magnitude < 6 or self.ToDelete == true then
local ray2 = SceneMan:CastObstacleRay(self.Pos , self.Vel*1*TimerMan.DeltaTimeSecs*FrameMan.PPM, Vector() , Vector() , 255 , 0 , 0 , 0);
local lr = CreateAEmitter(self.ExplosiveName);
lr.Pos = self.Pos;
lr.Vel = self.Vel;
lr.Team = self.Team;
lr.IgnoresTeamHits = true;
MovableMan:AddMO(lr);
self.ToDelete = true;
end
end
Ignoring the generic EXPLOSIVENAME, the problem is thus; the script spams the following error into console;
Code:
ERROR: no overload of 'Vector:__mul' matched the arguments (Vector, nil)
candidates are:
Vector:__mul(lua_State*, const Vector&, custom [float])
I have a two essentially identical scripts that I know work without causing errors, but if I try modifying them (simply changing the EXPLOSIVENAME and CreateAEmitter/CreateMOSRotating accordingly), they cause the above error.
Anyone have any idea which line might be causing this?