• 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

Activated ability on a magic weapon power

TheIronGolem

Well-known member
I write this for the sake of the future reader who needs a way to solve this problem. That reader will quite often be the future version of myself who has forgotten it.

So you've got a weapon power that needs to use an activated ability for some reason. In this specific instance, it's the Guided property from the Geomancer's Handbook (subs WIS for STR in attack/damage, prevents damage bonus from being changed by offhanding/twohanding, user can opt to use STR as a normal weapon but takes a -2 to attack if so). The weapon power needs a checkbox to denote when to alter the power's behavior (in this case, when the weapon is being used with STR and accepting the -2).

If you came to this thread looking for a solution, you've probably already noticed that checking "Show in Activated Abilities list" doesn't get a checkbox on your In-Play tab. Here's what you need to do instead:

  1. Create a generic Ability, presumably named after the weapon power.
  2. Check "Show in Activated Abilities list" on that Ability.
  3. Give the Ability this script at Render/999999999999999999999:
    Code:
    field[livename].text = field[thingname].text & " (" & parent.field[livename].text & ")"
    This is optional but nice to have, because it means the ability appears with the weapon's actual name instead of "Custom/magic weapon"
  4. Bootstrap the Ability from the weapon power.
  5. In any scripts for the weapon power that need to know whether the checkbox is checked, you can now use:
    Code:
    parent.tagis[Activated.XXX]
    ...where "XXX" is the id of the Ability you created.

So, for example, this enables you to have scripts that go:
Code:
      if (parent.tagis[Activated.XXX] = 1) then
        ~ do something
      else
        ~ do something else
      endif

I haven't tried this on armor powers, but I would expect it to work the same.

There you go, Future Self. Now stop playing 4X games and get back to work.
 
The other "simple" way is to just "equip" the weapon. By default activated powers do NOT display unless you equip the weapon. That is actually a nice option for those players that carry around 15 weapons with different powers. You wouldn't actually want all 15 powers displayed on the In-Play tab. :)
 
I wonder if we're talking about different things, or if there's some other factor at play. Because for me, putting User.Activation on the item power doesn't get me a checkbox whether the weapon is equipped or not. And the method I've described does hide the ability when the weapon isn't equipped (which actually surprises me since I didn't bootstrap it conditionally).
 
Good point. So here is the my version of the weapon power "Bane" I have in the community stuff. You can see it has the User.Activation tag on it.

What I wanted was for those using a Bane weapon and the iPad to be able to turn it on or off. But to have the Bane Activation display on the In-Play tab or the iPad you have to equip the weapon.

Going to verify this on the latest version of HL on my iPad............ Yep. No activation until I equip the weapon.

I admit I am at work and read very quickly. Are we on the same page?
 
Hmm, Idunno. I don't have an iPad so I can't easily determine how behaviors differ.
Well for that purpose it was just that only when equipped does the "Activated Ability" display on the "In-Play" tab. Its a different place on the iPad but the logic is the same as the "In-Play" tab on the desktop software. :)
 
Back
Top