Data Realms Fan Forums
http://forums.datarealms.com/

addparticle
http://forums.datarealms.com/viewtopic.php?f=1&t=46139
Page 1 of 1

Author:  Hoovytaurus [ Sun Jan 22, 2017 3:24 pm ]
Post subject:  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

Author:  Visage [ Tue Jan 24, 2017 1:46 pm ]
Post subject:  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.


Author:  Hoovytaurus [ Tue Jan 24, 2017 6:49 pm ]
Post subject:  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

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/