Member
Join Date: Nov 2010
Posts: 70
|
was making a fighter character as an NPC today and attempted to use a medium greatsword (equivalent to a large longsword) along with a heavy steel shield while using the monkey grip feat.
according to the mechnaics of the feat, it should allow any character using the feat to wield a 2-handed weapon of the same size category one handed, or a weapon 1-size category larger in both hands. I also note that a weapon that is a larger size category then the hero is unselectable with or without the feat. after digging to the feat, it appears there is no script to modify the weapons or the character abilities to enable the selections. was this because of inability for the script to modify the needed stuff or some other reason? just kinda curious, as its a feat I use often and would like to get working if possible. |
#1 |
Member
Join Date: Nov 2010
Posts: 70
|
Took some time to work on this today, so far I've made a little headway, trying to figure out what tag/pick governs the type of the weapon (2-hander/1-hander) so that I can use a foreach to adjust 2handed weapons that don't have the "always 2 hands" option active to 1 handers when the feat is applied.
I had hoped the improved critical feat would have been close enough to borrow parts of its eval script, but it forwards an element I can't find the source of instead of having anything I can repurpose. the second issue of allowing the use of weapons 1 size cat larger is much more complicated, and I can't find any workable starting point for that yet. TL;DR: looking for the 1-hand/2-hand tag on weapon picks to use a script to adjust it. |
#2 |
Member
Join Date: Nov 2010
Posts: 70
|
well, I found the weapon type tag for handedness, though it is resisting all attempts to modify it while the item is picked on the hero.
Code:
foreach pick in hero where "wClass.2" each.field[wClass].value = 1 nexteach by all rights that should work, especially in final phase, but no matter what I do to it; it never seems to work. I'm stumped. |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Since it is a tag, you should modify the tag, rather than the field... try:
perform delete[wClass.2] perform assign[wClass.1] |
#4 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
BTW, Lawful_g, there's been a new addition to HL's scripting language that allows your code to be simplified:
Code:
perform tagreplace[wClass.2,wClass.1] |
#5 |
Member
Join Date: Nov 2010
Posts: 70
|
giving that a try it now throws an error:
syntax error in eval script on line 2: tag wClass.2 not defined previously it accepted the wClass.2 tag on line 1 for searching, now it doesn't recognize it? also tried mathias' version of the statement, same error. |
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Did you include the each? As in:
perform each.delete[Whatever] |
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
The text in the search term isn't tested for correctness, it's just searched on.
Assignments and Deletions are checked to make sure they match the list of allowed tags. Code:
foreach pick in hero from BaseWep where "wClass.TwoHanded" perform eachpick.tagreplace[wClass.TwoHanded,wClass.OneHanded] nexteach Code:
foreach pick in hero from BaseWep if (eachpick.field[wClass].value = 2) then eachpick.field[wClass].value = 1 endif nexteach At Pre-Levels/5000, the tags that are defined in the editor are converted into a numerical field, and only the field is manipulated after that. |
#8 |
Member
Join Date: Nov 2010
Posts: 70
|
current code that is throwing the error:
Code:
Final phase, priority 90000 foreach pick in hero where "wClass.2" perform each.tagreplace[wClass.2,wClass.1] nexteach for the class information I simply looked at the longsword, greatsword and shortsword. when done the script should allow the greatsword to be wielded in either hand as a 1-handed weapon. |
#9 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
Try Mathias' script:
foreach pick in hero from BaseWep where "wClass.TwoHanded" perform eachpick.tagreplace[wClass.TwoHanded,wClass.OneHanded] nexteach and move the priority earlier, like he said, to before Pre-Levels 5000 |
#10 |
|
|