Author |
Message |
Siric
Joined: Wed Oct 25, 2006 7:57 pm Posts: 240 Location: Out there, among the stars.
|
Setting status?
Actor Lua Documentation wrote: Status - 0 = STABLE
- 1 = UNSTABLE
- 2 = INACTIVE
- 3 = DYING
- 4 = DEAD
I had a great idea concerning robots in a certain field being Uncontrollable and unable to move, I'm assuming that Inactive status would Achieve part of this (Unable to move), but I don't know how to set it. So, how do I set the Status of an actor?
|
Thu May 28, 2009 2:04 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Setting status?
for actor in MovableMan.Actors do actor.Status = 2; end
Should work.
|
Thu May 28, 2009 2:40 am |
|
|
Siric
Joined: Wed Oct 25, 2006 7:57 pm Posts: 240 Location: Out there, among the stars.
|
Re: Setting status?
Hmm, Either the Inactive setting does nothing or the code isn't working, I'm voting on the former. Is there any other way to completely incapacitate an actor?
|
Thu May 28, 2009 2:50 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Setting status?
Well try a different status check to see if that's the problem.
|
Thu May 28, 2009 2:56 am |
|
|
Siric
Joined: Wed Oct 25, 2006 7:57 pm Posts: 240 Location: Out there, among the stars.
|
Re: Setting status?
Huh, I tried the Dead status and nothing happened, so it must be the code.
|
Thu May 28, 2009 3:37 am |
|
|
Daman
Joined: Fri Jan 26, 2007 3:22 am Posts: 1451
|
Re: Setting status?
Is it returning an error? If not, it's not the code.
It could just be that the game doesn't care what the status is set to via Lua.
|
Thu May 28, 2009 3:39 am |
|
|
Siric
Joined: Wed Oct 25, 2006 7:57 pm Posts: 240 Location: Out there, among the stars.
|
Re: Setting status?
Daman wrote: Is it returning an error? If not, it's not the code.
It could just be that the game doesn't care what the status is set to via Lua. Ah, I don't see any Error in the console, So you are right. Is there any other way to incapacitate an actor?
|
Thu May 28, 2009 3:43 am |
|
|
Duh102
happy carebear mom
Joined: Tue Mar 04, 2008 1:40 am Posts: 7096 Location: b8bbd5
|
Re: Setting status?
You could pin him. I believe you can just do Code: actor.PinStrength = 10000;
|
Thu May 28, 2009 4:04 am |
|
|
Darlos9D
Joined: Mon Jul 16, 2007 9:50 am Posts: 1512 Location: Tallahassee, FL
|
Re: Setting status?
Duh102 wrote: You could pin him. I believe you can just do Code: actor.PinStrength = 10000; But then they can still fire. For my EMP grenade, I just used SetControllerMode(Controller.CIM_DISABLED), an Actor function. Just keep calling that on actors in the Update code for as long as you want. As soon as you stop calling it, they'll go back to normal, so it's pretty simple to use.
|
Thu May 28, 2009 4:22 am |
|
|
mail2345
Joined: Tue Nov 06, 2007 6:58 am Posts: 2054
|
Re: Setting status?
Tip: CIM_NETWORK works much better than CIM_DISABLED, as for some reason disabled units still turn to the direction they get shot in.
|
Thu May 28, 2009 5:34 am |
|
|
Darlos9D
Joined: Mon Jul 16, 2007 9:50 am Posts: 1512 Location: Tallahassee, FL
|
Re: Setting status?
Well, I also made it so they flip out and constantly look in random directions, so that's not quite so noticeable.
Never tried the network setting though.
|
Thu May 28, 2009 6:24 am |
|
|
|