[Bug 1.3.b89] setSize to native or free using macro
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice, MapTool BugReport Manager
Forum rules
Posts that do not conform to the READ ME FIRST sticky thread are subject to deletion.
Posts that do not conform to the READ ME FIRST sticky thread are subject to deletion.
[Bug 1.3.b89] setSize to native or free using macro
Mentioned here: http://forums.rptools.net/viewtopic.php ... 71#p247763
Wiki: setSize() works fine until you set it to "native" or "free". The action completes, but for some reason setSize doesn't work on that token unless the size is changed manually through the MT menu.
If I were to guess, the default is either null or "" for free size and when setting it with the macro, it sets it to the other type. So when the comparison is made in code it has a type mismatch comparison. Just a guess.
Also, "native" and "free" options are not in the wiki.
Wiki: setSize() works fine until you set it to "native" or "free". The action completes, but for some reason setSize doesn't work on that token unless the size is changed manually through the MT menu.
If I were to guess, the default is either null or "" for free size and when setting it with the macro, it sets it to the other type. So when the comparison is made in code it has a type mismatch comparison. Just a guess.
Also, "native" and "free" options are not in the wiki.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
- jfrazierjr
- Deity
- Posts: 5176
- Joined: Tue Sep 11, 2007 7:31 pm
Re: [Bug 1.2.b89] setSize to native or free using macro
aliasmask wrote:Mentioned here: http://forums.rptools.net/viewtopic.php ... 71#p247763
Wiki: setSize() works fine until you set it to "native" or "free". The action completes, but for some reason setSize doesn't work on that token unless the size is changed manually through the MT menu.
If I were to guess, the default is either null or "" for free size and when setting it with the macro, it sets it to the other type. So when the comparison is made in code it has a type mismatch comparison. Just a guess.
Also, "native" and "free" options are not in the wiki.
AM, would be able to include sample images and macro code for each use case?
I might get a chance to look at it this afternoon.... maybe. ...
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: [Bug 1.2.b89] setSize to native or free using macro
Doesn't take much to reproduce.
- Drop token on to map.
- Impersonate token
- type: [setSize("native")] - image changes to native size
- type: [setSize("Medium")] - error.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: [Bug 1.2.b89] setSize to native or free using macro
@Lee: Do you have any idea if, with the patch, when setSize("native") is used in a macro, it sets the size of the token to the image of the token that is used at the moment or, to the size of the image that was used at the token creation?
What I mean is, if I make a macro to change the token image, then, use setSize("native"), shall the token take the correct size for the new image?
What I mean is, if I make a macro to change the token image, then, use setSize("native"), shall the token take the correct size for the new image?
Re: [Bug 1.2.b89] setSize to native or free using macro
I'm not quite sure what you mean. I haven't really used this function before, but when I was fixing this, using setSize("native") reverts the token image to its actual size (as an image). What setSize does for settings other than native/free is to get the cell or footprint size and draw the image to fit this value.
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in
Re: [Bug 1.2.b89] setSize to native or free using macro
I think I get what Bhoritz is aiming at and its an interesting question:Lee wrote:I'm not quite sure what you mean. I haven't really used this function before, but when I was fixing this, using setSize("native") reverts the token image to its actual size (as an image). What setSize does for settings other than native/free is to get the cell or footprint size and draw the image to fit this value.
say you drop a 300x300px image on the object layer of a 300px grid. That means that it covers one square in 'freesize'. Now 2 scenarios:
1. set it to 'large' (600x600) and then back to native
2. stretch it 600x300 and THEN set it to large and back to native.
In the first case I expect it (from your words) to return to 300x300.
In the second case... does it revert to 300x300 (Native) or 600x300 (Freesize) ?
The thing is, you should actually have 2 'settings'
setSize("Native") which reverts it to 300x300 and
setSize("Freesize") which reverts it to the last freesize (in this case 600x300) OR if it never has been resized in MT it reverts to native size.
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
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: [Bug 1.2.b89] setSize to native or free using macro
Also interesting: does it keep the boundaries of an image if you change the image [edit: as in image file/source].
You have a token with an 100x100 image, set it freesize top 150x100. Now you change - by macro - the image to an 200x200 one. What size will be used when you use setSize(native)? Does it get the current image size or is a cached one used?
You have a token with an 100x100 image, set it freesize top 150x100. Now you change - by macro - the image to an 200x200 one. What size will be used when you use setSize(native)? Does it get the current image size or is a cached one used?
Re: [Bug 1.2.b89] setSize to native or free using macro
how does this question exactly differ from mine?CoveredInFish wrote:Also interesting: does it keep the boundaries of an image if you change the image.
You have a token with an 100x100 image, set it freesize top 150x100. Now you change - by macro - the image to an 200x200 one. What size will be used when you use setSize(native)? Does it get the current image size or is a cached one used?
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
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: [Bug 1.2.b89] setSize to native or free using macro
In your case you don't change the source image, when I did read your post well enough. What might - or might not - be a different case - depending on implementation.
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: [Bug 1.2.b89] setSize to native or free using macro
I think there is some confusion on the difference between "Native" and "Free". I, like Lee, thought of those two options as being the same thing. That is, "Native" being the "native" size of the actual image. It sounds like Wolph (and maybe CiF) look at "Native" as being the size that the token is set to (i.e. medium/large/etc.)Lee wrote:I'm not quite sure what you mean. I haven't really used this function before, but when I was fixing this, using setSize("native") reverts the token image to its actual size (as an image). What setSize does for settings other than native/free is to get the cell or footprint size and draw the image to fit this value.
Is there some reason why Native/FreeSize aren't the same thing? (i.e. the token defaults to the "native" size of the actual image, also the behavior of a token when placed with "freesize", and is not placed into a size category).
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: [Bug 1.2.b89] setSize to native or free using macro
My question is mostly about what is the native size after the token image has been changed.
Imagine that I drop a round token image (100 x 100 px) on a map with 70 px squares . I set it to Medium.
Now I want to use a macro to change the token image by one of the same character on a horse, and that mounted token is 70 x 140 px.
I add in my macro a command setSize("native"), is the new token going to be 70 x 140px (the native size of the new image), 100 x 100 px (the native size of the old image) or 70 x 70 (the medium size that was used before I changed the token image)?
I don't use D&D, and I have much problems using the different sizes coming from those rules (Medium, Small, ...) that doesn't mean anything to me. I prefer to use real life units (pixels and percents), I can better predict what the result of a modification shall look like.
Edit: I also would be interested if there is a difference between native and freesize.
Imagine that I drop a round token image (100 x 100 px) on a map with 70 px squares . I set it to Medium.
Now I want to use a macro to change the token image by one of the same character on a horse, and that mounted token is 70 x 140 px.
I add in my macro a command setSize("native"), is the new token going to be 70 x 140px (the native size of the new image), 100 x 100 px (the native size of the old image) or 70 x 70 (the medium size that was used before I changed the token image)?
I don't use D&D, and I have much problems using the different sizes coming from those rules (Medium, Small, ...) that doesn't mean anything to me. I prefer to use real life units (pixels and percents), I can better predict what the result of a modification shall look like.
Edit: I also would be interested if there is a difference between native and freesize.
Re: [Bug 1.2.b89] setSize to native or free using macro
Native and Free are the same thing, but were named different (for some reason) based on the layer the token is on. Perhaps the change in lingo is because a token on the token layer that is a Native size isn't adjustable while a token on the background layer is.Full Bleed wrote:I think there is some confusion on the difference between "Native" and "Free". I, like Lee, thought of those two options as being the same thing. That is, "Native" being the "native" size of the actual image. It sounds like Wolph (and maybe CiF) look at "Native" as being the size that the token is set to (i.e. medium/large/etc.)Lee wrote:I'm not quite sure what you mean. I haven't really used this function before, but when I was fixing this, using setSize("native") reverts the token image to its actual size (as an image). What setSize does for settings other than native/free is to get the cell or footprint size and draw the image to fit this value.
Is there some reason why Native/FreeSize aren't the same thing? (i.e. the token defaults to the "native" size of the actual image, also the behavior of a token when placed with "freesize", and is not placed into a size category).
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: [Bug 1.2.b89] setSize to native or free using macro
@all Yes. A.M. is correct, native and freesize are the same with regard to this function and, regardless of which layer the token is on, using either will "liberate" the token from the grid.
My stuff for the community:
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in
Donate to the Mote Project
The Mote Project's G+ community
Mote on Facebook
Fully Customizable Calendar Drop-in