I am having trouble getting any math to work in my token properties.
I just want to have the MaxHP to be 10 + Constitution, because Dungeon World but it's not quite doing that...
and this is what I get...
That what item was me testing to see if any math works at all (it doesn't).
What am I doing wrong?
Can't get math to work in properties
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: Can't get math to work in properties
You need to hover over you token and watch the statsheet
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: Can't get math to work in properties
If you want to have your math evaluated you need to surround with {} or preferably [r:].
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Can't get math to work in properties
He did thataliasmask wrote:If you want to have your math evaluated you need to surround with {} or preferably [r:].
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: Can't get math to work in properties
I think I see the misunderstanding afoot here, unless I've misunderstood what you're going for. See, the only thing you'll see in the Properties window is the "formula" you've put for calculating MaxHP, not the final result. It won't replace the formula with the final total - which is good, because if it just plugged in a fixed number, it wouldn't change if you later changed Constitution! Anywhere else in the code where you refer to MaxHP will correctly parse the formula, and use the final total. For instance, if I just typed (with the example token as the current token, such as by impersonating it) [r: MaxHP], it would return "24". Likewise, if MaxHP is set as being visible on the statsheet, it'll display 24, not {Constitution +10}, when you mouse over the token. So you're probably just fine as-is!
That said, I've heard it suggested before that using formulae in properties themselves should be avoided for performance (especially ones that show up on statsheets since those are refreshed every single time the token is moused over). It might be better to just have it set so that any time you perform a function that changes your Constitution, it updates your MaxHP property to Constitution+10. This is just a "best practices" thing though. While I've been trying to be a little more (huge airquotes) "professional" in my own code about this sort of thing, if just having it as a formula in the property isn't afflicting you with any major lag issues, which it probably won't if your framework isn't huge, then you're probably fine.
That said, I've heard it suggested before that using formulae in properties themselves should be avoided for performance (especially ones that show up on statsheets since those are refreshed every single time the token is moused over). It might be better to just have it set so that any time you perform a function that changes your Constitution, it updates your MaxHP property to Constitution+10. This is just a "best practices" thing though. While I've been trying to be a little more (huge airquotes) "professional" in my own code about this sort of thing, if just having it as a formula in the property isn't afflicting you with any major lag issues, which it probably won't if your framework isn't huge, then you're probably fine.
I made a framework for Exalted 2.5E.