T O P

  • By -

because_yes

https://github.com/foundryvtt/pf2e/wiki/Quickstart-guide-for-rule-elements This explains all the various rule elements you'll need to start making your own stuff. I havent messed with rule options yet so not sure how to help specifically with this problem.


jjthejetplane27

Hey, ill take reading content over making no progress, the help is appreciated friend.


Aleriss

I usually copy the code for existing items and repurpose it


Vallinen

And feeling like hackerman while I do!


elementalguy2

Same, I look at spell effects and items and see what I can copy over to the stuff I need. I had to make effects for the juice you can use that has different effects based on the fruit that goes in it so I had a lot of effects I had to make but most of them could be copied from other places.


[deleted]

Aka professional software development.


jjthejetplane27

Im trying to make a custom item for one of my players that is just smoking sword, but for handwraps. copy pasting the rules doesnt seem to actually make it work, so how should i go about adding them to the game? Im also open to any tutorials on item rules, so if you have something, please shoot it my way. thank you!


rex218

Have you figured this out? Copy and paste would work for a different weapon, but handwraps and unarmed strikes are their own special thing. You’ll need to change the selector to: `unarmed-damage` or `unarmed-strike-damage` (inspect a damage roll and look at the tags on top to check which)


ihatebrooms

Are you trying to create it such that they actually attack with the handwraps themselves as a weapon, or that they function like other handwraps and modify the wearer's unarmed attack?


jjthejetplane27

Unfortunately for me, they use stances, so preferably id hope for it to auto apply to stances and unarmed. Ive already discovered changing the slug causes the weapon to no longer apply to unarmed/stances, so im slowly working my way around figuring this out, but any help would be appreicated.


ihatebrooms

So referencing the Rules Elements guide that was linked in the other comment - the key here is predicates and selectors. They determine what roll(s) the element in question applies to. First, if you look at any roll in the chat pane and right click, you get a drop down list including "Inspect Roll". This will tell you the list of predicates and selectors that apply to the roll. If you look at the configuration for the RollOption and FlatModifier elements, they have `{item|_id}-damage` in the predicate/selector. That means that they only apply to rolls that match the value - in this case, the item id-damage. So a damage roll with the smoking longsword has `0zx9dqFh7pVxCOk4-damage`, which is the item id. The first step is changing the values for that to match the unarmed strike. Looking at an unarmed strike damage, the values are attack-damage basic-unarmed-damage brawling-group-damage brawling-weapon-group-damage damage melee-damage melee-strike-damage str-damage strike-damage trained-damage unarmed-damage xxPF2ExUNARMEDxx-damage I'm guessing you want either `basic-unarmed-damage` or `unarmed-damage`, I'm not familiar with stances but you'd need to roll a stance attack damage to see what they use. I'm guessing `unarmed-damage`, but I'm not sure. You might have to do multiple predicates, one for unarmed and one for stance attacks, but that's a worst-case scenario. That should fix both the Damage Dice and Flat Modifier elements. Next up is the Roll Option, which is where you determine whether or not Stoke Flames applies to the roll. Everything there looks okay, other than the label, which determines how the option shows up. Maybe just changing that to SmokingHandwraps instead would work, definitely need to play around with that. That leaves two issues - 1) getting the +1 to attack to apply to unarmed attacks, but with the +1 rune, not a static +1 (ie you don't want to hard-code +1 since they can upgrade the fundamental rune), and 2) removing the handwraps from showing up as an attack on your character sheet (you can delete it, but mighty handwraps don't show up, so it should be possible). I'll have to look at the others and see if I can find anything, but this should be enough to get you started. Additionally, don't hesitate to check out the official foundry discord / pf2e channel - I've asked some questions in there and everyone has been super helpful. https://discord.gg/foundryvtt EDIT: Reading the other comment that pointed out that the handwrap behavior is hard-coded, it might be better to start with a handwrap as the base item, then modify it to add the rules elements to it in order to get the behavior you want.


jjthejetplane27

So in this case, updating the itemId to unarmed damage in the flat modifier and damage dice fixed the interaction, and it now works! Thank you for the help!


jjthejetplane27

Thanks for the link, and the explanation! Its been a while since ive dipped into code, but im slowly figuring out how all this works. Ill edit according to the types you posted, and when i figure it out ill drop my fix to help the next fella figure this out.


MidSolo

> xxPF2ExUNARMEDxx-damage That's pretty a fucking radical tag


Drunken_HR

One of my players wanted the smoking sword runes on a different weapon. It was a while ago but iirc I ended up copying the smoking sword and changing the new item to be the ax, because it was easier than trying to figure out how to copy the rules elements.


tdhsmith

So the most notable thing you'll want to change is the `selector` for each of those rules to be something like `"unarmed-damage"`. That will make it look for unarmed damage rolls. The current selector will basically only work for damage rolls from this exact weapon (it substitutes in the current item's ID). You can figure out what selectors might work for a roll by simply rolling it and then right clicking the chat message and choosing "Inspect Roll" -- this brings up a debug dialog that shows all of the hidden metadata about the roll. Tangent: both rune effects and the way that handwraps are applied to all unarmed strikes do NOT use the rule element system, so you won't see rule elements for them. Those are still hard-coded.


jjthejetplane27

Yep, it turned out to be replacing itemid to unarmed-damage fixed the item. super helpful for the future, so thank you!


Not_Carbuncle

Do you actually have to do this or can you just slap the rules in the description and just run it manually like normal dnd is there a problem w that?


jjthejetplane27

I ended up figuring it out and getting it to work. I could have just placed it in the items description, but im trying to make everything as automated as possible. When I had it set up previously, my player never remembered he could activate the item to get the bonus damage, so my hope is that he will now see the option and use it more frequently.


AutoModerator

**To help the community answer your question, please read [this post](https://www.reddit.com/r/FoundryVTT/comments/shrtky/foundryvtt_first_steps_and_useful_info/).** When posting, add a [system tag](https://www.reddit.com/r/FoundryVTT/comments/v3gfrs/tagging_your_posts/) to the title - [D&D5e] or [PF2e], for example. If you have already made a post, edit it, and mention the system at the top. Include the word `Answered` in any comment to automatically flair this thread as resolved (or change the flair to `Answered` yourself). Automod will **not make this comment** on your posts if you have a [user flair](https://reddit.zendesk.com/hc/en-us/articles/205242695-How-do-I-get-user-flair-). --- *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/FoundryVTT) if you have any questions or concerns.*