[RM2K3] MAKE AN NPC DISAPPEAR AFTER WALKING OFF SCREEN?
Posts
Pages:
1
So, I'm trying to do something that doesn't seem to be working out well.
I have a postman character in a town that walks between all four mailboxes in town, and then walks off screen. Not as part of a cutscene... just something you can observe every time you enter the town while you're walking around.
I want to give the illusion that he leaves town after delivering the mail. So far, what I'm trying to do is setup a timer that starts when you enter the level, and runs out when he's near the edge of the map, triggering his second page with a blank sprite.
This isn't working because the timer just gets "stuck" when you try to start it up as a Parellel Process. Autorun is even worse and makes the game freeze. I know because I'm showing the timer on screen for debugging purposes.
However, the same script counts down and works fine if I set it to be triggered via the action button or player touch. It's only when I try to get it working on level loading that I run into these issues. But that doesn't really help me because I don't want the player to trigger the timer.
I originally wanted to cause the NPC to vanish upon touching a specific square, but I couldn't find anything for that, so it seems like there's no way to make the engine do what I want.
Is it even possible to do this, or am I wasting my time?
I have a postman character in a town that walks between all four mailboxes in town, and then walks off screen. Not as part of a cutscene... just something you can observe every time you enter the town while you're walking around.
I want to give the illusion that he leaves town after delivering the mail. So far, what I'm trying to do is setup a timer that starts when you enter the level, and runs out when he's near the edge of the map, triggering his second page with a blank sprite.
This isn't working because the timer just gets "stuck" when you try to start it up as a Parellel Process. Autorun is even worse and makes the game freeze. I know because I'm showing the timer on screen for debugging purposes.
However, the same script counts down and works fine if I set it to be triggered via the action button or player touch. It's only when I try to get it working on level loading that I run into these issues. But that doesn't really help me because I don't want the player to trigger the timer.
I originally wanted to cause the NPC to vanish upon touching a specific square, but I couldn't find anything for that, so it seems like there's no way to make the engine do what I want.
Is it even possible to do this, or am I wasting my time?
I am not 100% sure what exactly you are getting at, but it seems like you want the NPC to become invisible once he has completed a certain movement route, correct? And does this NPC always leave the town at the exact same spot, or does he have multiple different possible paths?
If it's the former, what you can simply do is set the NPC's movement type in the lower left of the event page to Custom, and place his move route there. As the last element of that movement cycle, add the Switch ON command that triggers his second event page and makes him invisible. That way, you don't need anything like a timer at all.
If for some reason, that can't be done, there is another, more complicated solution:
I hope this is at all helpful. If you can't get it to work, I could also post a few screenshots to make it easier to understand. Good luck!
If it's the former, what you can simply do is set the NPC's movement type in the lower left of the event page to Custom, and place his move route there. As the last element of that movement cycle, add the Switch ON command that triggers his second event page and makes him invisible. That way, you don't need anything like a timer at all.
If for some reason, that can't be done, there is another, more complicated solution:
What I'd recommend is instead of using a timer, you use a Parallel Process event to keep track of the NPC's position. Use the Control Variables command to set up one variable that is set to the value of the NPC's X coordinate, and another variable for the Y coordinate. Then have a Conditional Branch check whether the first variable's value is equal to the X coordinate of the square where he leaves the town. Inside that, add another Conditional branch for the second variable and whether it's equal to the square's Y coordinate.
Only if both conditions are true, that means the NPC is now standing in the spot where you want his to disappear. So you can place whatever necessary commands inside the second Conditional Branch, and they will only activate once the NPC has reached the correct square. In your case, you would put the Contro Switches command in here that triggers the NPC's second event page.
Only if both conditions are true, that means the NPC is now standing in the spot where you want his to disappear. So you can place whatever necessary commands inside the second Conditional Branch, and they will only activate once the NPC has reached the correct square. In your case, you would put the Contro Switches command in here that triggers the NPC's second event page.
I hope this is at all helpful. If you can't get it to work, I could also post a few screenshots to make it easier to understand. Good luck!
Thanks. I assumed that the custom movement page only controlled movements, and that if I wanted to do something like turn a switch on, I had to do it on the main page. Which would result in the switch being set immediately before the movements were done executing unless you used something like a timer to delay it.
Adding a switch event to the end of the custom events I already set up worked perfectly. It was exactly what I needed, in the exact place I needed it.
I did try the second one as well just to see if I could get it working, in case I ever need something with multiple paths possible. It's not too hard to implement either, so I will be able to do it both ways in the future.
Adding a switch event to the end of the custom events I already set up worked perfectly. It was exactly what I needed, in the exact place I needed it.
I did try the second one as well just to see if I could get it working, in case I ever need something with multiple paths possible. It's not too hard to implement either, so I will be able to do it both ways in the future.
Pages:
1














