Adding more image assets to Token object

If you have an idea for a new feature, please discuss it in the main MapTool forum first, then post a summary of the discussion here. Use the first Sticky as a template.

Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice

Post Reply
chap126
Kobold
Posts: 24
Joined: Wed Jul 31, 2013 9:57 am

Adding more image assets to Token object

Post by chap126 »

It's been mentioned on the forums before, but I can't find any recent discussion.
I've spent some time building isometric token and object assets, and would like to share all the hard work with friends. Unfortunately, currently the best I can do is share a folder of .png files with them. The folder includes all the images labeled something like "ORC_SE" "ORC_SW" "ORC_PORTRAIT". It is unrealistic for me to expect my friends to be willing to go through the effort I already went through and create and build all the tables for the 150 tokens I've made. I could share the token and tables for each one, but that also would be a pain for my friends. They like gaming, but anything more than drag and drop would probably be asking too much.

My feature request is: add 8 new assets to the token object (something like token.isometric_northImage, token.isometric_northeastImage, etc.) so that isometric tokens can be shared and imported as easily as standard tokens are. Following this, it'd be nice to have a simple UI to input these into the token, similar to how inputting a portraitImage works currently, but for each direction. Or it could make a popup that give you a table you can fill in.

What's the pseudocode for how maptool initializes the image asset of the token when it's first created? To me it seems like it wouldn't be that hard to code the directional assets directly onto the token object rather than pointing it to an external table, basically just move the "table" to the token itself (of course it probably wouldn't technically be a "table" anymore if that is done). I love isometric on VTTs. It really blurs the line between virtual tabletop and just tabletop and makes the experience a lot more visually appealing. So hopefully this is a super easy, 10 lines of code type thing! :D :D

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Adding more image assets to Token object

Post by aliasmask »

Which version of MapTool are you using? There is a Table Image entry on the token to select your iso images. I don't know the rules of the table though. I suspect 0 to 7 for the indexes. I've never used that feature before.

chap126
Kobold
Posts: 24
Joined: Wed Jul 31, 2013 9:57 am

Re: Adding more image assets to Token object

Post by chap126 »

aliasmask wrote:Which version of MapTool are you using? There is a Table Image entry on the token to select your iso images. I don't know the rules of the table though. I suspect 0 to 7 for the indexes. I've never used that feature before.
1.4.1.8

The table image simply points the token to a table, which means the images are stored in the assets folder, not in the .rptok. I'm hoping that we can put the directional figures into the .rptok along with the portrait image, and the default image. Or does the .rptok just store the metadata for the image? Either way, it'd be nice to just be able to drop the token into another campaign and have it change image when it's rotated, without the need to recreate/import a table for each token.

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Adding more image assets to Token object

Post by aliasmask »

Yeah, the iso images are campaign specific, not token. I think it was just a dirty fix just to experiment with it rather than being a token-centric feature.

You could have just 1 table with all the images, or a repository with the images then save the image asset ids on the token and have a macro that creates the table for that token. It would be more portable that way.

chap126
Kobold
Posts: 24
Joined: Wed Jul 31, 2013 9:57 am

Re: Adding more image assets to Token object

Post by chap126 »

aliasmask wrote:Yeah, the iso images are campaign specific, not token. I think it was just a dirty fix just to experiment with it rather than being a token-centric feature.

You could have just 1 table with all the images, or a repository with the images then save the image asset ids on the token and have a macro that creates the table for that token. It would be more portable that way.
But isn't the portrait image saved in the rptok? If so, would it be hard to add the ability for the token to save more than just the portrait image? To me it's more intuitive if you have an isometric token, that when you share that .rptok it contains all the necessary information to reproduce the isometric token.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Adding more image assets to Token object

Post by Jagged »

The best way to share the would be via a campaign. That way you can have the Figure Tokens and the Image Tables.

You could dynamically create the tables if you wanted. Not tried it myself though. The index values for the table are the facing angle for the image.

Table Ranges for 4 Directions:

Code: Select all

Range= -180 - -91  Value=SW
Range=  -90 -   0  Value=SE
Range=    1 -  90  Value=NE
Range=   91 - 180  Value=NW
Table Ranges for 8 Directions:

Code: Select all

Range= -180 - -158  Value=W
Range= -157 - -113  Value=SW
Range= -112 -  -69  Value=S
Range=  -68 -  -23  Value=SE
Range=  -22 -   22  Value=E
Range=   23 -   68  Value=NE
Range=   69 -  112  Value=N
Range=  113 -  157  Value=NW
Range=  158 -  180  Value=W
You will notice that with this table, "West" had to be split, and appears twice.

chap126
Kobold
Posts: 24
Joined: Wed Jul 31, 2013 9:57 am

Re: Adding more image assets to Token object

Post by chap126 »

Jagged wrote:The best way to share the would be via a campaign. That way you can have the Figure Tokens and the Image Tables.

You could dynamically create the tables if you wanted. Not tried it myself though. The index values for the table are the facing angle for the image.
Yeah I know...but what about when they want to input the tokens into their own campaign, or move them from one campaign to another? It just seems like if you have a lot of isometric tokens it's going to be a fairly large amount of work unless you only work from a single campaign file.

Does anyone know how token images work? If I could understand the code better, I might be able to futz about with it to try and get what I want. Basically I need to understand how does the token know when it is placed at x,y,z what image should be there, where is that image stored, is there a facing direction when a token is first placed or is that only set after it's first rotated, etc. Is all the necessary code in the token class or would it need to be modified in multiple places?

User avatar
aliasmask
RPTools Team
Posts: 9024
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: Adding more image assets to Token object

Post by aliasmask »

chap126 wrote:But isn't the portrait image saved in the rptok? If so, would it be hard to add the ability for the token to save more than just the portrait image? To me it's more intuitive if you have an isometric token, that when you share that .rptok it contains all the necessary information to reproduce the isometric token.
Ideally true, but I'm talking about a solution you can employ now. Development releases are few and far between.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: Adding more image assets to Token object

Post by Jagged »

I did consider encapsulating the images into the saved token but there are pros and cons.

It's obviously great for players, but not necessarily beneficial for monsters.

Then there was the fact that the feature was considered "beta".

On top of that, token structure is going to change in the near future so I would not consider changing how this is stored until then.

bobifle
Giant
Posts: 219
Joined: Thu Oct 19, 2017 12:36 pm

Re: Adding more image assets to Token object

Post by bobifle »

It's obviously great for players, but not necessarily beneficial for monsters
It would be also great for lib tokens.

Post Reply

Return to “Feature Requests”