Macro Calling...

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
Klaive
Cave Troll
Posts: 36
Joined: Wed Jun 18, 2008 3:03 pm

Macro Calling...

Post by Klaive »

Hey all, I have one general question...

Can you make a token property call on a Macro: campaign, lib, and/or token? If yes, how?

I know properties can call on proterties.
I know macros can call on macros.
I also know that macros can call on properties.
I just don't know, or understand how to, if a property could call on a macro.
Last edited by Klaive on Sat Jul 09, 2016 9:53 am, edited 1 time in total.

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

Re: Macro Calling...

Post by aliasmask »

Yes. But I recommend using user defined functions instead. See Wiki: defineFunction().

Code: Select all

macroProp:[macro("macroName@lib:token"): arguments][r: macro.return]
UDFProp:[r: udf(args)]
I believe referencing the prop on the token or using getProperty will run it. You can also have the results displayed using * before prop name.

Klaive
Cave Troll
Posts: 36
Joined: Wed Jun 18, 2008 3:03 pm

Re: Macro Calling...

Post by Klaive »

aliasmask wrote:Yes. But I recommend using user defined functions instead. See Wiki: defineFunction().

Code: Select all

macroProp:[macro("macroName@lib:token"): arguments][r: macro.return]
UDFProp:[r: udf(args)]
I believe referencing the prop on the token or using getProperty will run it. You can also have the results displayed using * before prop name.
Thanks aliasmask, but don't know how to use that nor does the wiki really explain it.

What I am wanting and/or eventually trying to do is write the proper code for a property so it can reference a macro/token, that way more marcos can be called on and to determine the final value of said property...
IE -
Player 1 is a Fighter.
Fighters start with 10hp, and gain 6 every level.
Player 2 is a Mage.
Mages start with 8hp and gain 5 every level.

---Properties---
Class:{"insert code that can reference multiple choices of classes, Fighter, Mage, Rogue, Entertainer"}
Level:"insert actual number"
HP:{"insert code that determines hp based on class & level"}
I appologize if I'm coming off as dense, it has been a while since I've typed code, specifically over 10 years since I typed up any macros/code for MapTool.

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

Re: Macro Calling...

Post by aliasmask »

I really don't recommend doing it that way. You should have macros set your values. Putting macros in the properties only convolutes the logic and has no advantage.

Post Reply

Return to “MapTool”