Probñem with a macro that used to work perfectly after updating

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
reganark
Kobold
Posts: 4
Joined: Sat Feb 20, 2021 7:37 pm

Probñem with a macro that used to work perfectly after updating

Post by reganark »

Hello. I updated maptools almost a month ago from 1.8.5 to 1.9.3 (mostly because of the webp update and the f key hotkey to turn) and it was the worst idea I could ever have had. I started making tokens (I like to have tokens made in case my players do some shenanigans) and when I tried to use a macro that worked perfectly in 1.8.5, in which it should drop a list of targetable tokens in sight wont show the tokens made in 1.9.3. the macro itself is this;
[h: weapon = EquippedWeapon]
[h: attacker = getName()]
[h: target = selectToken()]

[h: originalLP = getProperty("LPCurrent", target)]
[h: criticalThreshold = originalLP / 2]

[r: attackFunction(weapon, target, attacker, 0)]

[h: DamageTaken = originalLP - getProperty("LPCurrent", target)]
[r: if(DamageTaken > criticalThreshold,
add("<p style='background-color: red;'>Critico!!! ", "</p>"),
"" )]


[h: setState("Acted", 1)]

Im completely sure the macro its fine because I downloaded 1.8.5 again and it works, and it keeps working in 1.9.3 with the tokens made in any version thats not 1.9.3, so I was wondering if there was any way to make it so that they are targeatable (all of the tokens have the exact same setting, the only difference is the version in which they were made) since I dont want to lose all of my job, and the more I use it, the less appealign maptools seems to be, and it makes no sense to update it since they are usually actually downgrades.
I appreciate any help if possible, but im pretty sure that Im going to have to remake every single token.

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: Probñem with a macro that used to work perfectly after updating

Post by wolph42 »

i doubt you have to reccreate every token, its possible that a bug sneaked in or a bug was fixed (and you inadvertantly used an exploit that no longer works) either way it broke your macro. Point in case is that you macro uses other macros so its impossible to say where the issue lies. for example you speak of a drop down list of targetable tokens, but i don't see any code which actually creates a drop down list. It would work better if you shared a campaign file with clear step by step instructions to replicate the issue.

Post Reply

Return to “MapTool”