Junior Member
Join Date: May 2018
Location: East Coast, USA
Posts: 12
|
The current quandary I stumbled upon is making a hierarchy stack to determine whether or not to increase the value of a Configurable. Currently I have this eval script (Post-Level, 10,000):
Code:
doneif (tagis[Helper.Disable] <> 0) if (#hasability[cHydroKinet] + #hasability[cGeokinet] + #hasability[cAirKinet] >= 0) then hero.childfound[cfgWildTalent].field[cfgMax1].value += 1 elseif (#hasability[cPyrokinet] + #hasability[cEE1PyroKinet] >= 0) then hero.childfound[cfgWildTalent].field[cfgMax1].value -= 0 endif Quote:
Quote:
Quote:
Quote:
Last edited by xWhiteGodx; September 23rd, 2019 at 05:54 PM. |
||||
#1 |
Junior Member
Join Date: May 2018
Location: East Coast, USA
Posts: 12
|
Necroing the hell out of this thread as it's still unresolved, even almost a year later.
The issue still persists - I can't figure out why the script won't deactivate or activate that bonus for other requirements being met. Script 2: Final Phase; 10,000 Code:
doneif (tagis[Helper.Disable] < 0) if (#hasability[cHydroKinet] + #hasability[cGeokinet] + #hasability[cAirKinet] > 0) then hero.childfound[cfgWildTalent].field[cfgMax1].value += 1 if (#hasability[cPyrokinet] > 0) then hero.childfound[cfgWildTalent].field[cfgMax1].value -= 1 endif endif >Assume Hero chooses Water for base element [cHydroKinet] >Hero reaches level 7, Hero chooses expanded element to dive into, or expands current element >If Hero chooses Fire as expanded element [cEE1PyroKinet], Hero should get [cfgMax1] +1 This does not happen. Why? I get no errors when saving and testing, but it doesn't actually do anything. Even if I put an elseif, nothing changes. I could always give an automatic [cfgMax1] +1 for reaching level 7, when the element can be chosen, but there's no way to reduce that by 1 if they pick a certain thing. I would really love help with this. The intent is that if the Hero has any element besides fire as the starting element to increase [cfgMax1] by 1, and not to if fire is the starting element. Last edited by xWhiteGodx; September 23rd, 2019 at 05:59 PM. |
#2 |
Senior Member
Join Date: May 2016
Posts: 608
|
Sometimes it's not just the scripting, but the timing. I see you've been in post-level and final phases, have you tried earlier? Have you tried moving the phase internal timing from 10000 to 15000 or earlier to 5000?
I assume you have, so here's a rewrite that doesn't require you to use a subtraction and nested if/then looping. Code:
doneif (tagis[Helper.Disable] < 0) ~ drop here if we have cPyrokinet already doneif (#hasability[cPyrokinet] > 0) ~ add 1 to my cfgMax1 otherwise. hero.childfound[cfgWildTalent].field[cfgMax1].value += 1 |
#3 |
Senior Member
Join Date: May 2016
Posts: 608
|
Also, the
doneif (tagis(Helper.Disable] < 0) seems off, i've only seen it in code as doneif (tagis[Helper.Disable] = 1) or doneif (tagis[Helper.Disable] <> 0) I'm not sure if the Helper.Disable count ever gets a negative number but wondering if it might not be initialized correctly during certain phases and that's kicking you out of the script altogether early. |
#4 |
Junior Member
Join Date: May 2018
Location: East Coast, USA
Posts: 12
|
Yea, I realized that it was set to a negative value, but it really didn't change/do much. Even using your script and making some small changes didn't do anything besides ignore the doneif (#hasability[cPyrokinet] > 0) section and automatically add to cfgMax1.
It seems that the eval script outright ignores the entire if unless it's >= 0 This is what I have for the script right now: Code:
doneif (tagis[Helper.Disable] <> 0) ~ drop here if we have cPyrokinet already if (#hasability[cPyrokinet] > 0) then ~ add 1 to my cfgMax1 otherwise. hero.childfound[cfgWildTalent].field[cfgMax1].value += 1 endif I honestly think the macro itself refuses to work in that scenario. In a 2nd script where I increase cfgMax2, 3, and 4 as part of grabbing the ability the scripts are on [cEE1PyroKinet]. Those work perfectly, and if I add Code:
~Increase Basic Blasts by 1 if (field[xTotalLev].value >= 7) then hero.childfound[cfgWildTalent].field[cfgMax1].value += 1 endif Code:
doneif (tagis[Helper.Disable] <> 0) ~ drop here if we have cPyrokinet already if (#hasability[cPyrokinet] > 0) then ~ add 1 to my cfgMax1 otherwise. hero.childfound[cfgWildTalent].field[cfgMax1].value -= 1 endif It's been driving me crazy. |
#5 |
Senior Member
Join Date: May 2016
Posts: 608
|
I did a search and I think the issue is with the abillity getting added in a configurable too late for #hasability[] to get a proper tag count and is always returning a 0 or being added via configurable isn't setting the right tag for #hasability to include it in a count.
ShadowChemosh talks about this in a thread here and suggests using hero.childlives[xxx] as the test criteria and also says #hasfeat[] has the same issue. I'm not sure if this will fix your issue, but it's worth trying. |
#6 |
Junior Member
Join Date: May 2018
Location: East Coast, USA
Posts: 12
|
Quote:
1 class 1 class level 16 class specials 131 custom abilities 25 spells The latter 2 will be increasing now that the piece of code correctly identifies it. Woop! |
|
#7 |
|
|