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

Basic Character Sheet displaying Attribute value

December 31 (4 years ago)

Edited December 31 (4 years ago)

Hi Everyone

I am creating a very basic sheet for Stellar War and setting up a simplistic star ship data. Its a very basic free game with starship combat. So I have under attributes settings (engine / hull etc) and in the abilities I am trying to setup a macro to show the value / current settings (so the players can click on that and it will display the current settings to other players (ie another ship can scan the other player ship to see what their shield stength is, hull, etc.


Is there a best way you can suggest or the general format? 


Basically for example I have in the character sheet (no template is loaded) the Bio and Info tab and the Attributes. So example have a few attributes (engine / hull ) and the value of the current level (example hull 100 points).


Tks Dave



December 31 (4 years ago)
Kraynic
Pro
Sheet Author

Sounds like you just need to know how to pull attributes from a sheet?

https://wiki.roll20.net/Macros#Attribute_Macros

If you want a more universal macro, you can replace the sheet/character name with "selected" if there will always be a token to select on the vtt.  Then the macro would look at the stats on the sheet that token represents.  That is detailed just little farther down the wiki page in the link.

You can make it a little more attractive maybe by using the default roll template.  Most roll templates on Roll20 are built into sheet code, but the default template is part of Roll20 and available in any game.

https://wiki.roll20.net/Roll_Templates

December 31 (4 years ago)

thanks as always!

I have the basic script which works fine (below).  The only issue is the format as you noted. It posts the output as expected but it inserts the players name after Shield which is fine we can use it but my question is it possible to have a border around the entire output but more importantly to remove the second player name insertion.


Thanks again!

Dave

&{template:default} {{name=SCAN RESULTS}} ;
Engine @{Engine} ;
Hull @{Hull} ;
Shield 1 @{Shield 1};
Shield 2 @{Shield 2};
Shield 3 @{Shield 3};
Shield 4 @{Shield 4};
Shield 5 @{Shield 5};
Shield 6 @{Shield 6};  


December 31 (4 years ago)

Edited December 31 (4 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

You need to enclose the entire output in template fields.Try this:

&{template:default} {{name=SCAN RESULTS}}{{Engine=@{Engine}}}{{Hull=@{Hull}}}{{Shield 1=@{Shield 1}}}{{Shield 2=@{Shield 2}}}{{Shield 3=@{Shield 3}}}{{Shield 4=@{Shield 4}}}{{Shield 5=@{Shield 5}}}{{Shield 6=@{Shield 6}}} &{noerror}


Not sure how this code pulls a player's name, but I'd need to see the contents of the attributes, I suppose. The "&{noerror}" at the end suppresses any error message that may pop up from characters that don't have a named attribute.

Note that if you want to scan another ship (particularly one you as a player cannot select) you will need the target attribute:

&{template:default} {{name=SCAN RESULTS}}{{Engine=@{target|Engine}}}{{Hull=@{target|Hull}}}{{Shield 1=@{target|Shield 1}}}{{Shield 2=@{target|Shield 2}}}{{Shield 3=@{target|Shield 3}}}{{Shield 4=@{target|Shield 4}}}{{Shield 5=@{target|Shield 5}}}{{Shield 6=@{target|Shield 6}}} &{noerror}