[Bug 1.3.b89] setSize to native or free using macro

Confirmed bugs should get a single post here. Check the READ ME FIRST sticky thread for the format.

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.
Post Reply
User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

[Bug 1.3.b89] setSize to native or free using macro

Post by aliasmask »

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.

User avatar
jfrazierjr
Deity
Posts: 5176
Joined: Tue Sep 11, 2007 7:31 pm

Re: [Bug 1.2.b89] setSize to native or free using macro

Post by jfrazierjr »

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..

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: [Bug 1.2.b89] setSize to native or free using macro

Post by aliasmask »

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.
Before setting the size to "native" you can setSize to any other valid size with no problem until you set the size to "native" or "free". Then setting the size to any valid size causes an error. If you manually set the size in the MT menu to another valid size, setSize() macro starts to work again.


User avatar
Bhoritz
Giant
Posts: 130
Joined: Wed Jul 21, 2010 10:31 am
Contact:

Re: [Bug 1.2.b89] setSize to native or free using macro

Post by Bhoritz »

@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?

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: [Bug 1.2.b89] setSize to native or free using macro

Post by Lee »

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.

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

Re: [Bug 1.2.b89] setSize to native or free using macro

Post by wolph42 »

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.
I think I get what Bhoritz is aiming at and its an interesting question:

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.

User avatar
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

Post by CoveredInFish »

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?

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

Re: [Bug 1.2.b89] setSize to native or free using macro

Post by wolph42 »

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?
how does this question exactly differ from mine?

User avatar
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

Post by CoveredInFish »

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.

User avatar
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

Post by Full Bleed »

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.
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.)

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."

User avatar
Bhoritz
Giant
Posts: 130
Joined: Wed Jul 21, 2010 10:31 am
Contact:

Re: [Bug 1.2.b89] setSize to native or free using macro

Post by Bhoritz »

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.

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: [Bug 1.2.b89] setSize to native or free using macro

Post by aliasmask »

Full Bleed wrote:
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.
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.)

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).
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.

Lee
Dragon
Posts: 958
Joined: Wed Oct 19, 2011 2:07 am

Re: [Bug 1.2.b89] setSize to native or free using macro

Post by Lee »

@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.

Post Reply

Return to “Bug Reports”