Eventing Problem, can anyone help me troubleshoot?

Hi, so this is my first time posting here, so I hope I've put this topic in the right forum, and I'm able to provide adequate information for assistance. Here is my problem:


I am currently working on a project that will have a character running away from enemies on-screen, and be able to place traps or use items to hinder or defeat them. So far I've created a debug room of sorts to test out mechanics of having a bomb laid out that when the enemy sprites walk over them, they will explode and die. The trouble I'm having is with a conditional branch that is behaving oddly. The scripts I have running are Yanfly's Region Restrictions, and Yanfly's Event Chase Player. Here are screenshots to illustrate my problem:

Spoiler
Bomb-Position.jpg



 





Orc-Position.jpg


Just here to show that the orc's starting position is 10, 0.



 





Track-Movement.jpg



 





Orc-Script1.jpg



 





Bomb-Script.jpg



 





Debug-variables.jpg



 





Bomb-Script-Constant.jpg


I think that should be everything, but please let me know if there's any additional information I can provide. I have been stuck on how else to fix this problem... Thank you in advance to helping! 🙂  


P.S. I completely realize the title has a typo spelling stealth. I just haven't gone in to fix the project title, haha.

Lastly, I decided to check by changing the variable values of the orc against a constant value of a non-moving bomb. In this case, the behavior code triggers as intended, with the bomb only going off when the orc reaches the bomb's position. Confusingly, the codes works as intended if I use a constant for just the x value, a constant for just the y value, and both as constants. The trouble comes up only when the game checks for both values as variables. I have also switched the order of the checks to see if that helped at all, but it does not. To my understanding, the nested conditional branch here should be syntactically the same as a coded "AND" check. I would like to be able to use variables since I would like the player to be able to set these "bombs" (likely to change to another trap to fit the tone of the game) in non-fixed locations. 




When I start the game, the events highlighted in green immediately trigger, and here are the debug variable values in a game test. As you can see, while the x coordinates match, the y coordinates do not.





To the best of my logic, this should work, as the bomb coordinates are checked against the orc's coordinates continuously, and should only activate once both conditional branches are met. However...





Here is the orc's event page. The contents are just behavior that shows an animation of the enemy killing the player, with event touch as its trigger. The second page's only difference is showing a condition where the orc has been killed via a switch that goes off in the bomb's event, which I will show next.





Here is the empty event on the far left. It is used to continuously track the coordinates of various events, in this case the orc position and bomb position are relevant.









The relevant events here are the orc in back, the button that triggers the bomb, and the empty event on the far left. I also put this up so you can see the bomb's current position is 10, 3.


Edit: Really sorry but I seem to have nested spoiler tags on accident... Kind of difficult to edit back properly while typing this on an iPad. The question has been resolved, so please ignore this question.
Just a guess; could be wildly wrong, but...


When the game is launched, the variables Bomb Y and Orc Y are both 0, therefore equal, so explosion. It takes time for the Tracker to actualise the Orc Y. Could you set different values for the Bomb Y and Orc Y variables right at the outset and see if that changes anything..?


As a test, at least, try turning on a switch at the end of the Tracker commands, to turn on the Bomb, which can only explode if the Tracker has had at least one run, thus capturing the differing variables..?


Ignore this if it's nonsense.  🙂
That's something worth looking into. I'll have to try this later tonight when I have time to fiddle around on the program. Thanks for the response; I'll let you know if I can solve it with that at all. 🙂


Edit: That was the issue. It seems at the initialization process, at the same time as it sets the variables as the event coordinates, for a split second they must all start at (0,0) and be placed on their positions at runtime. Therefore, since the bomb is checking at the same time as events are being positioned, the conditions are met for the explosion.



What I ended up doing is pushing forward to the next step (using a common event to set bombs via button push) and at the same time of moving the bomb event to the character's position, it flips a switch to say "bomb" is set, and creating a blank placeholder "bomb" event. On its second page, the bomb will appear if the "set bomb" switch is activated. My next step will probably be making a limit to the number of traps that can be set at a time using variables instead of switches.


TL;DR version: Your response made me think about the initialization of event coordinates when entering a map. The key was giving the program a chance to set the events BEFORE checking for triggering an explosion. Thank you for your suggestion; it really wasn't nonsense 😛  
Just as an aside, could I suggest that the screen shots be put between 'spoiler' tags, like this ...

Spoiler
rnmvFZr.png



It makes scrolling through the thread so much neater..? Just sayin'.
Absolutely! I apologize as I've honestly never used screenshots like this and thought about forum etiquette before, but I will be sure to do that from here on out.
R91KekF.gif



Proof once again, as if it was needed, that it only takes a fresh pair of eyes to see something that's in plain view. I wouldn't like to say how many times I've stared at a page, only to have someone glance over my shoulder and point out immediately the glaring flaw. 'Two heads...' and all that..? Onwards and upwards now...

Original thread: https://forums.rpgmakerweb.com/threads/eventing-problem-can-anyone-help-me-troubleshoot.64957/