View unanswered posts | View active topics It is currently Tue Mar 19, 2024 9:09 am



Reply to topic  [ 3 posts ] 
 addparticle 
Author Message

Joined: Mon Dec 21, 2015 9:30 am
Posts: 89
Reply with quote
Post addparticle
EDIT: just realized i didnt put this in lua scripting, whoops

wow ive been spamming this place huh?

well, i like modding, so

Code:
  if self.Magazine ~= nil then
    if self:IsActivated() == true then
      self.shooting = true
    end
    if self:IsActivated() == false and self.shooting == true then
       self.shooting = false
       sfx = CreateAEmitter("Stop Shoot BIG MGER");
       sfx.Pos = self.Pos;
       MovableMan:AddParticle(sfx);
    end
  end


this does not work, tells me that addparticle is supposed to be (movablemanager2, movableobject*)

i find this weird because this code (taken from some code 4zk made for me

Code:
   elseif self.Magazine and self:IsActivated() then      -- not yet charging, activated & magazine exists (not reloading)
      if self.triggerPulled == false then         -- trigger isn't already been pulled
         self:Deactivate();            -- can't fire
         self.charge = true;         -- start charge
         self.triggerPulled = true;      -- trigger has been pulled
         self.chargeTimer:Reset();      -- start timer from 0
         sfx = CreateAEmitter("Heavies Sniper Charge"); -- make an AEmitter with the sound, example: Dummy.rte/Devices/Weapons/Laser Cannon.ini/"Dummy Laser Cannon Sound Fire"
         sfx.Pos = self.Pos;
         MovableMan:AddParticle(sfx);


works perfectly, even tho its the same.

?????

i can copyp aste it right over and change the name (its still an aemitter btw) and it stops working

so what


Sun Jan 22, 2017 3:24 pm
Profile

Joined: Fri Jul 06, 2012 7:20 am
Posts: 44
Reply with quote
Post Re: addparticle
I think your problem is that it's not actually making an AEmitter. Lua is dynamically typed, so you're probably trying to add an error code or something as a particle... which would explain your error message.

I recently made a script that does what you're trying to do, so I'm pasting it here. Of particular note is that CreateAEmitter() accepts an argument telling it which rte to look in, which I think you should always use on general principle.



Tue Jan 24, 2017 1:46 pm
Profile

Joined: Mon Dec 21, 2015 9:30 am
Posts: 89
Reply with quote
Post Re: addparticle
Visage wrote:
I think your problem is that it's not actually making an AEmitter. Lua is dynamically typed, so you're probably trying to add an error code or something as a particle... which would explain your error message.

I recently made a script that does what you're trying to do, so I'm pasting it here. Of particular note is that CreateAEmitter() accepts an argument telling it which rte to look in, which I think you should always use on general principle.



you have the magic modding fingers my friend, works perfectly

thank you, good luck on all that you may do


Tue Jan 24, 2017 6:49 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.435s | 15 Queries | GZIP : Off ]