Get an actor's args?

Archive of the old editing forum
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.
Locked
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Get an actor's args?

Post by LilWhiteMouse »

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)?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Get an actor's args?

Post by Gez »

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:

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
    }
}
Then from ACS you can use [wiki]GetUserArray[/wiki]. It's a bit of kludge, though.
User avatar
LilWhiteMouse
Posts: 2270
Joined: Tue Jul 15, 2003 7:00 pm
Location: Maine, US
Contact:

Re: Get an actor's args?

Post by LilWhiteMouse »

It works, so that's good enough for me.
User avatar
printz
Posts: 2649
Joined: Thu Oct 26, 2006 12:08 pm
Location: Bucharest, Romania
Contact:

Re: Get an actor's args?

Post by printz »

Gez wrote: Define a variable array in the actor's DECORATE code:
What if the user doesn't have permission to make DECORATE code for this to happen? For example if belonging to a community project.
Locked

Return to “Editing (Archive)”