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

Attaching information to tokens

1445824273
Jeff M.
Plus
Marketplace Creator
Can anyone think of any way I could attach information to tokens on the table so my players can view it? There are a few different applicaation I can think of for this, but personally I want to include lists of inventory on merchant tokens in a marketplace. Am I missing some sort of option for adding player visible notes to tokens? Is there maybe some kind of maco I could use to dispaly the info on demand?
You could put that information into one of the bars in the token and send that info to them or allow them to target the bar with a macro.  Say you made the bar3 max field the inventory of the token, you would use /em You find the following: /em @{target|bar3|max} I have used this type of thing for my traps and doors so I can store different DC's and trap info per token. I even set up a whole village with stores and dialog all stored in the token bars that the players could target to talk to and buy stuff from. 
1445867679
Jeff M.
Plus
Marketplace Creator
That sounds perfect. I just assumed those bars wouldn't hold enough information. I offer my thanks with this picture of a fuffy white kitten.
1445869133
Ziechael
Forum Champion
Sheet Author
API Scripter
The key is to write your content in another programme or a hand out or something and copy/paste the information into the bar from there rather than try and type it all in with the limited view that the bar value boxes would give you :)
1445869768
Jeff M.
Plus
Marketplace Creator
Well I usually lay it out in a spreadsheet frist anyways. That way I can have all the weights and prices and stuff and there neatly, and generate random numbers from what is actually in stock.
If you need the output formatted then you can enter in a roll template in the bubble, otherwise it just spits it all out in one line. In the town I used bar 3 for the merchant inventory. I used this for my Jewelry Merchant {{title=Flitterbloomer Brothers Gems, Jewelry, and Art Objects, est 1388 DR}} {{subheader2= @{target|Merchant?|token_name} }} {{emote=Your business is my pleasure!}} {{Each=**GEMS**}}{{10 gp:= [[[[2d6cs>13cf<1]]+[[0d0+4]]]] *[[1t[Gem-10gp]]]*}} {{50 gp:= [[[[2d4cs>9cf<1]]+[[0d0+2]]]] *[[1t[Gem-50gp]]]*}} {{100gp:=[[(1d9cs>10cf<0)+2]] *[[1t[Gem-100gp]]]*}} {{500 gp:=[[(2d5cs>11cf<0)-2]] *[[1t[Gem-500gp]]]*}} {{1000 gp:=[[(1d5cs>6cf<0)-1]] *[[1t[Gem-1000gp]]]*}} {{5000 gp:=[[(1d3cs>4cf<0)-1]] *[[1t[Gem-5000gp]]]*}} Something a little more simple is my baker {{title=Kyne's Bakery}} {{subheader2= @{target|Merchant?|token_name} }} {{emote=Hot and fresh for ya?}} {{3 cp=***Bread loaf***}} {{5 cp=***Pastries***}} {{6 cp=***Lemon Cakes***}} {{1 cp=***Biscuit***}} and my macro that my players use is the following /w gm &{template:5eDefault} {{ability=1}} {{title=@{target|Merchant?|token_name}'s Wares}}{{subheader=@{selected|character_name}}} {{subheaderright=Buying}} {{[[[[@{selected|money_total_gp}]]]]= **GP** to spend}} {{Cost= ***Goods***}} @{target|Merchant?|bar3} @{selected|classactioncustom1skill} so it put it together to come out looking like this I use a rollable table for the gems types. It's based on the treasure table from the DMG. The baker's output is a bit more simple Something to keep in mind is that with roll templates you cannot have two field names the same. So say the lemon cakes and pastries were both 5cp, then the second line will overwrite the first line. The way to avoid that is to add extra spaces in the name 5 cp = and 5 cp= are different as far as the program is concerned. Thank you for the kitten and happy gaming.  
1445899431

Edited 1445903207
Jeff M.
Plus
Marketplace Creator
I feel like I'm missing something fundamental about the way macros are written. In those codes, what does the "Merchant?" refer to, another marco? EDIT: I think I see where I'm actually getting held up. I just noticed that your scripts there are for 5th ed. I'm using pathfinder. I have to figure out which parts are 5th ed and switch them out somehow. EDIT AGAIN: No, I'm a dumbass. Its throw a hissy-fit because I was trying to use the macro as a GM without a token seleceted and with a character attached to the token.
1445915740

Edited 1445915807
The important thing is to use the roll template to format your output. The PF template should have tags that are generic, you should check the wiki for Pathfinder  here .  It looks like you need to start with &{template:pf_generic} {{name=TITLE}} ditch the subheader parts and then it's pretty much the same, just leave off the end bit of "@{selected|classactioncustom1skill}" it doesn't look like the PF template needs it. Oh and don't include {{ability=1}} or the {{emote=...}} either, those are only for the 5e template.  Let me know how it goes!
1445923638
Jeff M.
Plus
Marketplace Creator
I had figured it out. I ended up using the pf_attack template. Many thanks, good sir
1447252752

Edited 1447260676
I'm a different Jeff M.  :) This is really helpful, Ed; and exactly what I was looking for.  Just one question.  :)  Is there any way for the players to access the information on the token bar itself, or does this rely on my using emote commands?  (I think the "target" part of your macro means that if they target the token it should show up, but at the moment, I'm getting the error "No attribute was found for targeted token by the name of max".  I know my attribute works, because the macro @{selected|bar3|max} works fine.) 
I believe you need to have some value in the bar and bar|max otherwise you will get that error. So if those are blank on the targeted token you need to add something in there. Also double check your syntax, an extra space will mess things up as well. 
1447268730

Edited 1447269882
Thanks, I've tried every possible combination I can think of, and the only thing I can't rule out is that targeted macros don't like bar3|max as an attribute.  I tried putting in some text to bar3 as a base, but it didn't fix the problem.  The @{selected|bard3|max} version I showed above works, and the targeted version works if I copy and paste the treasure to the non-max bar3 and just do @{target|bar3}, which suggests that there's nothing wrong with whitespace in the syntax. In the absence of any other suggestions for possible problems, I'm off to the Bug Report forum.  :)
Just to double check you have a value input in the token edit screen here. That's what @{target|bar3|max} is looking for.
1447269987

Edited 1447270059
Sniped while I was editing the above post.  :) Yes, that's where I've got the macro, and as I said, it works for @{selected|bar3|max}, just not for @{target|bar3|max}, so there's something about changing selected to target that's messing up the way that the engine sees attributes.  In my case.  :) (Just in case my tone is coming off harsher than I intend, I'm not angry or frustrated or accusing you of lying or anything, Ed; just trying to figure out why this doesn't seem to be working for me.)
1447270431

Edited 1447270442
And I was just double checking to make sure we were both talking about the same thing.  I hope you get it worked out.
1447278021
Diana P
Pro
Sheet Author
I think the main thing is that you can have multiple targets but only one selected.&nbsp; Try @{target|target1|bar3|max} so it has the full syntax needed and doesn't think that you are trying to find the max attribute of the bar3 target. :) more at: <a href="https://wiki.roll20.net/Macros#Advanced_Usage" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage</a> Hope that helps.
Yes indeed, Diana; that appeared to be exactly what I was missing.&nbsp; Thanks so much!
1447330776
The Aaron
Roll20 Production Team
API Scripter
Just for clarity, I want to point out that regardless of the number of targets, when you want to reference the max field of an attribute you must use the label element of the @{target} selector.&nbsp; @{target|&lt;label&gt;|&lt;attribute&gt;|&lt;max&gt;}
Thank you Aaron! I honestly did not know that. I was using a label just by chance for reference in my own macros. Good to know.
1447339560
The Aaron
Roll20 Production Team
API Scripter
No problem! &nbsp;It's a bit esoteric and I've been bit by it enough times to know that it's something many people are unaware of. Glad to help!
The Aaron said: Just for clarity, I want to point out that regardless of the number of targets, when you want to reference the max field of an attribute you must use the label element of the @{target} selector.&nbsp; @{target|&lt;label&gt;|&lt;attribute&gt;|&lt;max&gt;} This is true only when referencing the max attribute?&nbsp; I wonder if someone should update the wiki to that effect.&nbsp; I'll do it, if it's always the case.
1447359236
The Aaron
Roll20 Production Team
API Scripter
It is already in the documentation. &nbsp;However, it's easy to miss the importance of it when you first read it. By the time it is relevant it may not stand out on a second look. From&nbsp;&nbsp; <a href="https://wiki.roll20.net/Macros#Advanced_Usage" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage</a> Advanced Usage The full syntax for the target variable is: @{target|&lt;target_name&gt;|&lt;attribute_name&gt;|&lt;optional_flags&gt;} (Note that 'target_name' can be anything you like, and can include spaces.) So if you want to have multiple targets in your macro you can do: @{target|Target1|HP} vs @{target|Target2|AC} And if you want to use the max of an attribute: @{target|Target1|HP|max} Note that if you want to use the "max" flag you must specify the name of the target yourself, even if you just put "target1" as above.
I suppose my issue, then, is about the categorization or flow of the wiki page.&nbsp; "Making something work," should not qualify as "Advanced Usage."&nbsp; :)