Printing both the value AND image from a table

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

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

Post Reply
ladyathena59808
Kobold
Posts: 8
Joined: Wed Aug 06, 2014 2:39 am

Printing both the value AND image from a table

Post by ladyathena59808 »

I'm probably just being an idiot but I'm having a tough time figuring out how to print both the value AND the image from the same row from a table.

I can print the image OR I can print the value but I can't get both from the same row. I was able to assign the row's value to a variable but I can't use that variable to tell tableImage() which row to use, so that hasn't been helpful.

This is what I've got right now but it's obviously printing out two separate results, one random value and a totally different random image. Any helpful suggestions would be appreciated. :)

Code: Select all

[h: Card = table("TarotReversed")]

{Card}

<image src='[r: tableImage("TarotReversed", "1d79", 350)]'></image>

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

Re: Printing both the value AND image from a table

Post by aliasmask »

You need to roll the random number first and then retrieve value and image from table using the same index value.

ladyathena59808
Kobold
Posts: 8
Joined: Wed Aug 06, 2014 2:39 am

Re: Printing both the value AND image from a table

Post by ladyathena59808 »

I. Swear. To god. I could not get that to work before, assigning a roll or number to a variable and then using the variable in tableImage() and table(). But now that I've put it out there, it worked. :p

Thanks for your response. :)

Post Reply

Return to “Macros”