State Change macro wont change state

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
eddydateddy
Kobold
Posts: 4
Joined: Sat Jun 17, 2017 3:34 am

State Change macro wont change state

Post by eddydateddy »

Okay, so im trying to make something that seems pretty simple to me, i have used the dmg/healing macro tutorial as a base.

So far this is what i have, and clearly i have no idea what im actually doing, but It does not actually change the state of the token...can anyone please help me?

Code: Select all

[h:status = input(

"effect|Dead,Incapacitated,Blinded,Charmed,Deafened,Frightened,Grappled,Invisible,Paralyzed,Petrified,Poisoned,Prone,Restrained,Stunned,Unconcious|What is wrong?|RADIO|SELECT=0")]
[h:abort(status)]
 
[if(effect == 0),CODE:
{
    [h: setstate("Dead", 1]
};
{
    [h: setState("Incapacitated", 1)]  
};
{
    [h: setState("Blinded", 1)]  
};
{
    [h: setState("Charmed", 1)]  
};
{
    [h: setState("Deafened", 1)]  
};
{
    [h: setState("Frightened", 1)]  
};
{
    [h: setState("Grappled", 1)]  
};
{
    [h: setState("Invisible", 1)]  
};
{
    [h: setState("Paralyzed", 1)]  
};
{
    [h: setState("Petrified", 1)]  
};
{
    [h: setState("Poisoned", 1)]  
};
{
    [h: setState("Prone", 1)]  
};
{
    [h: setState("Restrained", 1)]  
};
{
    [h: setState("Stunned", 1)]  
};
{
    [h: setState("Unconcious", 1)]  
};]

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: State Change macro wont change state

Post by aliasmask »

Bad syntax. I recommend something like this:

Code: Select all

[H: states = "Dead,Incapacitated,Blinded,Charmed,Deafened,Frightened,Grappled,Invisible,Paralyzed,Petrified,Poisoned,Prone,Restrained,Stunned,Unconcious"]
[H: abort(input(strformat("effect|%{states}|What is wrong?|RADIO|VALUE=STRING")))]
[H: setState(effect,1)]

eddydateddy
Kobold
Posts: 4
Joined: Sat Jun 17, 2017 3:34 am

Re: State Change macro wont change state

Post by eddydateddy »

Hey quick reply! Thanks a lot that worked perfectly, thank you so much for the help :)

Post Reply

Return to “Macros”