Member
Join Date: Sep 2018
Posts: 30
|
Hi. Let's say I wanted to create a custom armor power (under the Item Power tab) that only works on armor made from a particular material (adamantine, for example). Is there a way to test for that? I assume it would involve a simple bit of script in the "Expr-reqs" button? Thanks in advance.
|
#1 |
Senior Member
Join Date: Mar 2013
Location: Melbourne, Australia
Posts: 1,088
|
When making an 'Item Power' there is a "Requirement" button where you can select such things as "metal".
You could go further and check if a particular material is present with a Pick-reqs or Expr-reqs. Adamantine for example, has the ID eAdamant. (You can check IDs for materials by going to the Material tab, and clicking "New (Copy)". I'm not aware of an existing power that requires a material, or I recommend looking at that for how its done. Current RPG's: Pathfinder (GM), Pathfinder (Player), Gamma World (GM, Pathfinder homebrew). HeroLab: 3.5 & Pathfinder. HL User Files for PF: Greyhawk Setting, Gamma World (WIP). DM and player of D&D since 1980. Last edited by Dami; July 23rd, 2021 at 05:30 PM. |
#2 |
Member
Join Date: Sep 2018
Posts: 30
|
Thank you for the response. I did actually check for those things. Under the "Requirements" button, you can check for a variety of things such as cloth, leather, and metal, but not for adamantine or any other specific metal. I also checked for other item powers that required a specific material such as adamantine or mithral, but alas I found none that I could copy from.
|
#3 |
Member
Join Date: Sep 2018
Posts: 30
|
Okay, I figured it out. Expr-req: Picklives[eAdamant] > 0
|
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Picklives should only be a last resort - if you see it used for something basic like a prereq, that's bad coding style that we haven't gotten rid of yet. Always look for a tag-based method first.
Here's the expr-req I'd use: tagis[IsMaterial.eAdamant] <> 0 Last edited by Mathias; July 23rd, 2021 at 08:52 AM. |
#5 |
Member
Join Date: Sep 2018
Posts: 30
|
Okay. Got it. Thank you!
|
#6 |
|
|