Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632

Old December 4th, 2019, 12:04 PM
Heya, I've run into a bit of an issue. I'm trying to crate a special material that adds the WOUNDING special property (among other things).

This special material causes any weapon to be made from it to require a new exotic weapon proficiency called "Shard Weapon" For anyone who does not possess the proficiency, the weapon functions as normal except that they take the usual penalty and it disables the wounding quality.

Am wondering if anyone could give me a hand with this.
TobyFox2002 is offline   #1 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old December 5th, 2019, 03:14 PM
I would add a new feat for "Shard Weapon Proficiency", then add an eval script to the material which checks for the presence of your feat, and if not found, deletes the Proficient tag on the parent weapon it is inside. You'll need to set the eval script before whatever script calculates the attack bonus for a weapon.
Aaron is offline   #2 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old December 5th, 2019, 03:22 PM
Here is a rough example, assuming your feat's unique ID is "fShardWepProf".

Post-Level 10000
Code:
~Do nothing if we have the correct proficiency
doneif (hero.childlives[fShardWepProf] <> 0)

~Otherwise travel to our parent weapon and make it not proficient
perform container.parent.delete[Helper.Proficient]
Instead of childlives, you could add a script to the feat you created to assign a Custom tag you define to the hero, and check for that in the material script. Either way would work I think.

Usual disclaimer about code being untested and may need tweaking.
Aaron is offline   #3 Reply With Quote
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632

Old December 6th, 2019, 07:56 PM
Quote:
Originally Posted by Aaron View Post

Post-Level 10000
Code:
~Do nothing if we have the correct proficiency
doneif (hero.childlives[fShardWepProf] <> 0)

~Otherwise travel to our parent weapon and make it not proficient
perform container.parent.delete[Helper.Proficient]
The code you gave is good, but it misses the mark slightly of what I need. The special proficiency grants it to a single weapon, much like the exotic weapon proficiency feat.

So what I have decided to do is a mix of your example and your suggestion. I created a new dynamic tag ShardProf with base values of ProfAll, AllSimple, AllMartial, and AllExotic. I'll use those in the future if I need to expand the functionality.

The point is I want to get the idstring from my selection and use that as the value of my tag, then push that to the hero. Then I can check if that exists anywhere I need.

The issue is I dont know how to do that, this is my code sofar, but I cant figure out a way to take the usrChosen idstring and pass that into an assign or forward command.

Code:
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.FtDisable] <> 0)

      ~ If we haven't chosen anything, get out now
      doneif (field[usrChosen1].ischosen + tagis[Target.?] = 0)

        ~ Assign the appropriate tag to all weapons that meet the criteria
        var id as string
        var name as string
        call fTargetId

        foreach pick in hero where "IsWeapon." & id
          perform eachpick.assign[ShardProf.?]
          perform eachpick.forward[ShardProf.?]
          nexteach
I am probably doing a horrible job of explaining what I am wanting, if so I'm sorry.
TobyFox2002 is offline   #4 Reply With Quote
Aaron
Senior Member
 
Join Date: Oct 2011
Posts: 6,793

Old December 7th, 2019, 01:06 PM
First, you cannot, AFAIK assign a tag with a wildcard, so I would expect "perform eachpick.assign[ShardProf.?]" to throw an error. So fix that to assign an actual tag, then confirm that the ShardProf tag you want is being assigned to the weapons you've chosen with the new feat.

If so, then all you need to do is alter the script in the material to run after the feat script which assigns the tag, and have the material script check for any ShardProf tag on the parent weapon before deleting Helper.Proficient.

If for some reason your foreach is NOT getting to the correct weapon picks to do that assign, then you need to look into what the fTargetId procedure is outputting for the "id" variable.

Also, what is the reason you're doing "eachpick.forward" in that script? Is something supposed to be checking for those tags on the hero for some reason?

Last edited by Aaron; December 7th, 2019 at 01:08 PM.
Aaron is offline   #5 Reply With Quote
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632

Old December 7th, 2019, 06:31 PM
Yeah, my thought process is kinda weird, sometimes I dont really even know what I'm doing half the time. Therefore, I was trying to create a dynamic tag and pull the idstring and use that as the tag id.

What I was looking to try and do, I found on the forums (took a while of searching was assignstr["ShardProf." & id] And then forward that to the hero so I could test for the presence of that tag. Ultimately, it failed. Herolabs just did not like what I was doing. I could assign those dynamically, just not using assignstr[].

After that I kinda relized I was doing this the hard way, and I should just assign ShardProf.IsShard or something like that to whatever weapon matched the user's choice.

After that, it works, the code is as follows for those who would like to use in the future:

In a Tags.1st file
Code:
<!-- Shard Weapon Material Proficiency Tags -->
  <group id="ShardProf" name="Shard Weap Prof" dynamic="yes">
    <value id="ProfAll"      name="All Weapons"/>
	<value id="IsShard"      name="Weap is Shard"/>
	<value id="AllSimple"    name="All Simple Weapons"/>
	<value id="AllMartial"   name="All Martial Weapons"/>
	<value id="AllExot"      name="All Exotic Weapons"/>
  </group>
Then I created a Shard Weapon Proficiency Feat with the following scripts

Pre-Levels/5000
Code:
      ~ If we're disabled, do nothing
      doneif (tagis[Helper.FtDisable] <> 0)

      ~ If we haven't chosen anything, get out now
      doneif (field[usrChosen1].ischosen + tagis[Target.?] = 0)

        ~ Assign the appropriate tag to all weapons that meet the criteria
        var id as string
        var name as string
        call fTargetId

        foreach pick in hero where "IsWeapon." & id
          perform eachpick.assign[ShardProf.IsShard]
          nexteach
And to set the userCandid
Final/10000
Code:
field[usrCandid1].text = "component.BaseWep & wCategory.Melee & (wType.P | wType.S) & !wFtrGroup.Natural"
It does not do everything I want, for example that code doesn't seem to allow it to interact with Martial Versatility, which I'd really like it to do. I know that the code is part of some of the other feats like exotic weapon proficiency, but I dont understand the code enough yet. I will play with it a bit and see if I cant figure it out.

As for the material

Mirror Shard (m35ShardWep)
The relevant portion that marks the weapon as non-proficient is the following:

PostLevel/10000
Code:
     perform container.parent.setfocus
     
     ~ If nothing is focused, get out now.
     doneif (state.isfocus = 0)

     ~ If we ARE proficient with shard, STOP NOW!
     doneif (focus.tagcount[ShardProf.IsShard] <> 0)
     perform focus.delete[Helper.Proficient]
If the IsShard tag isnt assigned by the Weapon Proficiency Feat... it will remove proficiency from the parent weapon. I could have probably done this with a Custom Tag. But I'd already made the tag, and the file is needed anyway by everything else of my work so it really doesn't matter if its all in one file.

Thanks for the help, and I hope these code snippets help people in the future.
TobyFox2002 is offline   #6 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 12:56 AM.


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