
Hi,
how to use the inline command? I would like to put "!setattr --all --silent --edge|@{edge}" and "Group has now @{edge} Edge" in one roll button.
Hi,
how to use the inline command? I would like to put "!setattr --all --silent --edge|@{edge}" and "Group has now @{edge} Edge" in one roll button.
You would need to put it on two lines in an Action or a Macro:
!setattr --all --silent --edge|@{edge}
Group has now @{edge} Edge
The problem is, I don't know if the report part will be accurate. in the order of operations, the attribute call @{edge} resolves first, so it might be the same throughout. Technically, they are two separate commands, but I don't know if there is enough time between the two events.
Also, I believe --all does all characters in the game, not just the group. You might want --sel here, to just get the characters of selected tokens.
And you are reporting for a group, but @{edge} will only report for one character. As written, this will only report for a single character, and only if run as a token action (there is no character identifier to indicate which character's edge you want reported.)
Finally, I don't know what this is supposed to do. If the character has an edge attribute, this looks like it will set it to it's existing value, which is no change.
I've had it that way until now and would like to add the output.
<button type="roll" name="roll_edgeRoll" value="!setattr --all --silent --edge|@{edge}">Edge</button>
But that's exactly what I want to achieve, I have an edge pool that the whole group uses and I want to synchronize it with the button.
good that you can use \n to create a new line :D
//Edit
Oh I just noticed that users are not allowed to access the API at all, only the GM? :'(
Player access is a config setting on chatsetattr. Where is @edge stored, if it is a group attribute?
Also, it looks like you are building this into the character sheet by the look of your posted code. That's out of my wheelhouse. I've never looked into sheet building.
an attribute in the player's char sheet, every player has this field.
I wanted to achieve that a player, who has used up edge, takes it off with himself and then transfers it to all players with the button
Some thing keith mentioned above bears repeating:
The command you have set up will overwrite the edge attribute of other characters, with the edge of the current one. So let's say Bob has edge 3, and Lea has 1. Lea uses this command: now Bob and Lea both have 1 edge. If its a communal pool, i guess that makes sense - but there's no spending of edge here.
i think you need to go back to basics and think what you need to do:
There are some problems for incorporating this in a character sheet:
If you dont care that it will change every character, and just intend it for your own groups use, a better way would probably be
<button type="roll" name="roll_edgeRoll" value="!modattr --all --edge|-1">Edge</button>
This way it reduces the edge attribute by one for everyone and reports that it has been reduced. Or you could do
<button type="roll" name="roll_edgeRoll" value="&{template:default}{{name=@{character_name} spends Edge!}} \n!modattr --silent --all --edge|-1 ">Edge</button>
The \n there is a linebreak, ensuring the script command is on its own line. This might not be necessary with chatsetattr, not sure.
GiGs said:
The command you have set up will overwrite the edge attribute of other characters, with the edge of the current one. So let's say Bob has edge 3, and Lea has 1. Lea uses this command: now Bob and Lea both have 1 edge. If its a communal pool, i guess that makes sense - but there's no spending of edge here.
thanks for your explanations
Yes all lose edge at the same time, there is only one shared edge pool. It can also be that more than one edge is needed at a time.
it's an own set of rules that i'm writing right now, because i can only lead online rounds i started to build a character sheet right away.
yes I noticed that with the pro but as long as there is a text message that should not be a problem because then everyone gets it and can enter it by hand.
the rolls dependent on scripts are hidden, for instance
how can you do that? is there a question if you are pro user?
Or maybe you dont care that it gets added to npc sheets if they will never use it.
it would also be possible to make a checkbox which is activated if the character sheet is owned by an npc
GiGs said:
<button type="roll" name="roll_edgeRoll" value="&{template:default}{{name=@{character_name} spends Edge!}} \n!modattr --silent --all --edge|-1 ">Edge</button>The \n there is a linebreak, ensuring the script command is on its own line. This might not be necessary with chatsetattr, not sure.
line break is not necessary in the template
currently i use the following combination:
<button type="roll" name="roll_edgeRoll" value="!setattr --all --silent --edge|?{Modifier?|+/-} \n [[@{edge} ?{Modifier?|+/-}]] Edge">Edge</button> <input type="number" name="attr_edge" value="4" />
the user enters the new edge number in the input field and then presses the button
so when I use the button as a gm it all works
when a player uses the button the following message appears:
Tealk said:
currently i use the following combination:
<button type="roll" name="roll_edgeRoll" value="!setattr --all --silent --edge|?{Modifier?|+/-} \n [[@{edge} ?{Modifier?|+/-}]] Edge">Edge</button> <input type="number" name="attr_edge" value="4" />the user enters the new edge number in the input field and then presses the button
so when I use the button as a gm it all works
when a player uses the button the following message appears:
It turns out players cant use --all. From the chatsetAttrs ducumentation:
--all will affect all characters in the game. USE WITH CAUTION. This option will only work for the GM. If you have a large number of characters in your campaign, this will take a while to process all attribute changes.
It looks like the only way to do this would be to use --sel (pretty risky for a character sheet macro, since there's no guarantee players will remember or even be able to select all pc tokens), or to use --name and list all the pc characters.
Tealk said:
the rolls dependent on scripts are hidden, for instancehow can you do that? is there a question if you are pro user?
I'm referring to use CSS to hide elements of the character sheet. You could have a checkbox in a settings section, "Do you have chatsetattr installed?" and if that box is unticked, hide the button above, and if ticked, reveal it. Check out the CSS Wizardry page on the wiki for examples of things like this.
GiGs said:
I'm referring to use CSS to hide elements of the character sheet. You could have a checkbox in a settings section, "Do you have chatsetattr installed?" and if that box is unticked, hide the button above, and if ticked, reveal it. Check out the CSS Wizardry page on the wiki for examples of things like this.
That's what you mean, I thought there was a way to read which apis was activated
It looks like the only way to do this would be to use --sel (pretty risky for a character sheet macro, since there's no guarantee players will remember or even be able to select all pc tokens), or to use --name and list all the pc characters.
but then the user would have to enter all usernames manually?
Or is there a way to read out all names and automate that?
Tealk said:
GiGs said:
I'm referring to use CSS to hide elements of the character sheet. You could have a checkbox in a settings section, "Do you have chatsetattr installed?" and if that box is unticked, hide the button above, and if ticked, reveal it. Check out the CSS Wizardry page on the wiki for examples of things like this.
That's what you mean, I thought there was a way to read which apis was activated
It looks like the only way to do this would be to use --sel (pretty risky for a character sheet macro, since there's no guarantee players will remember or even be able to select all pc tokens), or to use --name and list all the pc characters.
but then the user would have to enter all usernames manually?
Or is there a way to read out all names and automate that?
There's no non-script way. A custom script could identify them in a variety of ways, with different degrees of usefulness, but there's no way to do this natively in a character sheet.
Honestly, for a feature like this, I think you'd be better off making it a script. One of the various experience scripts could be hijacked for the purpose. They have ways of letting the GM identify the pcs, and store a total shared by all the pcs (experience => edge). You could create a macro that lets players spend edge and report the edge remaining. It wouldnt be a complex script. I think I have one I could dig up and tweak it for this purpose, if you'd like that.
GiGs said:
. It wouldnt be a complex script. I think I have one I could dig up and tweak it for this purpose, if you'd like that.
I am unfortunately not very well in JS, it would be great if you could help me, thank you very much :D
Tealk said:
GiGs said:
. It wouldnt be a complex script. I think I have one I could dig up and tweak it for this purpose, if you'd like that.
I am unfortunately not very well in JS, it would be great if you could help me, thank you very much :D
I just realised you could use the already-existing Ammo script for this. Create a character, call it Group, and create an attribute on it called edge. Give it an initial score. Then set up the sheet as being editable by all characters, but visible to none, and then any player can use ammo script to spend points of edge.
!ammo @{Group|character_id} Edge -1 Edge
The above could be used to spend edge. Use this to add points of edge
!ammo @{Group|character_id} Edge ?{Add Edge?|1} Edge
It's not perfect, but it's simple. I'll dig up my script later.
GiGs said:
I just realised you could use the already-existing Ammo script for this. Create a character, call it Group, and create an attribute on it called edge. Give it an initial score. Then set up the sheet as being editable by all characters, but visible to none, and then any player can use ammo script to spend points of edge.
!ammo @{Group|character_id} Edge -1 EdgeThe above could be used to spend edge. Use this to add points of edge
!ammo @{Group|character_id} Edge ?{Add Edge?|1} EdgeIt's not perfect, but it's simple. I'll dig up my script later.
Thanks a really good idea
It should print out how what the edge value is after it has been altered, is it not doing that?
If you mean a constant place players can see, you could give that sheet a token and have edge displayed in one of the bubbles.
Kraynic said:
If you mean a constant place players can see, you could give that sheet a token and have edge displayed in one of the bubbles.
Yes exactly but it would be great if the place was in the character sheet of the player, looks more elegant.