• 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

Hide Spells

Frodie

Well-known member
I have a mechanic the hides spells of a certain spell level. I can't seem to get them to grey out. I think its a timing issue. I tried Post levels 10000 and 10500. Final and Render 9999999. First 10000 and Pre-Levels 10000.

Code:
if (hero.child[pFGMPDPL].field[pAdjust].value = 1) then
foreach pick in hero from BaseSpell where "sLevel.2 | sLevel.3 | sLevel.4 | sLevel.5  | sLevel.6  | sLevel.7  | sLevel.8  | sLevel.9"
     perform eachpick.delete[ClsAllowSp.?]
     perform eachpick.delete[ClsScAllSp.?]
     perform eachpick.assign[Hide.Spell]
     perform eachpick.assign[Helper.Obsolete]
  nexteach
endif

Any ideas? Thanks again yall!
 
So you're just hiding all non-zero level spells? you could just make the where statement !sLevel.0

Also do you mean for that to be the pAdjust field or pIsOn?
 
All spells but 0 and 1st. It has a counter and as the counter goes up it hides less and less spell levels. So yea, the pAdjust is what I need.
 
Are you trying to make them unselectable by a class? If so you'll want to push the ClDenySp.? tag to the class helper. If you're just trying to make them not appear, Hide.Spell should be sufficient.

Where are you trying to make them not show up?

I guess ability text would help a lot more.
 
Ah, the CLDenySp tag might do it. I just want to grey out the spells on the spellcasting classes when they go to pick them.

The ability text is a "wall of text" and this is just one part of it. Basically it's a mechanic with an adjustment bootstrapped to it, to put a "cap" on what spell level is available of the hero. I think the timing might be the issue.

Thanks for your help!
 
Hmm, also, picks won't work until they appear on the hero, you'll want things, and at the same time that's going to block lots of spells and the expr field isn't big enough for more than like 30-ish spells. What I'd do was create an eval rule that would throw an error if they selected said spell levels.

You could also make it modify the spell expression field completely remove them from selections with an "& (sLevel.0 | sLevel.1)"
 
I am trying this one, at post levels 10000, but still no luck.

Code:
if (hero.child[pFGMPDPL].field[pAdjust].value = 1) then
foreach pick in hero from BaseClass where "CasterSrc.?"
eachpick.field[cSpellExpr].text = "component.BaseSpell & (" & field[cSpellExpr].text & ") | (!sLevel.2 | !sLevel.3 | !sLevel.4 | !sLevel.5  | !sLevel.6  | !sLevel.7  | !sLevel.8  | !sLevel.9) & Helper.Obsolete & Hide.Spell"
nexteach
endif

Any ideas?
 
Don't you want eachpick.field[cSpellExpr].text, not field[cSpellExpr].text near the beginning of the equals sign?

Also, wouldn't it be easier to say "(sLevel.0 | sLevel.1)" than to exclude 8 different sLevel tags?

Another problem - do you want "!Helper.Obsolete", instead of "Helper.Obsolete"? Ditto for Hide.Spell? As written, you're only allowing it to choose spells that are obsolete and hidden.
 
Cool, Thank You!

Something like this?

Code:
if (hero.child[pFGMPDPL].field[pAdjust].value = 1) then
foreach pick in hero from BaseClass where "CasterSrc.?"
eachpick.field[cSpellExpr].text = "(sLevel.0 | sLevel.1)" 
nexteach
endif
 
Last edited:
From what I understand that you want to do, you're modifying existing classes, so that instead of showing their normal spell lists, they only show the level 0 or 1 spells from that list, right?

That'd be

Code:
eachpick.field[cSpellExpr].text &= " & (sLevel.0 | sLevel.1)"
 
Oh, and to find the right timing, use the Develop...Floating Info Windows...Show Selection Tasks, choose a class helper (like cHelpClr or cHelpWiz) and filter for "Spell" - that will tell you the phase & priority of the existing scripts that deal with spells. Try after each of those scripts.

You can also use debugging:

Code:
debug eachpick.field[cSpellExpr].text

To check that cSpellExpr has been filled in at the phase & priority your script is running. Since my suggestion is a simple &=, you want to make sure there's already something there before adding on to it.
 
Yep that's right, thank you. Is Post levels 10000 a good timing? I do what you have above to try and find it. Thank you again.
 
If the script making the change is at Post-Attributes/10000, don't you need to be after that timing, not at that timing?
 
Yep, after that timing. I am doing some testing to see what works best after 10000. I am thinking around 15000 or so. Thank you for all your help again!
 
Well, I have something wrong. I moved the script to a template just for testing (so I don't have to get restarting HL due to the mechanic). I tried after all the places I could find Post level, Post Att, Final and Render from 10100 to 20100. Nothing came up in the debugging. Is there something wrong with the script?

Code:
foreach pick in hero from BaseClass where "Hero.Caster"
debug eachpick.field[cSpellExpr].text
eachpick.field[cSpellExpr].text &= " & (sLevel.0 | sLevel.1)"
nexteach

Thank you again yall for yall help and time.
 
I think you can just use the "Class" component, in fact I think "BaseClass" is specifically the Class Level item in the editor, you want to check the Class Helper
 
Well I tried this at the same various timings, still a no go.

Code:
foreach pick in hero from Class where "Hero.Caster"
debug eachpick.field[cSpellExpr].text
eachpick.field[cSpellExpr].text &= " & (sLevel.0 | sLevel.1)"
nexteach

Maybe it's searching for the wrong thing, IDK
 
That's when I'd add

Code:
debug "found one"
debug eachpick.field[name].text
To figure out what my foreach was actually finding, so I could figure out if my problem was in the foreach.

Plus:
Code:
debug "gotten to the foreach"
before the foreach, in case something earlier in the script was stopping it from even getting there.
 
Back
Top