Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
Adding an object as a gib with lua.
How do you or can you do that?
Mon Oct 12, 2009 8:12 am
piipu
Joined: Mon Jun 30, 2008 9:13 pm Posts: 499 Location: Finland
Re: Adding an object as a gib with lua.
Code:
function Destroy(self) local particle = CreateMOSRotating("blah") particle.Pos = self.Pos particle.Vel = self.Vel MovableMan:AddParticle(particle) end
Though this happens also upon settling and Lifetime running out.
Mon Oct 12, 2009 1:36 pm
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
Re: Adding an object as a gib with lua.
Can you do this?
Code:
function Update(self) self.somevariable = whatever end
function Destroy(self) local particle = CreateMOSRotating("self.somevariable blah") particle.Pos = self.Pos particle.Vel = self.Vel MovableMan:AddParticle(particle) end
Or would it be (self.somevariable "blah")?
Tue Oct 13, 2009 2:53 am
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
Re: Adding an object as a gib with lua.
It would be:
Code:
self.somevariable .. "blah"
The ".." operator is a concatenation operator, otherwise known as "put that onto the end of this".
Tue Oct 13, 2009 3:00 am
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
Re: Adding an object as a gib with lua.
So the preset would be "blah whatever" if (self.somevariable .. "blah") in that case, right?
Tue Oct 13, 2009 3:07 am
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
Re: Adding an object as a gib with lua.
It's like addition. Whatever is to the left of the concat operator is what the part on the right is added to, "Bleh" .. "Blah" = "BlehBlah"
Tue Oct 13, 2009 3:08 am
CrazyMLC
Joined: Fri Dec 22, 2006 4:20 am Posts: 4772 Location: Good news everyone!
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