Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Is it Possible?

1437628856

Edited 1437629031
Is it possible to call an image in a macro using the attributes field on the regular character sheets? I have a generic macro for my monsters. Can i store the URL for the image using this page and then call up the proper image when i have the token selected? Example: I select an orc token and roll using my generic macro for attack and damage, crit damage etc... Can i call up the image for my selected token if i make a generic image sheet for my monsters? Currently i have a generic image for all my monsters that works. Here is the macro:&nbsp; &{template:pf_attack} {{name=@{selected|token_name} }} {{=[Image]( <a href="http://www.clipartreview.com/_gallery/_TN/r_396.jpg)}}{{Attack=?{Attack" rel="nofollow">http://www.clipartreview.com/_gallery/_TN/r_396.jpg)}}{{Attack=?{Attack</a> description?|Swings} }} {{with =?{Monster attack type?|Claw} }} {{for=[[d20 + ?{Attack bonus?|0}]]}}
1437629661
The Aaron
Roll20 Production Team
API Scripter
If you are willing to put the image url as an attribute of the character the token represents, you can do: &{template:pf_attack} {{name=@{selected|token_name} }} {{=[Image]( @{selected|imageattr} )}}{{Attack=?{Attackdescription?|Swings} }} {{with =?{Monster attack type?|Claw} }} {{for=[[d20 + ?{Attack bonus?|0}]]}} Assuming you named your attribute imageattr
So do i have to make a page for each monster or can i have one big page that the macro can refer to? Do i need to put anything on the token itself to make this work? Thanks!
1437666066

Edited 1437667404
Ziechael
Forum Champion
Sheet Author
API Scripter
You could have them all on the one token as long as they had unique attribute names which you could call by amending the highlighted bit of Aaron's code... for example @{selected|goblinpic} would work for showing that one, use @{selected|orcpic} for that one... etc etc In fact if it is a reference sheet you don't even need a token... you could just use @{reference|goblinpic} where reference is the name of the sheet and then you don't need to have a token selected. You could even use drop down queries for extra fun (you'd just have to remember to set the name to the same as the picture you wanted... the name could also be a free text query but since we have drop downs now why not abuse them): &{template:pf_attack} {{name= ?{What?|Goblin|Orc|etc etc } }} {{=[Image]( ?{Which one?|Goblin,@{reference|goblinpic}|Orc,@{reference|orcpic}|etc etc} )}}{{Attack=?{Attackdescription?|Swings} }} {{with =?{Monster attack type?|Claw} }} {{for=[[d20 + ?{Attack bonus?|0}]]}}
So in the macro itself i should have all of the picture names there and just pick one from the list? I'm not a scripter so this is really hard for me.
Brian, you can work it in with a query, giving you a listing of possible images to display at run-time. You can store those actual image URL's in the macro itself (which will be very messy) or you can store those values somewhere in a Journal Sheet.&nbsp; Storing the image in a Journal Sheet means either having a single sheet with all this info in it, or having a sheet for each individual monster. Self-Contained Macro example: &{template:pf_attack} {{name=?{What?|Goblin|Orc|etc etc} }} {{=[Image](?{Which one?|Goblin, [Goblin](<a href="http://GoblinImage.jpg" rel="nofollow">http://GoblinImage.jpg</a>) | Orc, [Orc](<a href="http://OrcImage.jpg" rel="nofollow">http://OrcImage.jpg</a>) | Etc, [Etc](<a href="http://EtcImage.jpg" rel="nofollow">http://EtcImage.jpg</a>) } }} Using a Journal's Attributes to store the image URL. &{template:pf_attack} {{name=?{What?|Goblin|Orc|etc etc} }} {{=[Image](?{Which one?|Goblin, [Goblin](@{JournalName|GoblinImage}) | Orc, [Orc](@{JournalName|OrcImage}) | Etc, [Etc](@{JournalName|EtcImage}) } }} You can also store the URL for the image in the token itself as one of the three Token Bars Using a Journal's Attributes to store the image URL. &{template:pf_attack} {{name=@{selected|token_Name} }} {{=[Image](@{selected|bar1) }}
I like the journal idea! I will have to test this.. Thanks Mark!
Ok i made a character sheet called monster images in the attribute field i have the naming convetion Goblin Image Then in the next field i have the URL for the image. Here is the script i currently have. Everything works but no image is displayed!!!&nbsp;&{template:pf_attack} {{name=?{What?|Goblin|Orc|Bugbear} }} {{=[Image](?{Which one?|Goblin, [Goblin](<a href="https://s3.amazonaws.com/files.d20.io/images/11007029/ozmiSAFLsxJo0pDShKVfjQ/med.jpg)(@{MonsterImages|GoblinImage}" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/11007029/ozmiSAFLsxJo0pDShKVfjQ/med.jpg)(@{MonsterImages|GoblinImage}</a>) | Orc, [Orc](<a href="https://s3.amazonaws.com/files.d20.io/images/11007191/cPVujUooFACES1lh3W8Oxg/med.jpg)(@{MonsterImages|OrcImage}" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/11007191/cPVujUooFACES1lh3W8Oxg/med.jpg)(@{MonsterImages|OrcImage}</a>) | Bugbear, [Bugbear](<a href="https://s3.amazonaws.com/files.d20.io/images/11007257/aiB7W3ILUxAnjGSplYgaPg/med.jpg)(@{MonsterImages|BugbearImage}" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/11007257/aiB7W3ILUxAnjGSplYgaPg/med.jpg)(@{MonsterImages|BugbearImage}</a>) } }} {{Attack=?{Attack description?|Swings} }} {{with =?{Monster attack type?|Claw} }} {{for=[[d20 + ?{Attack bonus?|0}]]}}
I tried using the journal as mark suggested but it didnt work! Also in the above example it says that no character was found!
It looks like you're mixing both methods; It should be either self-contained or using Journal Attributes. There's also a mistake inherited from my example:&nbsp; {{=[Image](?{Which one &nbsp; is redundant when the individual options ALSO include the [Image]( tag.&nbsp; You don't want to use them both. Either entirely self-contained: &{template:pf_attack} {{name=?{What?|Goblin|Orc|Bugbear} }} {{?{Which one?|Goblin, [Goblin](<a href="https://s3.amazonaws.com/files.d20.io/images/11007029/ozmiSAFLsxJo0pDShKVfjQ/med.jpg" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/11007029/ozmiSAFLsxJo0pDShKVfjQ/med.jpg</a>) | Orc, [Orc](<a href="https://s3.amazonaws.com/files.d20.io/images/11007191/cPVujUooFACES1lh3W8Oxg/med.jpg" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/11007191/cPVujUooFACES1lh3W8Oxg/med.jpg</a>) | Bugbear, [Bugbear](<a href="https://s3.amazonaws.com/files.d20.io/images/11007257/aiB7W3ILUxAnjGSplYgaPg/med.jpg" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/11007257/aiB7W3ILUxAnjGSplYgaPg/med.jpg</a>)} }} Or using Attributes: &{template:pf_attack} {{name=?{What?|Goblin|Orc|Bugbear} }} {{?{Which one?|Goblin, [Goblin](@{MonsterImages|GoblinImage}) | Orc, [Orc](@{MonsterImages|OrcImage}) | Bugbear, [Bugbear](@{MonsterImages|BugBearImage})&nbsp; } }}
I got the images to work i'm using the attribute method! Thanks Mark! How do i get rid of this error message?&nbsp;No attribute was found for @{MonsterImages|Goblinattr} I'm also getting a double goblin selection in my drop down list.
That sounds like an issue on your Journal attributes.&nbsp; The example I provided uses @{MonsterImages|GoblinImage},&nbsp;&nbsp; you referenced @{MonsterImages|Goblinattr}
Ok i put it back and i'm still getting the error message! would you join my game and take a look at what i'm doing wrong? This is driving me crazy!
Nevermind i decided to do one big macro because it works!