SKILL THAT REMOVES STATE
Posts
Pages:
1
I have a skill (Jump). It adds the Jumped state to the user.
The Jumped state adds the skill Land.
I have done both successfully.
Goal: upon use of Land, I need to remove the Jumped state. I'm trying to accomplish this using a damage formula. Let me know if there's a better way to go about it.
My attempt: a.atk * 5 - b.def * 2; a.remove_state(35)
Problem: using the skill doesn't do any damage. Add state: Normal Attack 100% is in the Effects box.
Thanks in advance!
The Jumped state adds the skill Land.
I have done both successfully.
Goal: upon use of Land, I need to remove the Jumped state. I'm trying to accomplish this using a damage formula. Let me know if there's a better way to go about it.
My attempt: a.atk * 5 - b.def * 2; a.remove_state(35)
Problem: using the skill doesn't do any damage. Add state: Normal Attack 100% is in the Effects box.
Thanks in advance!
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
I was gonna suggest a script, but I guess your way works too. Try this damage formula:
a.remove_state(35) ? a.atk * 5 - b.def * 2 : a.atk * 5 - b.def * 2
That's an awful way of doing it and I want to punch myself a little, but it should work. It's a stupid workaround to get a line of code to run before calculating the value.
In the future, post topics like this in the help requests section. Thanks.
a.remove_state(35) ? a.atk * 5 - b.def * 2 : a.atk * 5 - b.def * 2
That's an awful way of doing it and I want to punch myself a little, but it should work. It's a stupid workaround to get a line of code to run before calculating the value.
In the future, post topics like this in the help requests section. Thanks.
It works! Thank you! Could you explain how it works? Or barring a full explanation, just enough that I know how to duplicate it for other skills?
Thanks again, and sorry for posting in the incorrect section.
Thanks again, and sorry for posting in the incorrect section.
The damage algorithms in Ace gets fed into an eval and the return value thrown into a variable. Because it is Ruby everything returns a value. LockeZ's code can be interpreted as:
The remove_state will kill the state and implicitly return a value which will be evaluated for the conditional. The value doesn't matter as both code branches lead to the same code, the damage algorithm, which in turn is fed to the damage result for the script backend to handle. It's messy but that's eval for ya.
I'm not certain how something like x = eval(a; b;), I'd assume it would set x to the last statement in the eval. I'd try something like:
As it will maintain the state until after the damage is calculated so the state can have stuff like atk buffs or whatever. Assuming eval will evaluate it the way I hope it does.
if(a.remove_state(35) damage = a.atk * 5 - b.def * 2 else damage = a.atk * 5 - b.def * 2
The remove_state will kill the state and implicitly return a value which will be evaluated for the conditional. The value doesn't matter as both code branches lead to the same code, the damage algorithm, which in turn is fed to the damage result for the script backend to handle. It's messy but that's eval for ya.
I'm not certain how something like x = eval(a; b;), I'd assume it would set x to the last statement in the eval. I'd try something like:
x = a.atk * 5 - b.def * 2; a.remove_state(35); x;
As it will maintain the state until after the damage is calculated so the state can have stuff like atk buffs or whatever. Assuming eval will evaluate it the way I hope it does.
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
Yeah, explaining what it does is probably just confusing, since what it does has very little to do with what I'm doing with it.
the short version of the explanation is that a ? b : c runs the code in part a, and then uses the formula in either part b or part c. For your purposes, part b and part c need to be the same.
the short version of the explanation is that a ? b : c runs the code in part a, and then uses the formula in either part b or part c. For your purposes, part b and part c need to be the same.
Pages:
1














