PDA

View Full Version : Drag from character portrait to 50x50 scale token



Tokuriku
September 7th, 2007, 15:37
When you drag a token from the character portrait, you get a 30x30 token.
You can place it on the map and do all sorts of nifty stuff with it.
I personnaly use a 50x50 grid most of the time.
This is where I chose my balance between detail and showing lots of map space.

My prblem is that the 30X30 token has to be resized to be in sink whit the monster tokens I use.
The best way to do it is in the combat tracker and this part is ok.
The thing is, it makes for less clear pictures because of the number of pixels for detail.
At the moment, I have made tokens for the players at 50x50 and when I put the players in the combat tracker, I just place that token in place of the default one. From that point, I can use them without resizing or degradation in detail.

Is there a way to forgo this step?
Is there a piece of code to put a 50x50 token in place of the 30x30 ones?

p.s, I know this:
-- For small portraits use _miniportrait and you are all set. These are 16x16.
-- For more medium use _token. These are 30x30.
-- The _charlist ones I believe are 72x72 including the frame.

joshuha
September 7th, 2007, 16:38
In the characterlist_entry.lua in the /scripts folder you should see this code:


function onDrag(button, x, y, draginfo)
if User.isHost() or User.isOwnedIdentity(identityname) then
draginfo.setType("playercharacter");
draginfo.setTokenData("portrait_" .. identityname .. "_token");
draginfo.setDatabaseNode("charsheet." .. identityname);
draginfo.setStringData(identityname);

local base = draginfo.createBaseData();
base.setType("token");
base.setTokenData("portrait_" .. identityname .. "_token");

return true;
end
end


The setTokenData does indeed scale it to the _token potrait size which is 30x30. I believe if you change the size of the icon portait_token.png in the /icons folder that it will scale it to the new size. I would need to test to make sure though.

Tokuriku
September 12th, 2007, 11:18
And it works!

I just resized the token and its mask (from the portrait version to cut down on distorsion scaling down not up).
It's perfect!
Now I don't have to justle with map resizing or combat tracker resizing or taking stuff from hand made tokens to put them in the combat tracker and them put them on the map.

Thanks a ton, it was so easy but if you hadn't pointed that to me, I would have looked trough lots of code and probably would not even have found it!

DNH
January 12th, 2008, 13:04
Following a request from one of my players, I would like to know if it is possible at all to size player tokens based on character race. So humans would be the default size, dwarves/gnomes would be smaller, half-orcs (not that they exist in my campaign) would be larger. I imagine this could be achieved by seeking out the portrait's character db's race element and then calling a separate setTokenData function. Or else defining separate portrait_token.png files (eg portrait_s_token.png).

Any thoughts?

(I realise I can scale the tokens using the combat tracker, which is what I am doing now, but I would like a default action, if possible).

cbradshaw007
June 23rd, 2008, 20:27
And it works!

I just resized the token and its mask (from the portrait version to cut down on distorsion scaling down not up).
It's perfect!


What did you set the token and mask to? I have set the token to 50x50 but I am unsure what to chenge the mask to. I have for the time being set it to 46x46 since most of the other masks were 4 px smaller.

Bidmaron
October 11th, 2008, 14:55
bump
Also, I'm trying to understand Kenshin's original issue. Is the problem that when you drag a 30x30 combat tracker token to the map and upscale to 50x50 that it gets pixelation in the upscaling?
To avoid that, I suppose you have to place the full size token in the token box and drag from there.
I have the same question about the 4 px inset, but the other question is how do the larger 50x50 tokens look on the combat tracker? What would the upper limit there be?

Griogre
October 11th, 2008, 20:20
Kenshin's original issue was he had 50 pixel square monsters tokens and 30 pixel square PC tokens. Because his monsters were so much bigger than the PC tokens he always wanted to scale the tokens up of the players.

He was using the combat tracker to scale up the PC tokens. The problem with scaling up any art is it tends to look like crap. He wanted a solution so he didn't have to scale up the tokens (so they would look better). Instead he scaled down the larger portraits that go into the top left of the FG desktop from 63 pixels squares to 50 pixel squares instead of 30 pixel squares to 50 pixels squares.