macros suddenly broken, only gives 1 as result.
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
macros suddenly broken, only gives 1 as result.
testing out an unlikely condition for my token, I started pressing a macro really fast, now for some reason the results only come out with 1 for certain macros, even after restarting maptools. how do i fix this?
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: macros suddenly broken, only gives 1 as result.
Maybe we could help if we knew the macro in question. This does not sound like a common problem.
Re: macros suddenly broken, only gives 1 as result.
the macro shouldnt really matter, I never changed it, I just clicked it a lot and it stopped working.CoveredInFish wrote:Maybe we could help if we knew the macro in question. This does not sound like a common problem.
Nevermind, I figured out the problem, although not the cause. repeated clicking seems to have caused a variable called d20roll to revert back to 1d20, although the roll was still present. I guess the lesson here is maptools can't handle 10s of clicks per second.
Last edited by femanon on Mon Oct 01, 2012 11:57 am, edited 1 time in total.
Re: macros suddenly broken, only gives 1 as result.
I don't recall ever seeing a similar problem report. There's not much help we can offer without more information, though. For instance:
a) what is the code for the macro you clicked
b) when you say it just results in 1, is that just that macro, or other unrelated macros that also now result in 1?
c) does the macro edit any token properties? If so, did a critical token property get set to be 1?
a) what is the code for the macro you clicked
b) when you say it just results in 1, is that just that macro, or other unrelated macros that also now result in 1?
c) does the macro edit any token properties? If so, did a critical token property get set to be 1?
Re: macros suddenly broken, only gives 1 as result.
I honestly have no idea why the roll results in a 1, undefined variables usually get their numbers asked for.Rumble wrote:I don't recall ever seeing a similar problem report. There's not much help we can offer without more information, though. For instance:
a) what is the code for the macro you clicked
c) does the macro edit any token properties? If so, did a critical token property get set to be 1?
[T: 1d20roll+variables+morevariables+Evenmorevariables]
is basically what the roll is. which always results in 1
[T: d20roll+variables+etc..
was how it looked before rapid clicking changed it.
Re: macros suddenly broken, only gives 1 as result.
Okay, I think I wasn't clear - what is the actual code of the macro? Is the macro itself rewritten? If so, what was is supposed to be vs. what did it turn into? There are functions to write macros, but if none of them are being used, then you have discovered a unique bug (probably due to a race condition caused by clicking the button really fast).
Absent the actual code, the only thing I can think of is that your "1d20+foo+bar+baz" is being condensed and losing its "+" symbols, before it is evaluated. See, if you have this code:
but for whatever reason, the plus signs are stripped out and you get
that will always evaluate to 1 (or whatever the first number is) - the characters after the number are ignored. If that's what's happening (and it probably is) then we will need to see the actual code to figure out where the "+" signs are being dropped (or, alternatively, you can track it down).
Absent the actual code, the only thing I can think of is that your "1d20+foo+bar+baz" is being condensed and losing its "+" symbols, before it is evaluated. See, if you have this code:
Code: Select all
[t:1d20+x+y+z]
Code: Select all
[t:1d20xyz]
Re: macros suddenly broken, only gives 1 as result.
I dont see what I'm misunderstanding, Thats the macro I used, yes there are other bits and pieces in the macro, no none of them are needed to repeat the bug. There's no way for me to know for sure whats being stripped out, but the mouse over T: for the failed calculation does still show every + sign where it should beRumble wrote:Okay, I think I wasn't clear - what is the actual code of the macro? Is the macro itself rewritten? If so, what was is supposed to be vs. what did it turn into? There are functions to write macros, but if none of them are being used, then you have discovered a unique bug (probably due to a race condition caused by clicking the button really fast).
Absent the actual code, the only thing I can think of is that your "1d20+foo+bar+baz" is being condensed and losing its "+" symbols, before it is evaluated. See, if you have this code:
but for whatever reason, the plus signs are stripped out and you getCode: Select all
[t:1d20+x+y+z]
that will always evaluate to 1 (or whatever the first number is) - the characters after the number are ignored. If that's what's happening (and it probably is) then we will need to see the actual code to figure out where the "+" signs are being dropped (or, alternatively, you can track it down).Code: Select all
[t:1d20xyz]
[h: vari4 = 1]
[h: vari3 = 5]
[h: vari2 = 4]
[h: vari1 = 2]
[h: d20roll = 1d20]
[T: d20roll+vari1+vari2+vari3+vari4]
[T: 1d20roll+vari1+vari2+vari3+vari4]
this will reproduce the error message, but the ACTUAL problem is that clicking on a macro too fast seemed to change it's contents for whatever unknown reason, and that kind of digging around is beyond my skill level.
Re: macros suddenly broken, only gives 1 as result.
just to be clear:
if you start maptools b87 in java 6. You do NOT load a campaign file but simple paste in the campaign panel in a new macro.
Then when you click the macro repeatedly the content changes??
Is this what you tested? If not can you confirm it?
edit: never mind, you made a typo:
1d20roll+vari1+vari2+vari3+vari4
will always result in 1. If you change it into:
d20roll+vari1+vari2+vari3+vari4
its fixed.
if you start maptools b87 in java 6. You do NOT load a campaign file but simple paste
this code
Code: Select all
[h: vari4 = 1]
[h: vari3 = 5]
[h: vari2 = 4]
[h: vari1 = 2]
[h: d20roll = 1d20]
[T: d20roll+vari1+vari2+vari3+vari4]
[T: 1d20roll+vari1+vari2+vari3+vari4]
Then when you click the macro repeatedly the content changes??
Is this what you tested? If not can you confirm it?
edit: never mind, you made a typo:
1d20roll+vari1+vari2+vari3+vari4
will always result in 1. If you change it into:
d20roll+vari1+vari2+vari3+vari4
its fixed.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: macros suddenly broken, only gives 1 as result.
....wolph42 wrote:just to be clear:
if you start maptools b87 in java 6. You do NOT load a campaign file but simple pastein the campaign panel in a new macro.this code
Code: Select all
[h: vari4 = 1] [h: vari3 = 5] [h: vari2 = 4] [h: vari1 = 2] [h: d20roll = 1d20] [T: d20roll+vari1+vari2+vari3+vari4] [T: 1d20roll+vari1+vari2+vari3+vari4]
Then when you click the macro repeatedly the content changes??
Is this what you tested? If not can you confirm it?
I just told you, Understanding why the contents changed is beyond me, and I already explained that they changed after clicking the macro very very quickly 10+ times a second when I was testing, it changed a total of one time,
opening a new campaign and dumping that in a macro will ONLY as i've ALREADY SAID give you a "1" result.
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: macros suddenly broken, only gives 1 as result.
And this actual problem is what makes us interested. If this is confirmed behavior it would be something that has to be investigated. You've got the attention of some pretty experienced long-time users here.femanon wrote:this will reproduce the error message, but the ACTUAL problem is that clicking on a macro too fast seemed to change it's contents for whatever unknown reason, and that kind of digging around is beyond my skill level.
We ask so picky questions because this is something that surprises us - we can not reproduce it. So we want you to help us understand and reproduce your problem exactly.
Code: Select all
[T: d20roll+vari1+vari2+vari3+vari4]
[T: 1d20roll+vari1+vari2+vari3+vari4]
Other than this (explainable) behaviour I cant produce any error with that macro code. And I so clicked it fast
Re: macros suddenly broken, only gives 1 as result.
well I dont know what to tell you, I clicked it for about 2 minutes when I did it, but I don't know if even doing that will reproduce the result or not for anyone since I have no idea why it changed. all I know is I was clicking my macro and the results started turning up 1 1, 1, 1, 1, 1, 1, 1, over and over suddenly. If you guys want to find and debug it, that's cool I guess, but I don't see how needing to be able to spam a macro at that speed is something I'll ever need to do again.CoveredInFish wrote:And this actual problem is what makes us interested. If this is confirmed behavior it would be something that has to be investigated. You've got the attention of some pretty experienced long-time users here.femanon wrote:this will reproduce the error message, but the ACTUAL problem is that clicking on a macro too fast seemed to change it's contents for whatever unknown reason, and that kind of digging around is beyond my skill level.
We ask so picky questions because this is something that surprises us - we can not reproduce it. So we want you to help us understand and reproduce your problem exactly.
The second line will always be parsed to 1 regardless of your clicking speed. Do you see the leading 1? Since "1d20roll" is no valid variable name nor a valid dice expression the maptool parses stops after the value it can figure out - and thats the 1. The tooltip still shows the complete expression, regardless of what the parser "understood".Code: Select all
[T: d20roll+vari1+vari2+vari3+vari4] [T: 1d20roll+vari1+vari2+vari3+vari4]
Other than this (explainable) behaviour I cant produce any error with that macro code. And I so clicked it fast
- jfrazierjr
- Deity
- Posts: 5176
- Joined: Tue Sep 11, 2007 7:31 pm
Re: macros suddenly broken, only gives 1 as result.
You set a token variable to "x" and now it recalls the value FROM the token when you think it's a "local"(scoped to the macro execution itself) variable?????
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.
Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..
Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..
Re: macros suddenly broken, only gives 1 as result.
I cant even understand what youre trying to ask me.jfrazierjr wrote:You set a token variable to "x" and now it recalls the value FROM the token when you think it's a "local"(scoped to the macro execution itself) variable?????
Re: macros suddenly broken, only gives 1 as result.
"1d20roll" is not a valid variable name. I always get a 1 for the 2nd value. If I change the line to 2d20roll... I always get a 2 result. The parser doesn't understand what you're doing after the 1, so it ignores the rest of the line. The solution is not to do that.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: macros suddenly broken, only gives 1 as result.
You've been ninja'd about 5 posts ago ...aliasmask wrote:"1d20roll" is not a valid variable name. I always get a 1 for the 2nd value. If I change the line to 2d20roll... I always get a 2 result. The parser doesn't understand what you're doing after the 1, so it ignores the rest of the line. The solution is not to do that.
That and I suspect that the OP tries to make clear that that '1' (or 'roll' or that entire line), appeared in the macro after clicking on the macro repeatedly
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS