Author |
Message |
Petethegoat
Joined: Mon Jun 15, 2009 4:02 pm Posts: 905
|
Particle equivalent of: for actor in MovableMan.Actors do
The subject says it all really. Something like particle in MovableMan.Particles?
HURP DERP
Last edited by Petethegoat on Sat Sep 25, 2010 4:53 pm, edited 1 time in total.
|
Sat Sep 25, 2010 4:43 pm |
|
|
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
|
Re: Particle equivalent of: for actor in MovableMan.Actors do
Ya we figured it out, it's MovableMan.Particles. LOL
|
Sat Sep 25, 2010 4:52 pm |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Particle equivalent of: for actor in MovableMan.Actors do
Also, just for reference, the 'particle' or 'actor' is entirely inconsequential. It's just defining a reference; it can be whatever the hell you feel like.
|
Mon Sep 27, 2010 12:36 am |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Particle equivalent of: for actor in MovableMan.Actors do
One of my friends likes to do his for loops with type of baked food items. 'For Pie In SeriousArray(5) Do'
|
Mon Sep 27, 2010 1:10 am |
|
|
FlamingHilt
Joined: Fri Dec 17, 2010 4:17 am Posts: 5
|
Re: Particle equivalent of: for actor in MovableMan.Actors do
I know I'm necroing this topic a bit, but I figured it was relevant and not worth a new topic anyways.
Since you can call the object anything you want (IE "Pie"), I take it you can only ask for objects from a list?
For example, for actor in MovableMan.Actors do
Could be written as for pie in MovableMan.Actors do
Since MovableMan.Actors is a list of actors, correct?
My question then is, how do I get a list of an actor's emitters? I have tried for AEmitter in actor.AEmitters do
to no avail (throws a nil reference error).
Any help appreciated.
|
Sat Dec 18, 2010 3:14 am |
|
|
CaveCricket48
Joined: Tue Jun 12, 2007 11:52 pm Posts: 13144 Location: Here
|
Re: Particle equivalent of: for actor in MovableMan.Actors do
I don't think you can do that.
However, I believe that there is a table that stores emitters, but I'm not sure if emitters on actors can be accessed with this table.
|
Sat Dec 18, 2010 7:13 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Particle equivalent of: for actor in MovableMan.Actors do
pairs(Emitters) is an automatically maintained list of all scripted emitters currently on the scene.
However, actor-attached emitters (as in, wounds) are treated as attachables, and are therefore impossible to work with.
|
Sat Dec 18, 2010 7:17 am |
|
|
FlamingHilt
Joined: Fri Dec 17, 2010 4:17 am Posts: 5
|
Re: Particle equivalent of: for actor in MovableMan.Actors do
Yea, I was going through the documentation, and it doesn't look like there is any good way to access attachables.
Thoughts on giving the actor a list of emitters?
I have plenty of Java under my belt and figuring out this Lua madness is both frustrating and exhilarating.
|
Sat Dec 18, 2010 7:35 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Particle equivalent of: for actor in MovableMan.Actors do
You can get SORT OF access to MO attachables by iterating though the MO index(set i to one, increase it, grab mo, until you hit the number of moids). This allows you to change scale(scale = 0 makes it invisible), delete(I think), and a handful of other things.
|
Sun Dec 19, 2010 2:09 am |
|
|
FlamingHilt
Joined: Fri Dec 17, 2010 4:17 am Posts: 5
|
Re: Particle equivalent of: for actor in MovableMan.Actors do
Well, emitters have an EnableEmission method, so that's no problem. They also have IsAttachedTo, which takes an actor, so that's no problem. The question now is, how do I get to all the emitters? I hate to ask for actual code but I'm not sure what you mean but iterating through the MO index. I know how to iterate of course, but what am I looking for? Something like this?: Code: for i = 1, MovableMan:GetMOIDCount()-1 if (MovableMan:GetMOFromID(i).IsEmitter()) then dostuff end end
As I said in my first paragraph, if I can get to a list of emitters then it's no problem. Code: if (emitter.IsAttachedTo(actor)) then if (emitter.IsEmitting() == 1) then emitter.EnableEmission(0) end end
That is, assuming IsEmitting and EnableEmission return and take indices instead of booleans. It didn't say in the documentation -- anybody know? Thanks.
|
Tue Dec 21, 2010 1:52 am |
|
|
|