Under what conditions, if ever, does the src ID of an image asset change?
For the sake of speed, it would be better to have an OnCampaignLoad register the image assets of some images that are frequently used in HTML macros for easy retrieval without having to make frequent use of the tableImage() function.
But if src IDs change during gameplay and make storing them in a library token unsuitable, I would like to know that.
Asset Image Src Changes
Moderators: dorpond, trevor, Azhrei, giliath, jay, Mr.Ice
Re: Asset Image Src Changes
No clue. Never tested that. I know that tok id changes with copy paste and sometimes with cut and paste, but I would imagine that image id would always stay the same...
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: Asset Image Src Changes
As far as I know they don't change because they're based on the file size and crc(?). The problem with storing just the asset id and not the token is the other clients will have nothing to download to see the same image. If you want a library of images I suggest either putting them on their own map or in a file repository and then store the ids. You can also put them in to a table. But like wolph42 I've never actually tested this to make sure it works and it difficult to do without a 2nd computer handy. But I'm pretty sure I'm at least 90% right.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Asset Image Src Changes
Right now I do have them in a table, it's just a lot of images to grab, and I wasn't sure if tableImage is the fastest way to go.
If you have to grab a lot of images...let's say around 20 each time a certain macro is run (and is run very frequently)... what is the most efficient way to grab image assets?
If you have to grab a lot of images...let's say around 20 each time a certain macro is run (and is run very frequently)... what is the most efficient way to grab image assets?
Re: Asset Image Src Changes
my guess:
put them in a table, gather ALL image assets and store them in a strprop variable, where the the vars are the id name you want to use and the corresponding values are the image asset id. Store that strprop on a lib token.
Then when needed, grab that variable from the lib token and use Wiki: varsFromStrProp() its a VERY fast method. Then you have all the assets available as variables in your macro.
put them in a table, gather ALL image assets and store them in a strprop variable, where the the vars are the id name you want to use and the corresponding values are the image asset id. Store that strprop on a lib token.
Then when needed, grab that variable from the lib token and use Wiki: varsFromStrProp() its a VERY fast method. Then you have all the assets available as variables in your macro.
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: Asset Image Src Changes
Would that work for the clients, also? They don't have different asset ids for the table images, right?
Re: Asset Image Src Changes
although its easy to test, I would 'guess' not.Tanthos wrote:Would that work for the clients, also? They don't have different asset ids for the table images, right?
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: Asset Image Src Changes
Asset ids are stable and you can store them how you like as they will never* change assets are immutable and need to have same id across clients. Just be aware any asset you store the id for must also be in the campaign file some where, in a table, on a map as a token etc... If you do not do this when a client attempts to fetch it then it wont be able to find it. You could possibly get away with just having it a shared repository or getting players to add it to their maptool directory but I am not sure this will always work.Tanthos wrote:Would that work for the clients, also? They don't have different asset ids for the table images, right?
One caveat, in a future version the way asset ids are calculated may change, but if they do there will be plenty of warning and details on how to convert campaigns if required.