MovableMan:AddParticle Problem/Pie Menu Question
Old ^
New v
So now that I've changed the code, I no longer need to find the gun or actor that shoots a bullet. Now I'm having problems with the MovableMan:AddParticle function. It's displaying the error message:
"ERROR: no overload of 'MovableManager:AddParticle' matched the arguments (MovableManager, MOPixel)
candidates are:
MovableManager:AddParticle(MovableManager o, MovableObject x)"
I found it strange since I looked at a coalition rifle script that used AddParticle, also with an MOPixel. This is my code right now:
Code:
function Create(self)
self.Mode = 1
self.TimeCheck = false
self.timer = Timer()
end
function Update(self)
if self:IsActivated() then
if self.Mode == 1 then
self.bullet = CreateMOPixel("TDG Bullet","Pro Defence.rte")
self.bullet.Pos.X = self.Pos.X+(math.cos(self.RotAngle)*25)
self.bullet.Pos.Y = self.Pos.Y+(math.sin(self.RotAngle)*-25)
self.bullet.RotAngle = self.RotAngle
local i = 0
for i = 1, 10 do
self.bullet.Vel.X = math.cos(self.RotAngle)*(math.random()*25)
self.bullet.Vel.Y = math.sin(self.RotAngle)*(math.random()*-25)
MovableMan:AddParticle(self.bullet)
end
self.timer:Reset()
self.TimeCheck = true
else
self.bullet.RotAngle = self.RotAngle
self.bullet.Vel.X = math.cos(self.RotAngle)*25
self.bullet.Vel.Y = math.sin(self.RotAngle)*-25
self.bullet.PinStrength = 0
end
end
if self.TimeCheck == true and self.timer:IsPastSimMS(100) then
self.bullet.PinStrength = -1
self.TimeCheck = false
end
end
function ModeToggle(self)
if self.Mode == 1 then
self.Mode = 2
else
self.Mode = 1
end
end
And also is that the right way to code the pie menu things? The last function is intended to be that, but it seems that the pie menu scripts are handled in a file different from the script attached to the weapon.