[2K3] COORDINATE CODING ISSUES

Posts

Pages: 1
EDIT 2: Actually, I think I figured out a additional method to add to this current code to get it to work. I feel so stupid posting this topic. I do this all the time. Post for help prematurely, and then figure it out seconds after. Hah...

EDIT: WAIT! NO! I GET IT! I FEEL LIKE A MORON. I AM SO SORRY! ...Though now I'm confused about whether or not this is the most efficient way to go about this sort of thing. Any additional insight is still appreciated. I don't exactly have a lot of people I can personally bounce theory off of for this stuff.

I feel like such a noob posting in this forum nowadays. But if ya need help then ya need help!

Anyhow, I've been working on a certain system that records the player's X/Y coordinates and then transmits that information to a common event that then displays images based on whether the player is on certain areas. It's a world map location name display sort of thing.

It all works out fine except for one glaring issue that I can't seem to figure out. The name of the location will slide in when the player stops on a location, but once they step OFF the event won't remove the picture. Checking the switch positions, I notice that a certain switch that the event is supposed to turn on, which activates the erasure of the image, won't actually turn on. And I can confirm that when I turn the switch on through the debug menu, that it does it's job.

The point of the issue here is that the event won't turn this particular switch on and I can't figure out why despite the coding looking solid, to my eyes at least. Anyway this is what I have.

First the coordinates are read.



Then the picture event is called. The first branch prevents the other coordinate branches from interfering, or else it would cause an infinite loop of the picture sliding in and out. The next two branches are the coordinates, and then the branch in the else handler is again there to prevent interference. And when the player moves off the location, that switch is supposed to turn on. ...Yet it doesn't. Which is the point of the matter.



Now when the player moves off then this event reads that switch that's supposed to be turned on.



....Which then calls this at last.



Now steps 3 and 4 can't happen because the switch in the else handler of step 2 never turns on for some reason. I'm pretty much lost and I feel like I've tried everything. Can anyone offer any insight?
You seem to be having trouble with your branches.
In step 2, you check if the player has removed itself from the y coordinate, but not from the x coordinate.
This means that your for first set of branches, the WorldKillLocation switch won't trigger unless the x is equal to 10 and y is unequal to 4.

You'd need an else case for both x and y branches. However you should avoid making branches with else statements unless you use both. It's slightly less effective, but more importantly it's messier. For the first branch in step 2, you should replace it with "if LocationON/OFF is not equal to 1"
author=Kazesui
You seem to be having trouble with your branches.
In step 2, you check if the player has removed itself from the y coordinate, but not from the x coordinate.
This means that your for first set of branches, the WorldKillLocation switch won't trigger unless the x is equal to 10 and y is unequal to 4.

You'd need an else case for both x and y branches. However you should avoid making branches with else statements unless you use both. It's slightly less effective, but more importantly it's messier. For the first branch in step 2, you should replace it with "if LocationON/OFF is not equal to 1"


Wow, I actually did not think about that one. The both branches thing on the coordinates. I completely get it now. Thanks for your input!
Pages: 1