Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - D&D 5th Edition SRD

Notices

Reply
 
Thread Tools Display Modes
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old November 16th, 2020, 10:39 AM
There are a few instances in tomorrow's Tasha's Cauldron of Everything where we'd want to test to see if the hero is proficient in any martial weapon. This would need to be tested in an eval script in some instances and as a pre-requisite in others.

Obviously testing to see if the Hero is proficient in all martial weapons is pretty simple, as we look for the wProfReq.Martial tag. But there are plenty of Heroes that have proficiency in just one or a handful of martial weapons.

Is there an easier way to test this than what I have? And how can I do it as a prerequisite, if possible?

Here's the eval script code I've come up with, though I haven't had a chance to test it out yet.

Code:
~set up a variable
var profs as number

~start looping through every martial weapon
foreach thing from BaseWep where "wProfReq.Martial"

~if I'm using intersect right, we're taking the thingid of each martial weapon  in the loop and seeing if the hero has a WepProf.____ that matches it
if (hero.intersect[WepProf,thingid,initial] <> 0)

~ if it does match, add 1 to our variable
profs += 1
endif

~(here's where we'd test if profs > 0 then do whatever we want done if it is. I didn't include that code here since it's extraneous to this post)

~can the below be used to end the script early, so it doesn't have to loop through every weapon now that we've identified our minimum of 1?
doneif profs > 0

nexteach
I know we could also just manually type out each martial weapon and check if WepProf.____ is on the hero, but that doesn't account for any player-made or future weapons.

EDIT: Would it be possible to do this in reverse? Take whatever WepProf.____ tags are on the hero, go to the Thing for that weapon, then test if that weapon is martial? How would I do that?

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!

Last edited by Fenris447; November 16th, 2020 at 10:41 AM.
Fenris447 is offline   #1 Reply With Quote
dungeonguru
Senior Member
 
Join Date: May 2016
Posts: 608

Old November 17th, 2020, 05:29 AM
Elemental Adept over in feats is a good thing to look at - it shows how to put a complex script/procedure like 5CHasSpell (located in the procedures validate .user file) into a pre-req as a validation step.
dungeonguru is offline   #2 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old December 31st, 2020, 10:38 AM
Following up on this, I did figure it out. Take a look at the bonus proficiencies of the Tasha's sidekicks to see how.

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!
Fenris447 is offline   #3 Reply With Quote
RavenX
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2011
Location: Nowhere, Virginia
Posts: 3,633

Old January 1st, 2021, 09:28 AM
Quote:
Originally Posted by Fenris447 View Post
Following up on this, I did figure it out. Take a look at the bonus proficiencies of the Tasha's sidekicks to see how.
Should be able to do this with an exprreq

hero.tagis[the tag for Martial Weapon Prof] <> 0

There should be a tag forwarded to the hero indicating proficiency with any martial weapon and an exprreq can easily pick that up.

RavenX Pronouns: She/Her

Please do not PM me to inquire about datafiles I coded "for personal use" such as Exalted, World of Darkness, AD&D, or Warhammer 40K Roleplaying. I appreciate your interest, but I do not own the Intellectual Property rights to these game systems. Nor do I have permission from any of the Publishers to distribute the data files. As such, I cannot distribute the work I have done with community on these files. They are "for personal use" only. Thank you.

I am far too busy these days to answer emails. If you message me here there is no guarantee I will get back to you at all.
RavenX is offline   #4 Reply With Quote
Fenris447
Senior Member
 
Join Date: Sep 2017
Posts: 600

Old January 1st, 2021, 02:46 PM
The issue was that I was looking for proficiency with any martial weapon, not all martial weapons. So if a hero was proficient with just one in particular but not all of them, they'd still be eligible for the thing.

EDIT: To clarify, I did also look for the overall Martial Weapon proficiency tag first. If that's found, the script ends and skips the steps to test for proficiency with individual martial weapons, to save all that processing.

Found an issue with or have a suggestion for the 5e Community Pack? Please post it here at our GitHub.

Feel free to stop by the Lone Wolf Development Subreddit, for discussion of any and all LWD products and community efforts!

Last edited by Fenris447; January 4th, 2021 at 08:10 AM.
Fenris447 is offline   #5 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 01:10 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.