
5e by Roll 20 sheet
I'm using this script to set up NPC tokens:
!token-mod {{
--set bar1_link|none
--set bar1|?{Enter HP Value|
Roll HP,[[@{selected|npc_hpformula}]]|
Custom HP,?{Custom HP Value}|}
--set name|{@selected|character_name}
--set bar2_link|ac
--set bar3_link|npc_speed
--off showplayers_bar1
--off showplayers_bar2
--off showplayers_aura1
--off showplayers_aura2
?{Name|No Name}
--set name|"?{Name}"
?{Show Name?|No, –off showplayers_name|Yes, --on showplayers_name|}
}}
It does what I want, except the --set name|{@selected|character_name} part is truncating names with spaces on the nameplate. So my Brown Bear becomes Brown, my Assassin Vine becomes Assassin, and so on. I've seen some places where the answer was to use quotes, but I haven't been able to make that work. If I leave that line out, it works fine but I'm interested in understanding what's happening here.
The query for a custom name mostly does what I want, but it seems to lock the showplayers_name to on. For example, I can run the script and it rolls hp, names the bear Chongo the Smart, and shows his name to the players. But if I run the script again to hide name from players, it stays with the previous setting. If I take out the name query, I can set showplayers_name to on or off as I choose.
There are times when I don't want to use the character_name (if I'm understanding that correctly, and that's the "character represents" name) because I want my Brown Bear to be named Chongo The Smart, so I'd like to be able to both toggle the name on/off and be able to specify a custom name or use the standard name from the character sheet. Is this possible?
For now, I'm removing the parts that are causing me issues, but I'd appreciate guidance/advice.