Junior Member
Join Date: Jun 2011
Location: Canberra, Australia
Posts: 10
|
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 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 by KarlM; June 6th, 2011 at 09:05 PM. Reason: grammar! |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
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). |
#2 |
Junior Member
Join Date: Jun 2011
Location: Canberra, Australia
Posts: 10
|
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? |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
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. |
#4 |
Junior Member
Join Date: Jun 2011
Location: Canberra, Australia
Posts: 10
|
Quote:
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 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] So I'm thinking I must be missing something. Probably something obvious? |
|
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
That seems like it should work. Can you send me a copy so I can fiddle with it? PM for e-mail address.
|
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
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. |
#7 |
Junior Member
Join Date: Jun 2011
Location: Canberra, Australia
Posts: 10
|
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? |
#8 |
Senior Member
Volunteer Data File Contributor
Join Date: Mar 2007
Posts: 1,245
|
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. |
#9 |
Junior Member
Join Date: Jun 2011
Location: Canberra, Australia
Posts: 10
|
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 |
#10 |
|
|