Can token properties be deleted?
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: Can token properties be deleted?
And I'll leave the discussion at that (wolph if you wish to reply, feel free to do so in a personal message). Sorry for hijacking the thread.
Re: Can token properties be deleted?
completely missed this post. Good point. Discussion continues here:MandyRae wrote:And I'll leave the discussion at that (wolph if you wish to reply, feel free to do so in a personal message). Sorry for hijacking the thread.
http://forums.rptools.net/viewtopic.php ... 10#p262510
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 token properties be deleted?
It nearly caused me headaches, but I managed to understand almost everything and successfully made my own Show Handout macro (not because I had anything against using the Bag of Tricks, but as said before, I wanted to understand).
Now there are a couple little things in particular I didn't understand, in regard to macroLink().
In the BoT, it was used as:
[h, if(others != ""):broadcast(macroLink("<color='red'>", arg(0), outputList, arg(1), ""), others)]
What I don't get is:
1) "<color='red'>" is where the link text is supposed to be, but what is it for? I don't see anything in red, in the resulting dialog, why isn't it just "";
2) also, there's no link built at all. As an ignorant of these functions, If I didn't see the macro(s) in action and just gave a look at the code, I would have said the macro would send (with the broadcast function) a link to all chosen players, and once they clicked it, they'd get the dialog. Instead, it just makes the dialog appear to them, with no links (which is exactly as i want it, mind you, but)... I don't get what's going on here.
In addition (search didn't return results about this because there are too many results), I wanted to set the default value for the size as the actual width of the chosen image (token, portrait or handout), because an arbitrary value wouldn't let me know the actual size of a handout and thus if it'll show too big and pixellated.
But how can I get the properties of a token image/portrait/handout?
Now there are a couple little things in particular I didn't understand, in regard to macroLink().
In the BoT, it was used as:
[h, if(others != ""):broadcast(macroLink("<color='red'>", arg(0), outputList, arg(1), ""), others)]
What I don't get is:
1) "<color='red'>" is where the link text is supposed to be, but what is it for? I don't see anything in red, in the resulting dialog, why isn't it just "";
2) also, there's no link built at all. As an ignorant of these functions, If I didn't see the macro(s) in action and just gave a look at the code, I would have said the macro would send (with the broadcast function) a link to all chosen players, and once they clicked it, they'd get the dialog. Instead, it just makes the dialog appear to them, with no links (which is exactly as i want it, mind you, but)... I don't get what's going on here.
In addition (search didn't return results about this because there are too many results), I wanted to set the default value for the size as the actual width of the chosen image (token, portrait or handout), because an arbitrary value wouldn't let me know the actual size of a handout and thus if it'll show too big and pixellated.
But how can I get the properties of a token image/portrait/handout?
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
Re: Can token properties be deleted?
1 i think its relic code that redundant.
2. That the idea of this construct, broadcasting macrolink results in an auto exec.
3. I have too look that up, but it's possible
2. That the idea of this construct, broadcasting macrolink results in an auto exec.
3. I have too look that up, but it's possible
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 token properties be deleted?
This is normal behavior. You can broadcast without a link. It does put real tiny dot inline with the text though. To prevent the macro from being auto-executed you have to uncheck autoexecute for that macro. Broadcasting to yourself never autoexecutes, but it does to other clients.Irrlicht wrote:2) also, there's no link built at all. As an ignorant of these functions, If I didn't see the macro(s) in action and just gave a look at the code, I would have said the macro would send (with the broadcast function) a link to all chosen players, and once they clicked it, they'd get the dialog. Instead, it just makes the dialog appear to them, with no links (which is exactly as i want it, mind you, but)... I don't get what's going on here.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Can token properties be deleted?
Alright, got it.
Any news about retrieving a picture's original size?
Any news about retrieving a picture's original size?
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
Re: Can token properties be deleted?
"Wooooolph...!" *Calling for help from afar.*wolph42 wrote:3. I have too look that up, but it's possible
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
Re: Can token properties be deleted?
ah yes forgot about that, just add -size to the asset id. E.g.:Irrlicht wrote:"Wooooolph...!" *Calling for help from afar.*wolph42 wrote:3. I have too look that up, but it's possible
[id = "asset://62b8f7b9187225c904af6a716a356da3-30"]
<img src='[r:id]'></img>
for a 30px size picture.
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 token properties be deleted?
Uhm, but isn't that just as "getTokenImage(30)"? How does that give the value of the picture's original size? When you retrieve an asset without specifying size it has no size attribute that could be extrapolated.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
Re: Can token properties be deleted?
yes thats the same. To extrapolate its size you use:Irrlicht wrote:Uhm, but isn't that just as "getTokenImage(30)"? How does that give the value of the picture's original size? When you retrieve an asset without specifying size it has no size attribute that could be extrapolated.
Wiki: getTokenHeight()
Wiki: getTokenWidth()
I don't think that you can use this function for e.g. thus a table image, only Tokens, but there's an easy way to get around that should that be an issue.
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 token properties be deleted?
I'm unable to get the true size of the handout through those.
I tried swapping token's image and handout temporarily to get the size, but it only returns the token's width/height, which is the same no matter what its image is, and it looks like setSize() can't be used to temporarily set to free size to get the true w/h.
I tried swapping token's image and handout temporarily to get the size, but it only returns the token's width/height, which is the same no matter what its image is, and it looks like setSize() can't be used to temporarily set to free size to get the true w/h.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
Re: Can token properties be deleted?
Hmm now I recall. You're right, MT does not support that. It shouldn't be too hard to implement, but you'll have to request it as a feature
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 token properties be deleted?
On my way, thanks.
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
Re: Can token properties be deleted?
I didn't want to open a further thread for such a little thing, when this had already become sort of a multi-topic thread...
Well, I thought the switch roll option was faster than using many ifs, since it had to check for a single match while each if had to be checked separately. To test it (since I don't have valid testing tools), I made a macro with a roll and 400 ifs. It took about half a second to run.
Then I made a switch with 400 cases. After a minute of computing, I had to terminate MapTool and the fan of my pc is still spinning so much it could cool nuclear reactors.
So, does that happen only if the cases are too many, and switch is otherwise faster if there's only a handful of cases, or are ifs always better (and thus, why would I ever want to use switch?)?
Well, I thought the switch roll option was faster than using many ifs, since it had to check for a single match while each if had to be checked separately. To test it (since I don't have valid testing tools), I made a macro with a roll and 400 ifs. It took about half a second to run.
Then I made a switch with 400 cases. After a minute of computing, I had to terminate MapTool and the fan of my pc is still spinning so much it could cool nuclear reactors.
So, does that happen only if the cases are too many, and switch is otherwise faster if there's only a handful of cases, or are ifs always better (and thus, why would I ever want to use switch?)?
"There are many ways my Son, to find where the souls of Demons remain...
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
But it takes only one second of despair and of doubt until, at last, your Soul they will gain..."
Re: Can token properties be deleted?
Couple of things
- Read the speed up macros article in my signature
- Note that I have a benchmark macro created exactly for tuner kinds of tests, it's in the BoT. Basically you put two (or more) macros to compare in a special group on lib:eventmacros, hit the 'benchmark' button and read the timing results
- I think you made a mistake somewhere as switch is significantly faster than if irc even with a single case, however having 400 cases that the MT parser has to parse in one go, could be something it doesn't like and choke on it.
_am also wrote something on the next page
- Read the speed up macros article in my signature
- Note that I have a benchmark macro created exactly for tuner kinds of tests, it's in the BoT. Basically you put two (or more) macros to compare in a special group on lib:eventmacros, hit the 'benchmark' button and read the timing results
- I think you made a mistake somewhere as switch is significantly faster than if irc even with a single case, however having 400 cases that the MT parser has to parse in one go, could be something it doesn't like and choke on it.
_am also wrote something on the next page
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