Hello everyone,
Question:
- Could someone show me an example of a way to have a name or button on a character sheet that stores the variable between sessions that can be easily referenced that uses the Roll Template for chat?
I was following the example provided by the Roll20 API guide and I think I was following it alright, yet I am confused where to place the Macro. I'd like the Macro to be part of the sheet so it doesn't need to be added as an addon (if I'm understanding that correctly). I do have a lot of web dev front end experience. I simply need to wrap my head around how things work here on Roll20.
I figured, while I'm asking, if someone would be kind enough to show how they are storing local or global variables, that would be nice.
I tried making custom attribute names and either I’m doing something wrong or that doesn’t work. For example, “attr_character_dexterity” will create a stored variable on the sheet on the last page. However, if I did a different name, for instance, “attr_character_role”, that doesn’t get created on the last page. I tried referencing it with code similar to “@{attr_character_role}“ and it doesn’t seem to do anything. Could that be because I need to use JavaScript to make the code update live on the sheet? I thought the prebuilt features of the sheet syntax wound work. Maybe I’m misunderstanding something simple… [Hope I did code examples correctly, currently doing a repost and I added to this message via my phone. I had posted a version of this question on a different forum and was recommended here.]
For my ease, can you make the example make sense, so pretend you are making an attack, heal, or some other dice roll. Context helps me associate the knowledge.
Much appreciated any help you can provide,
Res
P.S. If someone feels extra kind, I was curious how the DnD character sheets have the lock/unlock feature for data entered in text fields. I figured I could likely do that using Javascript. If there is a pre-built way to do that, I am curious, otherwise I will be looking to do it that way.