Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
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 |
#1 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
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? |
#2 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
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.
|
#3 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
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. |
#4 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
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! |
#5 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
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)" |
#6 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
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 |
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#8 |
Senior Member
Join Date: May 2007
Location: Durham, NC
Posts: 1,747
|
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 by Frodie; September 28th, 2015 at 08:35 AM. |
#9 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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)" |
#10 |
|
|