• 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

Activating one Special Ability of several

KarlM

Member
Hi

I'm trying to write a feat, which has several options. Depending on which option is chosen, I want a different Special Ability to show on the Specials tab.

So far, I can offer the choice with a custom expression in the feat based on a user tag denoting the set of possible abilities.

I can write an eval script in the feat to set another user tag on the hero denoting which special ability to activate.

I can see (using the hero tags floating info window) that the second tag gets set on the hero.

How do I either activate the relevant ability with a script in the feat or with a script in the ability?

I tried an eval script in the ability along the lines of
Code:
if (hero.tagis[User.Abil01] <> 0) then
  perform assign[Helper.ShowSpec]
endif

But I'm not sure what to do to get that script to run, or if - when it is run - it will do what I want.

Should I instead set ShowSpec on the tag from the feat? How do I do that?

Is in fact setting ShowSpec the right thing to do?

Help?

Thanks
Karl
 
Last edited:
I think you have the right idea. What I would do is make one or more specials (with whatever eval scripts necessary on them) for the different feat choices, then bootstrap them to the feat.

From there 2 ways to go. Each could have a bootstrap condition searching for a certain tag on the hero before adding themselves. Or you could have an eval script on the specials searching for the certain tag and applying the Helper.ShowSpec tag to itself (and whatever other Evals check for the ShowSpec tag before proceeding).
 
Thanks. This is exactly the point I am at. I have several different specials bootstrapped to the feat. I'd figured out roughly that those are two different ways to tackle the problem, but I have minimal exposure to this environment, so I don't know how to implement them.

Can you give me more specific guidance?

I do not know how to do either of your two options!

The code I wrote is an attempt at your second option (as an eval script on a special). What phase and priority should I choose for it?
 
Go with method 2 then.

Well I assume you wrote an eval script on the feat to assign the tag to the hero. As long as the eval scripts on your specials run at a later phase and priority than the script assigning the tag then they should be able to detect that tag and show themselves.
 
Well I assume you wrote an eval script on the feat to assign the tag to the hero. As long as the eval scripts on your specials run at a later phase and priority than the script assigning the tag then they should be able to detect that tag and show themselves.

Yes exactly. However I cannot get that to work.

I have a tag, User.PickAbil, assigned to two different specials, Abil01 and Abil02. In the feat, Custom Expression has the value User.PickAbil. That part works fine.

I have this script on the feat (wrapper stuff copy/pasted from other people's work, including yours! thanks so much btw!)
Code:
Pre-Levels, 4500, 1

~ If we're disabled, do nothing
doneif (tagis[Helper.FtDisable] <> 0)
 
~ If we haven't chosen anything, get out now
if (field[fChosen].ischosen = 0) then
  done
endif

~ Assign an appropriate tag to ourselves depending on choice
if (field[fChosen].chosen.tagis[User.Abil01] <> 0) then
  perform hero.assign[User.Abil01]
elseif (field[fChosen].chosen.tagis[User.Abil02] <> 0) then
  perform hero.assign[User.Abil02]
endif
 
~don't show us when printed
if (state.isoutput <> 0) then
  perform assign[Helper.FtHide]
endif

I can bring up the hero tags window, with no choice made, and neither tag is assigned. I can choose Abil01 or Abil02, and see the appropriate tag assigned to the hero. I can swap between the two choices and see the tag change. So that part works ok as well.

This next part doesn't work. In the special called Abil01, I have this eval script:
Code:
Pre-Attributes, 5000, 1

if (hero.tagis[User.Abil01] <> 0) then
  perform assign[Helper.ShowSpec]
endif
perform hero.assign[User.Abils]

I'm assigning the User.Abils tag on the hero, in order to demonstrate to myself that the script has in fact run: this tag never appears.

So I'm thinking I must be missing something. Probably something obvious?
 
That seems like it should work. Can you send me a copy so I can fiddle with it? PM for e-mail address.
 
Alright, I see your problems now, the specials you made are not being added to the hero when you add the feat. Since they aren't present they can't detect the tag and perform any actions.

You need to link your specials to the feat by bootstrapping them so that they are added together. Click on the Bootstrap button on the feat and enter unique IDs for each of the specials you want to select from.

Second, the specials for the various starsigns have their "Show in Specials List" and "Show in Charges List" checked. This means they will already show by default when the feat is added. Unclick those so they are invisible by default.

Third, the only special with the Eval script is "The Rose", so copy and modify that to the other specials. That way when the special detects the correct tag, they will apply the appropriate Helper to show themselves.

Aaaand, I think it will work out then. If you have any more problems please post.
 
awesome, thanks for checking that out. I really appreciate it. It makes sense, I'll check it out when I get home.

What's the difference between using the bootstrap button and the specials button to link a special to a feat?
 
I need to clarify some terminology, please do not take offense.

In the editor there are many types of things that can be created, like spells/races/feats etc. These are listed near the top in a series of tabs. These are purely to organize similar things together, and I think you meant the special tab when you said the special button. If not then tell me what you meant by "specials button" because I am aware of no such thing.

Specials can be linked to many things (classes, items, feats, etc) so bootstraps are the way to go.
 
No offense taken, clarification welcome, especially with extreme newbies like me around :)

I understand what you mean by the specials tab. what I was referring too, is within the configuration for a feat. you hit the feat tab, select a feat, in the center window scroll down a ways. one of the many things to configure is a button marked specals, which will give you a list of things defined using the specials tab
 
well of course that button doesn't exist for a feat.... Doh! I was thinking of classes and races and templates.

Your pointers were accurate, Lawful_g, thanks again for your help.
 
Ah. I see what you mean now. The specials button on those things is the same as bootstrapping, just a shortcut to a certain category of things.
 
Back
Top