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

Can someone help making new attacks ChatSetAttr, on Starfinder sheet?

I have an external script (not a Roll20 API script) that parses the stat blocks for Starfinder npcs, and outputs commands for ChatSetAttr. I have it working for simple attributes. I don't know how to do the repeating attacks, spells, etc. The links for rolling the attacks look like this: ~-MHxe3jD1Q2Ti68Kh6sX|repeating_attack_-mhxf-6jryksqbr1svnc_roll I gather that the first part is the character id, and "-mhxf-6jryksqbr1svnc" part is the id of the attack. I need to create a new attack and set all the attributes for it (the name, attack bonus, damage, damage type, etc.). I won't have the character id, just the name. Also, in the character sheet there is a section for melee attacks, and a section for ranged attacks, and the links for them look exactly the same, so I'm not sure how to tell the attack whether it's melee or ranged. What is the syntax for the ChatSetAttr command to do this?
For the starfinder sheet all of the repeating sections are named depending on which repeating section you are using. For attack its named repeating_attack_$x_name. (note x is the number of the repeating item starting at 0) There is no differentiation between ranged or melee in the actual repeating section however there is a value within the repeating attack section that is created that can be changed to depict how you want it set.  In this instance because you are creating the ability the number does not matter. It will create one in the section at the bottom of its list. The command to accomplish this can be done like this (simple example): !setattr --sel --repeating_attack_-CREATE_name|Laser --repeating_attack_-CREATE_engagement_range|ranged Note this is not covering all the attributes with the repeating section but should give you an idea of how it works. You would add -- --repeating_attack_-CREATE_<ability name within the repeating section goes here>|value to set Also note that anytime you use the option to create a repeating section it will not overwrite an existing one, it will create a new at the bottom of this so it is possible to create a duplicate so its best test your syntax and once you have it figured out you can make a macro for it.  That should get you started and hopefully it helps.
1602614205

Edited 1602614278
Thanks Mark, that helps. However, when I add attacks that way, they all end up in the melee section on the sheet, even though I set engagement_range to ranged. Here's an example from the creature I just added: !setattr --name Feeder Fungus  --repeating_attack_-CREATE_engagement_range|ranged  --repeating_attack_-CREATE_name|fungal pod  --repeating_attack_-CREATE_base_attack_bonus|9  --repeating_attack_-CREATE_damage_dice|1d6+4  --repeating_attack_-CREATE_type|Bludgeoning  --repeating_attack_-CREATE_crit|stunned All those attributes get set correctly, but when I look at the sheet it's listed under the melee section instead of the ranged section. Not a huge deal I guess, but annoying. And I can't figure out a way to move it manually either. Anything I can do about that?
Liz D. said: Thanks Mark, that helps. However, when I add attacks that way, they all end up in the melee section on the sheet, even though I set engagement_range to ranged. Here's an example from the creature I just added: !setattr --name Feeder Fungus  --repeating_attack_-CREATE_engagement_range|ranged  --repeating_attack_-CREATE_name|fungal pod  --repeating_attack_-CREATE_base_attack_bonus|9  --repeating_attack_-CREATE_damage_dice|1d6+4  --repeating_attack_-CREATE_type|Bludgeoning  --repeating_attack_-CREATE_crit|stunned All those attributes get set correctly, but when I look at the sheet it's listed under the melee section instead of the ranged section. Not a huge deal I guess, but annoying. And I can't figure out a way to move it manually either. Anything I can do about that? That is interesting I tested in my game and it works, i even tested your with some modification and it works just fine (I used --sel because i didnt have a character named feeder fungus. You can manually change the Ranged on the sheet its a drop down menu you click on as follows: Though I am wondering if you are thinking about category and not just engagement range. The default is basic melee for all attacks in both category and engagement range. Note Category will affect proficient to not, depending on how you setup the sheet for proficiencies. The category and proficiency would affect target buffs if any, for instance if you list a weapon as special it would apply bonus to damage for operative bonuses etc. For NPC's this probably doesn't matter that much however upon testing that theory I think you are trying to affect the NPC section of the sheet not the PC side. I may not have grasped that from your first post but upon looking at it more closely I think this maybe the case. My apologies for not catching that at first.  So TLDR: What you want to do with chatsetattr may not be possible but not because chatsetattr can't do it, but because of how the sheet works. On the NPC side of the sheet, it looks like the code is setup to use event handlers from the sheet worker to use a pseudo class div to display a separation of melee, ranged and multiattacks. In the actual code its simply just creating a repeating attack row. Since Chatsetattr creates the repeating row the sheet worker never triggers to display it for the npc because the event does not occur in any meaningful way as I understand. (Someone with better understanding of Javacript and sheetworkers might be better able to explain that in greater detail than I.) It may also be related to a known bug with sheetworks and triggered events. Every character sheet will work differently depending on the games you run. There is no universal standard. However from a functional stand point there is nothing wrong having it simply show in the melee section of the NPC it functions the same, its more visual aesthetics (or for some OCD or feng shui) in how it looks. So long as you have it configured with the right values it shouldn't affect things to much as far as how the sheet works. The harder part is paying attention when using the NPC and remembering if its melee or ranged though the output to chat should tell you. 
Yes, you're right, this is the NPCs, and I wanted the ranged attacks to show up under the "Ranged" header. Oh well, I guess I can create the attack on the sheet and THEN set its attributes with ChatSetAttr, if I really want them there. Thank you for looking at it.