How to break a command line when IF returns false

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
Rodcout
Kobold
Posts: 12
Joined: Thu Jun 06, 2019 5:23 pm

How to break a command line when IF returns false

Post by Rodcout »

I'm playing a face table using Maptools and I've created macros for the data rollovers in a physical way in which the scrolling result is inserted into the system. it turns out that as long as the scrolling result is unsuccessful I wish that Macro did not follow through the command line.


Ataque: <b> [Ataque=if(THACO - CA> ModAtc + rolagem_de_ataque + AtacDist, "Errou!", "Acertou!" )] <b> <br>
Dano: <b> [if(Ataque=="Errou!", 0, adaga1d4 + AjDan)] <b>

In that case I would like it when the result of the attack was "Wrong!" not be requested to include "adaga1d4 + AjDan".


I think it's just including an additional command, but I already researched everything and did not find it, we here played AD & D 2ed.

Thanks!

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: How to break a command line when IF returns false

Post by Phergus »

Welcome!

What you are looking for is probably the if roll option combined with the code_(roll_option).

Code: Select all

[h: Ataque = if(THACO - CA > ModAtc + rolagem_de_ataque + AtacDist, "Errou!", "Acertou!" )]
Ataque: <b>[r: Ataque]</b><br>
[r, if(Ataque=="Errou!"),code: {
    [h: Dano = 0]
};{
    Dano: <b>[r: Dano = adaga1d4 + AjDan)]</b></br>
}]

Rodcout
Kobold
Posts: 12
Joined: Thu Jun 06, 2019 5:23 pm

Re: How to break a command line when IF returns false

Post by Rodcout »

Thanks for helping, I've been trying to fix this for days, now it's going to be a lot easier to use the CODE command: :D

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: How to break a command line when IF returns false

Post by Phergus »

If you want to create a Portuguese translation file for MapTool, let us know.

Post Reply

Return to “MapTool”