• 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

Weapons as Proficient?

TCArknight

Well-known member
Ok, here's my bind. :)

I'd like to be able to show if a weapon is proficient on the Weapons tab, but the only ones that I can do are Simple weapons at the moment because that's the only proficiency that hasn't changed with D20 modern.

Simple Weapons Prof. uses hero.assign[Hero.ProfSimple]. How does that work exactly? is there a way to assign a user tag in the same way ( for example, archaic weapons prof. allows proficiency with all archaic weapons so is there a way to do a ProfArch tag in the same way as the ProfSimple one)?

Also, I'd like the same for specific weapons chosen (like Exotic Melee, etc...)

Suggestions?
 
Yes, add the tag and then do a foreach looking for all weapons with it and assigning the Helper.Proficient tag. It won't show as proficient until actually added to the hero though.
 
Ok, I'm trying this:

Code:
      foreach thing in BaseWep where "User.ProfArch"
        debug "id: " & eachthing.idstring
        
        perform eachthing.assign[Helper.Proficient]
        nexteach

And the ids displayed are correct for each of the Archaic weapons in the files. But I'm getting an error message on recompile that the script is invalid under the circumstances.

Is there a way to use : "call ChosenProf" in this foreach?

Any suggestions?

Thanks!
TC

PS: More and more it seems the need arises to be able to assign tags to things before they're added to the hero. Any chance of getting a macro or function to do that? :)
 
Last edited:
Within a "foreach thing" you can't use assign. Only "foreach pick" - until something is present on the hero, you can't assign tags to it or alter its fields.
 
Figured it out! :)

Code:
[U]running at First/1000[/U]

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

      var wpn as string

      foreach thing in BaseWep where "User.ProfArch"
        wpn = "WepProf." & eachthing.idstring
        perform hero.assignstr[wpn]
        nexteach

The weapon then appears as proficient on the Weapon Selection screen as well as when chosen.

I think the same principle could be applied if choosing armors, etc that are considered outside of the normal D20 dataset ...

TC
 
coding note:

Code:
perform eachthing.forward[WepProf.?]

will accomplish the same thing as:

Code:
wpn = "WepProf." & eachthing.idstring
perform hero.assignstr[wpn]

Identity tags like WepProf.? do exist while the choice is still a thing, so you can have the thing you've found forward tags that match the selected pattern to the hero.
 
Mathias,

I tried your suggestion and I get:

Attempt to forward tags to an implied pick context with no identifiable container.

Is it something about not having hero. somewhere in that forward?

TC
 
What is this script on?

forward ought to always forward to the container of whatever runs the script. Except for the weapon stats on a custom or specific weapon, that's the hero.
 
You may need to use

perform eachthing.pulltags[WepProf.?]

and then after the foreach:

perform forward[WepProf.?]

It's still 2 lines, but it avoids using the computationally expensive assignstr.

(it will also leave WepProf tags on whatever's running the script, so make sure they won't mean anything there).
 
Ah, ok.

Yeah, with all the weapons that could be involved, easing the computational strain is a bonus. :)

I'll give those a shot.
 
Back
Top