View Single Post
TobyFox2002
Senior Member
 
Join Date: Nov 2013
Location: Andover, Ma
Posts: 618

Old December 7th, 2019, 07: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