Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Pseudo-Attributes"

From Roll20 Wiki

Jump to: navigation, search
(Created page with "{{revdate}}{{BCS|page}}{{stub}}{{NavSheetDoc}} Character Sheets pseudo-attributes are special sheet attributes that always exists, even if you don't "create" them in a sh...")
 
m
Line 70: Line 70:
 
[[Category:Character Sheet Creation]]
 
[[Category:Character Sheet Creation]]
 
[[Category:API]]
 
[[Category:API]]
 +
[[Category:Macros]]

Revision as of 13:32, 3 November 2021


Character Sheets pseudo-attributes are special sheet attributes that always exists, even if you don't "create" them in a sheet, and are more like data tied to the character sheet that in some cases can be viewed or even edited on a sheet.

Some can be called in Macros.

Contents

Pseudo-attributes

character_name

Display(and able to edit) the name defined for the character which shows up on the N Journal page.

<input type="text" name="attr_character_name"> 

If you don't want the name to be updated on the journal page, create a name attribute with another name, such as name="attr_name"

character_avatar

example of attr_character_avatar, attr_character_token, and attr_character_name pseudo-attributes displayed on a sheet

source

The character_avatar and character_token pseudo-attributes

With this functionality come two pseudo-attributes: attr_character_avatar and attr_character_token. These allow sheet authors to directly present the avatars and tokens of a character via the character sheet.

These attributes are read-only. You will be able to assign them to an input, but that input will be disabled by default. You will be able to access them via a getAttrs, but not change their value via a setAttrs.
Example:

<img name="attr_character_avatar">
img{
    width: 100px;
    height: 100px;
}

character_token

source

The character_avatar and character_token pseudo-attributes

With this functionality come two pseudo-attributes: attr_character_avatar and attr_character_token. These allow sheet authors to directly present the avatars and tokens of a character via the character sheet.

These attributes are read-only. You will be able to assign them to an input, but that input will be disabled by default. You will be able to access them via a getAttrs, but not change their value via a setAttrs.


Example:

<img name="attr_character_avatar">
img{
    width: 100px;
    height: 100px;
}

character_id

Cant be displayed on a sheet, but can be referenced with a macro.


A macro that displays a selected tokens character_name, character_id, and some token info.

&{template:default} {{name=**Character & Token ID**}} {{Character Name=@{selected|character_name} }} {{**Character ID**= @{selected|character_id} }} {{**Token Name**= @{selected|token_name} }} {{**Token ID**= @{selected|token_id} }} {{**Bar 1**= @{selected|bar1} / @{selected|bar1|max} }} {{**Bar 2**= @{selected|bar2} / @{selected|bar2|max} }} {{**Bar 3**= @{selected|bar3} / @{selected|bar3|max} }}