[RM2K3] 2K3 DOESNT ADD OR CHANGE VARIABLES.

Posts

Pages: 1
hello. im currently having a problem with rpg maker 2k3. i've been trying to make a health system for an enemy on the map but for some reason, the program ignores the add 5 to variable 39 but still goes through the rest of the event. it doesnt ignore the set variable command either, as when i set it to ten, the second page activates.

images of the events

i know im doing something wrong here, but i dont know what!
Marrend
Guardian of the Description Thread
21781
Ohhh, you've got a Wand of Blast-ing! Ba-da-boom ba-da-boom ba-da-boom!

More serious post, let's take a few steps back. The Control Variable command is behind three Conditional Branches, and all of them must return true.

The first Conditional Branch asks if the game-switch "attack1" is on/enabled. Is it? The next Conditional Branches essentially ask if the coordinates of the "bullet" are the self-same as the coordinates of the "enemy". If these variables are both derived from event positions, I'm wondering if both the "bullet" and the "enemy" in this scenario are both set to "Same Level as Hero". If so, I'm wondering if they would then collide/block each other, and therefore never actually meet, and those conditions would always fail?

Maybe try putting in a message box of "\v[25] = \v[27]?" after the first Conditional branch (the one that checks if "attack1" is enabled) as a way to test if/when the condition following it can be true.

I'm also thinking that getting the position of the "bullet" versus that of the "enemy" might not necessarily want to be on that event-page, but, let's try tackling one thing at a time!
well i'll definitely be sure to check that game out later!

anyways, the bullet event is set to below the player, so it does meet with the enemy event. the x and y conditions work fine, since the flash event works. for some reason, its only the add 5 event that doesn't work. sorry for not clarifying that.
Marrend
Guardian of the Description Thread
21781
I don't think I noticed the third image before concerning "EV0016", and maybe that's the issue.

So, here's my running theory. The auto-run on Page 1 of "EV0016" is setting the value of game-variable #39 ("nub1hp") to be 0, right? That processing is an ongoing process, occurring in parallel to the process that's occurring on Page 1 of "adbotNUB". So, the value of game-variable might increase by five by virtue of "adbotNUB", for a split second, but is then reset to 0 because of what's happening in "EV0016". If you're setting the variable to 10 via the F9 debug menu, or other means, that might be also why you can see Page 2 of "adbotNUB". Which means that my guess is that Page 2 of "EV0016" might also trigger when "nub1hp" is 10 or greater?

*Edit: The fact that "EV0016" activates a game-switch might indicate that it's Page 2 triggers on said switch, and that this thought-process is debunked. However, I don't see the contents of Page 2 of that event, so I feel inclined to think that, maybe, what I think is happening, is.

*Edit2: Probably the best way to debug this may be to check the value of "nub1hp" through the F9 debug window. At least, I think it's F9 in 2K/2K3? Sorry, it's been a while, and I'm used to the later (Ace, MZ) makers. I thought about suggesting the message window trick again, but, I forgot this process was a parallel process, and it might not necessarily pop up once.

the second page on event 16 is activated by the switch 34 from page 1. the page is blank so the event would only run once.

i tried the debug menu, the variable stayed at 0 every time the conditional branch was activated.
Marrend
Guardian of the Description Thread
21781
author=CD_RHYTHM
the second page on event 16 is activated by the switch 34 from page 1. the page is blank so the event would only run once.

Welp, there goes that theory!

author=CD_RHYTHM
i tried the debug menu, the variable stayed at 0 every time the conditional branch was activated.

This, however, is interesting. I think the best suggestion I can make at this juncture is to put in message boxes to display the contents of the variable both before and after the addition. So...


#stuff that comes before the following commands
CONTROL VARIABLES: Variable [39] += 5
MESSAGE BOX:
Variable #39 = \v[39]
WAIT: 0.0 second
MESSAGE BOX:
Variable #39 = \v[39]
#stuff that comes after this

...something like this. If it displays "Variable #39 = 5" both times, I'm somewhat inclined to say a different process sets it to 0, though, I can't say where that process would be. I could probably say the same thing if it displays "Variable #39 = 5" then "Variable #39 = 0". If it displays 0 both times, uuuuhhh, I might be out of ideas.

*Edit: The general idea here is to verify that the value changes to 5 at all, and then pin down when it gets set to 0. Like, something is setting it to zero, because I refuse to believe the "+=" operation is broken. Like, if you apply that operation outside the context of that event, or even on a completely separate map with no other events going on... that operation applies as normal, right?
i just gave it a try, both times showed zero in the message box :[ . thanks for the help though, i really appreciate it!
Pages: 1