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

Token Mod script help with changing name on rollable table

So I use macros for changing a players token to another visually a rollable table. The problem is they want the name to change with it, and I don't know enough about scripts to make that happen. The first side of two is Koryu. The second is Reika. I attempted to edit the script but I only succeeded in making more rollable table entries that did nothing instead. The script I have been using is this: !token -mod { { - -set ? {Choose Form |Koryu ,currentside #1 represents # @ {Koryu |character _id } width #1g height #1g |Reika ,currentside #2 represents # @ {Koryu |character _id } width #1g height #1g } bar3 _link |hp name | "Koryu " showname |yes } }
1732492499

Edited 1732492664
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Use the Faces script. This is exactly what it does, and more. You can change, face, name, tooltip and/or gmnotes through a graphic interface in chat.  For example, here is a table with three entries that have notes: The chat menu generated looks like this: There is a code link in the post I linked, but the easiest way is to use the One-Click install.
That is one potential option. However, it is not what I am looking for, though I do appreciate the reply. I would prefer to figure out how to make a token mod script do a name change based on which side is selected. I've got too many scripts as is. Roll20 has enough random glitches, sometimes born from APIs I've noticed. Less is more. Likely I will end up simply not having a solution and dealing with not having the wanted effect.
1732504817
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Ah, I did not see any conditionals in the macro you posted, and thought you just wanted something that would assign a face and name arbitrarily. Making a script that does something contingent upon another piece of data (If this face, then that face) usually requires another script, in this case, ScriptCards or a metascript.
1732505717
The Aaron
Roll20 Production Team
API Scripter
Something like this should work: !token-mod {{ --set ?{Choose Form|Koryu, name|Koryu currentside#1 represents#@{Koryu|character_id} width#1g height#1g|Reika, name|Reika currentside#2 represents#@{Koryu|character_id} width#1g height#1g } bar3_link|hp showname|yes }}
Sorry Keith, I didnt make the most clear first post. Sleep related. The Aaron said: Something like this should work: !token-mod {{ --set ?{Choose Form|Koryu, name|Koryu currentside#1 represents#@{Koryu|character_id} width#1g height#1g|Reika, name|Reika currentside#2 represents#@{Koryu|character_id} width#1g height#1g } bar3_link|hp showname|yes }} I tried this. It unfortunately does not work. It actually works less well. So, with this it shows two additional table options which are the only ones that will do anything. What it does is swaps the token image but does not assign a name at all. I don't know script enough to fix that, but I think it is continuing the name command instead of stopping and starting the next part?
1732555315
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Try this. The problem stems from trying to embed an attribute call inside of a query. The pipe character wants to break the query. I used # instead of | wherever token mod allows, and eliminated the "represents" look up. The only difference now is that it will run on any selected token. Since this is a player macro, that's probably not too much of an issue, but to be sure, I would suggest making it a token action on the character. !token-mod {{  --set ?{Choose Form|Koryu,name#Koryu currentside#1  width#1g height#1g|Reika,name#Reika currentside#2 width#1g height#1g } bar3_link|hp showname|yes }}
keithcurtis said: Try this. The problem stems from trying to embed an attribute call inside of a query. The pipe character wants to break the query. I used # instead of | wherever token mod allows, and eliminated the "represents" look up. The only difference now is that it will run on any selected token. Since this is a player macro, that's probably not too much of an issue, but to be sure, I would suggest making it a token action on the character. !token-mod {{  --set ?{Choose Form|Koryu,name#Koryu currentside#1  width#1g height#1g|Reika,name#Reika currentside#2 width#1g height#1g } bar3_link|hp showname|yes }} Perfect! That does exactly what I was looking for. Also thanks for the explanation, that helps me understand a bit more of how the script functions as well. Much love.