a Lib token and onCampaignLoad

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
ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

a Lib token and onCampaignLoad

Post by ziltmilt »

I've created UDFs before on prior Maptool cmpgn files, but I cannot get them to work on a new project. Am I missing something? I've done these things:

- created a token called 'Lib:Utility'

- 'Lib:Utility' has an 'onCampaignLoad' macro

- inside this macro, I'm making this call:

Code: Select all

[r: defineFunction("RollDice", "RollDice@Lib:Utility")]
- There's a 'RollDice' macro also on 'Lib:Utility'

But, when I click 'onCampaignLoad' , i get this error:
   
Error in body of roll.       
Statement options (if any): r       
Statement Body : defineFunction("RollDice", "RollDice@Lib:Utility")
I must be missing something obvious, but when I compare this campaign file to another prior one, I don't see any difference in setup, aside of course, from the token & macro names.

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

Re: a Lib token and onCampaignLoad

Post by aliasmask »

Without the full code, I can't really say what the problem is. Perhaps it errors if there is another token with "RollDice" already defined? But I was thinking that wouldn't error, only overwrite the other function. You can also check the log.txt file that may give more information.

You may want to check out my starter pack tokens: http://forums.rptools.net/viewtopic.php ... 31#p255459

Read the notes on the token and the comments in macros. You'll never have to define a function ever again. And if you're not using RPEdit, then you're missing out.

edit: I just thought of something. Is "RollDice" a macro on that token? Also, Allow Player to Edit must be unchecked on onCampaignLoad macro.

ziltmilt
Dragon
Posts: 331
Joined: Sun Apr 29, 2007 9:28 pm
Contact:

Re: a Lib token and onCampaignLoad

Post by ziltmilt »

aliasmask wrote: Allow Player to Edit must be unchecked on onCampaignLoad macro.

Aliasmask, you da man! I knew there was something I was missing. You just saved my scalp a severe hair-pulling-out session.

Post Reply

Return to “Macros”