IS RPGMAKER2K3 UNABLE TO UNDERSTAND SUBTRACTIONS?

Posts

Pages: 1
Here are 2 examples:

I made a Kraken Monster, the idea was, over time (turns elapsed on the Kraken's side), it spawns tentacles (max 3 hidden tentacles, being revealed one after another every 2 turns). For every tentacle, a variable ("tentacle attack") adds +1. Meaning, after 3 spawned tentacles, we have a value of 3. The same value lowers by 1 every time a tentacle gets killed.
The result is a number between 0 and 3. In the end, after a certain time, Kraken casts a skill (or better said, I make an event that shows a battle animation over my team + the planned damage). Skill damage= value of the Variable "tentacle attack" multiplied with 180~200. So, the more tentacles alive at this point, the more damage dealed to my party. Works fine as long as I don't kill a single tentacle. because as soon as I do, rpgmaker2k3 is in front of a math it can't solve - a subtraction. It also doesn't work with using a different variable for the kills and then subtracting the amount of tentacle attack. It also doesn't work if I change subtract 1 into add -1. It also doesn't work if I use Branches. The result stays the same, first the game "freezes" for like 2 seconds (probably desperatedly trying to solve the math) and then no damage is dealed to anyone.


Another example:

A gravity skill supposed to cut HP depending on my current HP.

Branch if Hero A is in the party
Variable "Hero A HP 1" = the actual HP of Hero A
Variable "Hero A HP 2" = the actual HP of Hero A
Variable: "Hero A HP 1" / 4 (it works fine until here, a gravity spell that lowers my HP by 1/4 or 1/2 works perfectly fine because it doesn't ask for substractions)
Variable "Hero A HP 2" - "Hero A HP 1"
Change HP: decrease by "Hero A HP2" (decreasing HP btw is the only subtraction that works for me)

What happens? My character loses the same amount of HP he has left...
Do you really think the option would be there if rm2k3 could handle it? =P Something must be wrong with your code. My guess is that the subtract command gets repeated every 'turn' and the numbers actually go into negatives, so when the damage calculations are done the result is obviously 0. ...Post a screenshot of you battle events so we can be sure what it is and how to fix it.
I've deleted the event for an alternative "solve", the new code works better but still doesn't do the job right. Here are the pages:

http://i637.photobucket.com/albums/uu97/Moongrape/tentakel1_zps819dd9a9.jpg

And here is the problem:
Weather or not 1 tentacle survives, the value stays 1. Well, or not... it's the damage staying at 1x the random damage number. Or well... not even that, because it would recognize at least a conditional branch set like that:

I've tried reducing the random damage by 1/2 and instead adding +2 instead of +1 of the value (tentaclepower) per tentacle. And set the branch to "if value higher than 1" -> consequence of the skill (damage) / else: no damage. And it didn't recgonize the value at 1, it was again at 2, even when I killed 3 tentacles before turn 7 started. Also tried adding +1 to the value at the very start of the fight, so it might recognize 1 rather than 0, but that didn't work out as well. It always recognizes th damage of 1 tentacle alive, weather ot not 1 or no tentacle is there.

Also, the gravity spell:

http://i637.photobucket.com/albums/uu97/Moongrape/gravity34_zpse0b1f575.jpg
Well, regarding the gravity spell; my guess is that since the event is set to 'parallel process' it gets repeated many times over almost instantly, so the character ends up dead. To ensure rm2k3 'reads' the code just once, set the event to 'On call' instead. Or add a command at the end of the code, turning off the switch that triggers the event.

As for the other thing; I'm sorry to inform you, but the way rm2k3 handles turns is messed up. For example, if you set an enemy to cast a spell in turn 3, but a character or another enemy acts in that turn, said spell will never be cast. So is probable that some of your events are not triggering correctly... What you can do is set and event adding +1 to a variable every turn of battle, and then triggering your events based on that variable, instead of turn numbers. - Of course, that's a whole can of worms on its own.
No it's not because of the Paralel Process, otherwise the gravity 1/2 and 1/4 spells wouldn't work as well for me. It's one of the (or both) lines that subtract the HP.

As for the Kraken, the code messed up even more when the battle had some more turns on my side. I finally (after a dozen of fails with Switches and Branches as well), I finally came up with a code that works. It's as hardcore as much as it makes me hate rpgmaker 2k3 (I mean honestly, this is hardcore for only wanting a damage based on 3 tentacles survivability).


Anyways, this could be useful to anyone, so I'll write down the code here.

How it works: A Boss spawns 3+ Minions on the battle field, and after a while, he will use a high damaging AoE spell. The damage is based on how many minions are left then.

Let's call the Boss Thaddäus - a Kraken. And his minions are Tentacles.
Place the 3 Minions as 1st 2nd and 3rd monster, the boss as 4th. Make the 3 tentacles invisible.

Page 1: Monster Turns Elapsed

Message: Thaddäus raises a tentacle!
Show Battle Animation: Watersurface (I made water rings appear around the tentacle as a battle animation to have something more interesting than just a tentacle popping out of nowhere)
Show Hidden Monster: 1:Tentacle
Switch Operation: ON

Page 2: Monster Turns Elapsed

Message: Thaddäus raises a tentacle!
Show Battle Animation: Watersurface
Show Hidden Monster: 2:Tentacle
Switch Operation: ON

Page 3: Monster Turns Elapsed

Message: Thaddäus raises a tentacle!
Show Battle Animation: Watersurface
Show Hidden Monster: 3:Tentacle
Switch Operation: ON

Page 4: Monster 's HP between

Switch Operation: OFF

Page 5: Monster 's HP between

Switch Operation: OFF

Page 6: Monster 's HP between

Switch Operation: OFF

Page 7: Monster Turns Elapsed

(Now it gets hardcore)

Message: Tentacle Orgy!!!

Branch if Switch is ON
>Show Battle Animation: Tentacle Power (my skill animation), Entire Party
>Variable Oper: Set, Rnd (or whatever damage want it to be]
>Change HP: Entire Party's HP V Remove
>Change Monster Condition: 1: Tentacle K.O. Inflict (if you want to have them stay alive, make sure to add a line that turns the switch for each tentacle off)
>Wait: 0.0 Sec (this is needed to make things not overlap)
>>Branch if Switch is ON (Inside the same Branch as above)
>>Show Battle Animation: Tentacle Power Entire Party
>>Variable Oper: Set, Rnd
>>Change HP: Entire Party's HP V Remove
>>Change Monster Condition: 2: Tentacle K.O. Inflict
>>Wait: 0.0 Sec
>>>Branch if Switch is ON (Inside the same Branch as above)
>>>Show Battle Animation: Tentacle Power Entire Party
>>>Variable Oper: Set, Rnd
>>>Change HP: Entire Party's HP V Remove
>>>Change Monster Condition: 3: Tentacle K.O. Inflict
>>>Wait: 0.0 Sec

>>>End

>>Else Handler (from the second Branch)
>>>Branch if Switch is ON (Inside the same Branch as above)
>>>Show Battle Animation: Tentacle Power Entire Party
>>>Variable Oper: Set, Rnd
>>>Change HP: Entire Party's HP V Remove
>>>Change Monster Condition: 3: Tentacle K.O. Inflict
>>>Wait: 0.0 Sec

>>>End

>>End

>Else Handler (from the first Branch)
>>Branch if Switch is ON (Inside the same Branch as above)
>>Show Battle Animation: Tentacle Power Entire Party
>>Variable Oper: Set, Rnd
>>Change HP: Entire Party's HP V Remove
>>Change Monster Condition: 2: Tentacle K.O. Inflict
>>Wait: 0.0 Sec
>>>Branch if Switch is ON (Inside the same Branch as above)
>>>Show Battle Animation: Tentacle Power Entire Party
>>>Variable Oper: Set, Rnd
>>>Change HP: Entire Party's HP V Remove
>>>Change Monster Condition: 3: Tentacle K.O. Inflict
>>>Wait: 0.0 Sec

>>>End

>>Else Handler (from the second branch of first Branches Else Handler)
>>>Branch if Switch is ON (Inside the same Branch as above)
>>>Show Battle Animation: Tentacle Power Entire Party
>>>Variable Oper: Set, Rnd
>>>Change HP: Entire Party's HP V Remove
>>>Change Monster Condition: 3: Tentacle K.O. Inflict
>>>Wait: 0.0 Sec

>>>Else Handler (from this Branch)
>>>Message: No Tentacles left...
>>>Play Sound: evade1



Rpgmaker doesn't understand if you make 3 Branches one for each tentacle, it will only play the first branch. Also, if you make just 3 Branches inside of each other, it will oly work if the first tentacle is alive. If the first tentacle dies, you need to add the other 2 tentacle branches into the else handler (for if the tentacle dies) again. This also occurs with the 2nd tentacle, it needs to add the 3rd tentacle Branch twice, for the actual branch and for the else handler of its branch. Then for the last tentacle, there is only an Else Handler once. For the time when the first two tntacles already died (meaning, in the else handler of the second tentacle's branch in the else handler of the first tentacle's branch....). Then, a message pops up that the skill can't be cast because all tentacles are dead.

The code in my case deals damage 3 times (one for each tentacle). It's AoE -> tentacle vanishes, AoE -> tentacle vanishes etc.
If you want one big damage instead, you're best off using variables. Remove the line for the battle animation and damage from every branch and add the variable operation set+1 instead (lets call it tentacle add). Then in the final Branch (3rd tentacle), add the skill animation, as well as make a new variable for damage (tentacle damage), set it to whatever damage you want (the damage for 1 tentacle alive), then multiply it with the variable "tentacle add". This way, the damage from tentacle damage will multiply with 1,2 or 3, depending on how many tentacles we have left.
What works better is taking out the Else (doing this makes it so it doesn't rely on the other conditions being wrong) and have each condition just be if it's true. Doing that might actually make it possible to have multiple conditions active.
Uh, well, you wouldn't think I was torturing myself with this code if I hadn't been trying it the other way around before? :P
The thing is, in battles it seems like only the first branch is triggered, while the others are ignored.
Pages: 1