No image in table error.

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

No image in table error.

Post by Full Bleed »

When attempting to pull an image from a table entry that has no image I'm getting this error:

Code: Select all

No Image available in function "tblImage" for table "Table Name".
Do I have to insert images into every table row to avoid this?

Since I'm pulling item data from a table that doesn't have an image for every item I'd rather see an X, or a question mark, or nothing at all when there is no available image.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

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

Re: No image in table error.

Post by aliasmask »

You can store which indexes have/don't have images in them and check that first. I would store that info in index 0 of table.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: No image in table error.

Post by Full Bleed »

aliasmask wrote:You can store which indexes have/don't have images in them and check that first. I would store that info in index 0 of table.
Yeah... some of my tables are quite large though and adding the 0 index after the table is already built stick it down at the end of the table... so I guess I can create a macro to make a temp table to add them in order... delete current table and then rename the temp back to the original...

The items are a string list with 50 fields... so I could add another field for whether or not it has an image, but I was hoping there was some less clunky way to do it.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

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

Re: No image in table error.

Post by aliasmask »

It doesn't matter where index 0 is in the table (I think), but you can rewrite the table with macros now without having to do it manually. You just have to do each table index first before rewriting it so you know what gets copied over. So, if you have a table with 50 entries and 10 have not images just put those indexes in an array first then have the macro do all the heavy lifting.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: No image in table error.

Post by Full Bleed »

aliasmask wrote:It doesn't matter where index 0 is in the table (I think)
It doesn't... I just don't like the way it looks when I add things and they're visually out of order. I often leave blanks to try and keep things grouped accordingly... but that doesn't always hold up... so making a table re-sort macro won't be a total waste of time.

I was just hoping that there was some simple trick to code in an "if table item doesn't have an image then use no image or use this image". I guess there isn't.

I think I'll just end up adding some generic <4k image to every entry.
but you can rewrite the table with macros now without having to do it manually
The newer table macros have made using tables as a database (instead of tokens as I have in the past) something I really rely on these days. I just wish there wasn't some of these little issues to work around.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: No image in table error.

Post by Full Bleed »

Full Bleed wrote:I think I'll just end up adding some generic <4k image to every entry.
Well... that didn't work.

You can't add an image to a table with a macro using setTableEntry. There is no image parameter. So I tried using addTableEntry and I ended up with double of all of my entries. That seems like a bug.

And you can't pull an image asset from another table using tableImage either... it produces a question mark.

So there doesn't appear to be a way to mass add an image asset to table entries.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

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

Re: No image in table error.

Post by aliasmask »

It does work, but I think there was a non-intuitive reason for it not working. It's on another thread, I'll do a search.

edit: Yeah, here it is: http://forums.rptools.net/viewtopic.php ... 52#p265691

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: No image in table error.

Post by Full Bleed »

aliasmask wrote:edit: Yeah, here it is: http://forums.rptools.net/viewtopic.php ... 52#p265691
Thanks. I'd gotten everything to work but the asset retrieval.

But it seems like there are two bugs to work around though:

1) addTableEntry doesn't overwrite an entry. Fix: Delete entry and then add.
2) The image ID parameter adds the redundant "asset://" prefix. Fix: substring out the prefix.

EDIT: #2 above will BREAK macros when the bug is fixed.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Post Reply

Return to “MapTool”