What code can I put in campaign properties for token?

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
Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

What code can I put in campaign properties for token?

Post by Merudo »

I have a bit of complicated code involving conditional statements & select case to derive a token property.

Another properties involve dealing with some json objects.

Can I incorporate that sort of code directly into the campaign properties?

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

Re: What code can I put in campaign properties for token?

Post by aliasmask »

You can, but you shouldn't. If you have some code it's best to make a UDF/macro and have the property call it.

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: What code can I put in campaign properties for token?

Post by Merudo »

How do I call a macro from the properties? It keeps giving me errors when I try.

For example, the following doesn't work:

Myvar:{[macro("mymacro@Lib:mylib"):""]}

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

Re: What code can I put in campaign properties for token?

Post by aliasmask »

The format is

Code: Select all

*propName(propAlias):[macro("macroname@lib:token"):""][r: macro.return]
Any errors in code may not give output but the display will just show the macro call.

Merudo
Giant
Posts: 228
Joined: Wed Jun 05, 2019 7:06 am

Re: What code can I put in campaign properties for token?

Post by Merudo »

Thank you! I had not realized that [r: macro.return] was necessary.

Post Reply

Return to “MapTool”