Morale Macro (Checking Multiple Ranges of Values?)

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
User avatar
Bladehawk
Kobold
Posts: 4
Joined: Fri Apr 15, 2016 12:18 pm

Morale Macro (Checking Multiple Ranges of Values?)

Post by Bladehawk »

Hi guys.

Pretty new with MapTool, very excited about what it can offer. I'm experimenting with a morale system in which the lower a token's health, the more likely it is to flee each combat round.

I've learned that [switch():] cases can't logically check values, so I'm trying to think of the best way to structure my macro. I wanted to do something like:
  • Roll a 100-sided die. If the token is at 50-40% health, a roll of 1-25 will cause the token to flee.
    If the token's at 39-30% health, a roll of 1-35. Etc., etc.
I don't think MapTool supports an if-else structure, but that's kind of what I'm aiming for. I'd appreciate any tips you guys might have!

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Morale Macro (Checking Multiple Ranges of Values?)

Post by aliasmask »

Here's a couple of ways to handle it: http://forums.rptools.net/viewtopic.php ... 15#p254751

User avatar
Bladehawk
Kobold
Posts: 4
Joined: Fri Apr 15, 2016 12:18 pm

Re: Morale Macro (Checking Multiple Ranges of Values?)

Post by Bladehawk »

Excellent, thanks. Nested if's actually worked better than I thought they would (I feared some kind of apocalypse!), and it's working.

Post Reply

Return to “Macros”