• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

User Content Error (Possibly)

Bluephoenix

Well-known member
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.
 
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.
 
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. :confused:
 
Since it is a tag, you should modify the tag, rather than the field... try:

perform delete[wClass.2]
perform assign[wClass.1]
 
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]
 
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.
 
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
if you're running your script before Pre-Levels/5000, or:

Code:
foreach pick in hero from BaseWep
  if (eachpick.field[wClass].value = 2) then
    eachpick.field[wClass].value = 1
    endif
  nexteach
If you're running your script after Pre-Levels/5000.

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.
 
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

looking back through the selection tag/feild debug lists, I found that the number is the value field, however I get syntax errors when I use the feild # (2,1,0) or the listed tag (Two-Handed, One-handed, Light)

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.
 
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
 
the second script from mathias does work, however when I go to equip the greatsword in 1 hand on the character, it automatically checks the second hand box regardless.

is there another field or tag that needs to be modified to prevent this behavior? the only tags dealing with how a weapon can be wielded that I could find in the selection tag/field lists was the wClass tag

edit: after trying both versions of the script only the second one at final-phase 90000 actually creates the desires change, still has the dual selection problem.
 
Can you just uncheck the 2nd hand box?

apologies, I should have been more clear on that. I tried, it doesn't even register I'm trying to, only unchecks both if I try on the 1st hand

after digging through the field list for violations after trying to equip both it and a shield, there is a wIs2nd field for the greatsword that is the likely culprit, however after adding an each field modifier I get the following error:

Syntax error in 'eval' script for Thing 'fMonkGrip' (Eval Script '#1') on line 4
-> Only derived fields can generally be modified via scripts (field 'wIs2nd')

the field is a simple 0 or 1 switch

current code (for reference)
Code:
final phase, priority 90000
foreach pick in hero from BaseWep
  if (eachpick.field[wClass].value = 2) then
    eachpick.field[wClass].value = 1
    eachpick.field[wIs2nd].value = 0
    endif
  nexteach
 
Last edited:
tried working with the script some more yesterday and today, can't seem to find any method to modify the wIs2nd field.

going to consign this to the impossible bin unless anyone else has any ideas. :(
 
Use the first script I gave you earlier, and make sure you're running it before Pre-Levels/5000 (say Pre-Levels/4000). Final/90000 is too late to do anything but alter the text.
 
Disregard last, I was messing something up on my end. got it working. (I feel like a complete idiot now :()
 
Last edited:
Back
Top