Silly Question

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
qcgreywolf
Cave Troll
Posts: 43
Joined: Mon Dec 09, 2013 10:23 pm

Silly Question

Post by qcgreywolf »

Brushing the dust off my MT skills after doing zero coding in a couple of years.

I have a Summon Token macro that pulls pre-generated summon monster and summon natures ally tokens from a map. The macro worked 2-3 years ago (the last time I played DnD).

I am getting a:
Spoiler
Argument number 4 to function "copyToken" must be a JSON Object.
When running the following macro code.

Code: Select all

[h: x = 0]
[h: updates = "{ 
    x: '[r: x = x + 2]',
    delta: 1,
}" ]

[h, if(miscToSummon == "None"),CODE:
{};{
	[h: copyToken(miscToSummon, numberToSummon, "Summons", updates)]
}]
Am I missing something obvious here?

User avatar
bubblobill
Giant
Posts: 167
Joined: Sun Jan 24, 2010 3:07 pm

Re: Silly Question

Post by bubblobill »

try

Code: Select all

[h: updates = json.set('', "x", x+2, "delta",1)]
Bubblobill on the forum.
@Reverend on the MapTool Discord Server

Responsible for less atrocities than most... I do accept responsibility for these though: SmartDoors, Simple d20 Framework - barebones, Drop-in: All 3.5 SRD Monsters, Drop in: Simple Character Editor, Battletech Framework

qcgreywolf
Cave Troll
Posts: 43
Joined: Mon Dec 09, 2013 10:23 pm

Re: Silly Question

Post by qcgreywolf »

That did the trick, thanks. I've managed to avoid JSON objects for 7 years or so and was hoping to continue doing so :)

Post Reply

Return to “Macros”