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

CharSetAttr Question

Can CharSetAttr set conditions like Blinded/Deafened/Stunned and if so can someone tell me the syntax for how to do it? If not is there another way to do it other than the Pathfinder Companion Script (I'd rather no use it unless absolutely necessary).
1527429301
GiGs
Pro
Sheet Author
API Scripter
I dont use Pathfinder so I cant say the specifics of that sheet but the general answer is: If the conditions are recorded in an attribute on the character sheet, use ChatSetAttr to set it. If the conditions are Status Markers on a Token, use Token-Mod (there's also Robin's new Condition script). You can use both in the same macro, if a condition has both an Attribute and a Status Marker.
I believe it's a boolean value attribute on the sheet itself. I don't know much about CharSetAttr do you think you could give me an example of the syntax used to change an attribute on a sheet?
1527432348
GiGs
Pro
Sheet Author
API Scripter
If you have a selected token,  !setattr --sel --attributename|value So to change a condition with an attribute name of Blinded to 1 you'd use:  !setattr --sel --Blinded|1 If you are absolutely certain  the attribute is always 0 or 1, you could toggle it with !setattr --sel --Blinded|1-%Blinded% Which will cycle it between values of 0 or 1. You might want to run this when setting up characters first to make sure initial values are correct: !setattr --sel --Blinded|0 ChatsetAttr has extensive help, which is pretty intimidating I know, but it's worth reading through.
1527467204
vÍnce
Pro
Sheet Author
You can do this and MUCH more with the  Pathfinder Companion Script. !pfc --statuscontrol
Vince said: You can do this and MUCH more with the  Pathfinder Companion Script. !pfc --statuscontrol I've been using PFC and used it specifically for setting statuses as well as the little icons toggled but even though I turned off default token settings it still copies a tokens variables to another token if I set it to represent the same sheet. I have these options turned off (though it was on at one point) and it still copied things like bar values and gm notes. This made it incredibly difficult to have "Generic" traps (i.e use 1 sheet for a trapped door, then have 15 doors assigned that sheet and have 2 token action macros setup to enable/disable the trap). I don't know how to get it to stop copying things it shouldn't be copying. This is why I was looking for an alternative with CharSetAttr. Can token-mod toggle those icons on a token? Can anyone give me an example of this? If I can do that I can mimic what PFC does by using both CharSetAttr and token-mod.
So I read the help data from token-mod and figured out I can do this: !token-mod --set statusmarkers|red @{selected|token_id} My only question now is this: Where can I find a list of the statusmarkers names so I can set them?
For anyone wondering like I was the status marker list can be found on the wiki here: <a href="https://wiki.roll20.net/API:Objects" rel="nofollow">https://wiki.roll20.net/API:Objects</a> The full list of status markers that are available (in the same order they appear in the marker tray): "red", "blue", "green", "brown", "purple", "pink", "yellow", "dead", "skull", "sleepy", "half-heart", "half-haze", "interdiction", "snail", "lightning-helix", "spanner", "chained-heart", "chemical-bolt", "death-zone", "drink-me", "edge-crack", "ninja-mask", "stopwatch", "fishing-net", "overdrive", "strong", "fist", "padlock", "three-leaves", "fluffy-wing", "pummeled", "tread", "arrowed", "aura", "back-pain", "black-flag", "bleeding-eye", "bolt-shield", "broken-heart", "cobweb", "broken-shield", "flying-flag", "radioactive", "trophy", "broken-skull", "frozen-orb", "rolling-bomb", "white-tower", "grab", "screaming", "grenade", "sentry-gun", "all-for-one", "angel-outfit", "archery-target"
I don't see a way I can make a single macro to have a dropdown list of statuses and set both the status on the sheet and the marker on the token. (Really what I mean is a way to tie a status to a marker without have to select both from separate dropdown lists) Until I figure this out I may give PFC another try but I'm worried about what I mentioned before about token data getting overwritten when "represents" is set when another token "represents" the sheet in question.
I have buff / debuff markers turned on in PFC: But when I run the following macro it only sets the condition properly and does not apply the status marker: !pfc --apply,condition=?{Select a Condition|Blind|Entangled|Invisible|Cowering|Fear|Pinned|Dazzled|Flat-Footed|Prone|Deafened|Grappled|Sickened|Helpless|Stunned|Fatigued} I'm at a loss at what to do. I have status markers enabled but it's not applying them.
1527518892

Edited 1527519201
MyRoll20Stuffs
API Scripter
Vince said: You can do this and MUCH more with the&nbsp; Pathfinder Companion Script. !pfc --statuscontrol Hrmm going to take a look at this. EDIT: Still can't get it to toggle status markers when applying a condition.
1527520485

Edited 1527520908
MyRoll20Stuffs
API Scripter
So I've figured out how to do this with token-mod and CharSetAttr Example: Set Entangled: !token-mod --set statusmarkers|fishing-net @{selected|token_id} !setattr --sel --silent --condition-Entangled|2 Remove Entangled !token-mod --set statusmarkers|-fishing-net @{selected|token_id} !setattr --sel --silent --condition-Entangled|0 Now the only thing I need to do is make a set of these for each condition and then make 2 master macros for adding and removing status conditions. Can anyone give me an example of nesting macros in a drop down box? Basically a macro that when clicked brings up a dropdown list of macros to run? EDIT: When I run this: ?{Select a Condition|#s.Entangled} It just outputs it to chat and doesn't run the macro: What am I doing wrong? Can you not nest macros in a drop down box?
1527522262
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I think rather than a drop down box, this would be better approached with a&nbsp; chat menu filled with&nbsp; API buttons . Call the macro, click the status you want and all commands are executed. Make them abilities on a sheet rather than Macros on the collection tab, and you shouldn't have to fiddle around with HTML replacements.
keithcurtis said: I think rather than a drop down box, this would be better approached with a&nbsp; chat menu filled with&nbsp; API buttons . Call the macro, click the status you want and all commands are executed. Make them abilities on a sheet rather than Macros on the collection tab, and you shouldn't have to fiddle around with HTML replacements. It's funny you mention that because that's the approach I broke down and decided to try.
1527526586
vÍnce
Pro
Sheet Author
Kastion said: Vince said: You can do this and MUCH more with the&nbsp; Pathfinder Companion Script. !pfc --statuscontrol Hrmm going to take a look at this. EDIT: Still can't get it to toggle status markers when applying a condition. What was the issue you were experiencing with PFC?&nbsp; Were you getting any errors? A few things to check; Make sure "Apply Condition/Buff Statusmarkers"&nbsp;is ON and you have set-up up your markers however you like. I also use "Apply Settings to Campaign". Make sure to select a token (the token must be linked to a sheet) when using&nbsp;!pfc --statuscontrol to toggle conditions and buffs
Vince said: Kastion said: Vince said: You can do this and MUCH more with the&nbsp; Pathfinder Companion Script. !pfc --statuscontrol Hrmm going to take a look at this. EDIT: Still can't get it to toggle status markers when applying a condition. What was the issue you were experiencing with PFC?&nbsp; Were you getting any errors? A few things to check; Make sure "Apply Condition/Buff Statusmarkers"&nbsp;is ON and you have set-up up your markers however you like. I also use "Apply Settings to Campaign". Make sure to select a token (the token must be linked to a sheet) when using&nbsp;!pfc --statuscontrol to toggle conditions and buffs I did everything you said and it still didn't work. I've added the PFC script through the Script Library a few times and a few other times tried manually adding it by getting the code from github and creating a new script. Tried multiple versions. My global variables are probably all messed up or something.