Get an actor's args?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Get an actor's args?
Is there a way in ACS to get the args set on an actor? I could have sworn that you could do this with GetActorProperty(), but I see no mention of it on the wiki. I've gone to make a number of configurable decorations for Chibi Rebellion only to be stymied when I couldn't figure out how to control it's behavior with it's args. Am I going crazy(er)?
Re: Get an actor's args?
With ACS? All I can see at the moment is a workaround with user variables.
Define a variable array in the actor's DECORATE code:
Then from ACS you can use [wiki]GetUserArray[/wiki]. It's a bit of kludge, though.
Define a variable array in the actor's DECORATE code:
Code: Select all
Actor Blah : BlahBlah
{
var int user_args[5];
blah properties blah
States
{
Spawn:
BLAH A 0 // Dummy first frame
BLAH A 0 A_SetUserArray(user_args, 0, args[0])
BLAH A 0 A_SetUserArray(user_args, 1, args[1])
BLAH A 0 A_SetUserArray(user_args, 2, args[2])
BLAH A 0 A_SetUserArray(user_args, 3, args[3])
BLAH A 0 A_SetUserArray(user_args, 4, args[4])
Idle: // Fallthrough
BLAH A 35
Loop
}
}- LilWhiteMouse
- Posts: 2270
- Joined: Tue Jul 15, 2003 7:00 pm
- Location: Maine, US
- Contact:
Re: Get an actor's args?
It works, so that's good enough for me.
Re: Get an actor's args?
What if the user doesn't have permission to make DECORATE code for this to happen? For example if belonging to a community project.Gez wrote: Define a variable array in the actor's DECORATE code:
