- Joined
- May 19, 2017
- Messages
- 111
- Reaction score
- 10
- First Language
- Italian
- Primarily Uses
- RMMV
Variable value is always correct: the problem seems to be the "-9999" operation (regardless of the entered value).how do you check the parameter?
I suggest using control variable and show text at several times between the lines of this event to check where it goes wrong.
Hope these are what you needI asked how you check the value and suggested the display to be included in this single event for a lot of reasons, because if you check the value outside the event something else can interfere and mess up everything.
so please change the event so that you display the attack value between your changes.
like
change parameter attack +9999
control variable temp = attack value
show text "attack value is ..."
change parameter attack -9999
control variable temp = attack value
show text "attack value is ..."
change parameter attack +variable
control variable temp = attack value
show text "attack value is ..."
and so on
In pic 2 when the max value of atk param is 9999 and then I subtract 9998 the result is still 300, that's not correct or, at least, MV is doing something I don't understand. The expected result should be 1 (complete reset of the param value)and what is the result of that event?
the code itself doesn't help me. If each number is the expected result then the commands work as intended - especially since you entered the correct expected results next to the numbers
(base + plus) * rate
base is the value from their current class at their level;plus is the permanent bonus from the Change Parameter (Modifica Parametro) command;rate is from traits, e.g. ATK * 120%.plus can be negative, and the overall minimum value for a parameter is 1 (or 0 for MMP). This is why you're ending up with 1 ATK when you add -9999. plus so that (base + plus) * rate equals 1.plus so that base + plus equals 1.plus to 0.(base + plus) * rate) using Control Variables > Game Data > Actor > ATK. So you could subtract that value instead of 9999, then +1 before applying your new value, e.g.◆Comment:Get (ATK - 1)
◆Control Variables:#0009 temporary = Attack of Harold
◆Control Variables:#0009 temporary -= 1
◆Comment:Subtract that from current ATK bonus: ATK - (ATK - 1) = 1
◆Change Parameter:Harold, Attack - {temporary}
◆Comment:Add new bonus
◆Change Parameter:Harold, Attack + {Harold ATK}
base or plus values:base ATK (param ID 2) of actor 1:$gameActors.actor(1).paramBase(2)
plus ATK of actor 1:$gameActors.actor(1).paramPlus(2)
I know this.But plus can be negative, and the overall minimum value for a parameter is 1 (or 0 for MMP). This is why you're ending up with 1 ATK when you add -9999.
you named that variable as "variable" instead of giving it a name that describes what it contains.(variable value)
No sorry, however it was a name I put there just for the example in the screenshot.you named that variable as "variable" instead of giving it a name that describes what it contains.
In my opinion that is a bad choice, because it might be that you have multiple variables with the same name "variable" - have you checked for that? That you might possible have confused different variables with different contents?
and sorry, my post above was abbreviated due to internet error, I wanted to write more but that part has been handled in other posts above.
Let's say my actor's atk = 500
Ok.
How is it possibile, then, that if I do Atk -9999 +300(variable value) -1 = 1??? Shouldn't it be 300?
500 - 9999 = 1 (as you said)
1 + 300 = 301
301 - 1 = 300 (my variable value)
There is something I can't understand since for MV the result is 1 instead of 300
(base + plus) * rateplus here?rate is 1, i.e. no traits like ATK * 150%.base + plus = 500.plus is 9999 less than in step 1.base + (plus - 9999) = 500 - 9999 = -9499plus is 300 more than in step 2.base + (plus - 9999 + 300) = -9499 + 300 = -9199Oh! Thank youThis is why you had to subtract the current attack for it to work as you wanted.
- Actor's ATK = 500 =
(base + plus) * rate
But what is the current value ofplushere?
Let's assumerateis 1, i.e. no traits like ATK * 150%.
=> Actor's ATK =base + plus= 500.
- Change Parameter: ATK -9999
Nowplusis 9999 less than in step 1.
So Actor's ATK =base + (plus - 9999)= 500 - 9999 = -9499
=> Actor's ATK = 1 (minimum value)
- Change Parameter ATK +300
Nowplusis 300 more than in step 2.
So Actor's ATK =base + (plus - 9999 + 300)= -9499 + 300 = -9199
=> Actor's ATK = 1 (minimum value)![]()