Senior Member
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632
|
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. |
#1 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
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.
|
#2 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
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] Usual disclaimer about code being untested and may need tweaking. |
#3 |
Senior Member
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632
|
Quote:
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 |
|
#4 |
Senior Member
Join Date: Oct 2011
Posts: 6,793
|
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. |
#5 |
Senior Member
Join Date: Nov 2013
Location: Andover, Ma
Posts: 632
|
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> 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 Final/10000 Code:
field[usrCandid1].text = "component.BaseWep & wCategory.Melee & (wType.P | wType.S) & !wFtrGroup.Natural" 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] Thanks for the help, and I hope these code snippets help people in the future. |
#6 |
|
|