So what does switch 27 do?
Why do you have 2 pages on the event? If the second page is conditioned by the switch and is what moves the fireball back to its starting spot, delete it.
Then change your custom move route to this:
Set Move Route (This Event) Move Right Script: if x > x1 then moveto(x2,y2)Set the move route to RepeatWhere I have x1, you put the x tile that you want it to reach before returning to the start (if it's 15, put 15, not 015).
Where I have x2 and y2, you put the x and y position of the tile you want it to move back to.
Then in the event commands, also get rid of anything to do with the switch, and instead, use the Set Event Location command to put it back to the starting position.
So you are making both the move route when it reaches the extremity, and the commands when it hits the player, move the event back to where it needs to be, and are not relying on a switch and additional event page to do it.
I THINK the above will work. I don't have Ace with me right now, so can't run a test.
I took an entirely different approach to setting up projectiles in my games and I don't think I've ever had this move-route problem. So if the fixes that other people have suggested can work, no need to redesign around my ideas, but if not, give this a try:
Set up the projectile events that have a blank page, then (at least) a second page where the autonomous movement is FIXED. Set a switch of your choice as a condition for this event page. Set the trigger to Parallel Process. Now, in the event body of the page, use a Set Move Route command which contains the full move cycle of Move Right 10 Times. Make sure you set the Wait option on the Move Route (in most cases you'll also want to set Skip). After Move Route, add a command to reset the event's location to its origin where it's fired from and then turn the switch off (for better aesthetics, you can set the location offscreen, but then make sure whatever event turns it back on also warps it to the origin where it's fired from).
Whenever you want the projectile to fire, simply have the switch you chose about turn ON. You can attach that to a timed parallel process event, a button, whatever you want.
You're halfway there. Since the event body is now controlling the event automatically, rather than on player touch, we need another Parallel event that will check the projectile's location against the player's location. There are lots of ways to do this with eventing - don't bother. Here's the basic code you can use to do it much more easily using a Script command:
fire = $game_map.events[3]player = $game_playerif (fire.x == player.x) && (fire.y == player.y)fire.moveto(0, 137)$game_switches[208] = falseendBasically, this checks to see if the fire has hit the player, then turns the fire event off once it has hit the player and moves it back to wherever you want. Replace 3 with the Event ID of the fire projectile (if you have more than 1 fire projectile, I recommend replacing 3 with i and placing the whole thing in a for loop), the two moveto arguments with the appropriate x and y coordinates the projectile should move back to once it hits the player, and 208 with whatever switch you used above to control the presence of the projectile. Add in whatever gameplay effects you want to happen when the player is hit by the fire. Also, I recommend that you add a 1-frame wait at the beginning or end so it's not constantly processing.
Make sure that the actual fire projectile event has the THROUGH property set to ON for all pages.
Basically, the wisdom of this whole approach is that the Move Route will be cancelled as soon as the fire is turned "off", and will restart (causing the entire move route to restart) whenever you turn the fire back "on".
Only if it's a parallel process COMMON event.
I have what I think is the perfect solution. Unfortunately, I can't find the link to the script, and although I have it, I think Archeia's terms are that her scripts cannot be reposted. But in the hope that someone else knows what the link is, or if you pm her asking where it is, here is the solution.
Script: NPC Patrol
Scripters Yami, Archeia_Nessiah
Dated 2012.09.14
What it does:
Makes an NPC - or in this case, your fireball - move in a horizontal or vertical path. Think soldiers patrolling on city walls. Done by placing a simple Comment on the first event page.
If it hits something, it travels back to its starting position.
In order to ensure that it just does the 10 tiles that you want, place a blank event on the 11th tile so that it hits it when its on its 10th tile.
That's all.
Sorry guys, I gave up and did it the old-fashioned way 😛
The very simple solution:
3 event pages.
Page 1: The normal 'event touch' fireball which blows up, vanishes and activates page 2 if it touches the player.
Page 2: Waits a few seconds, then restarts the position of the fireball. Then it waits a few seconds more, and disables its own page (2).
Page 3: Disables the event entirely if the mage is 'attacked' (activated/touched).
The logic is that if you go to another event page, then back to the original page (with a wait, of course) - the event resets its own move route! 😛
So thanks for trying to help guys, lol - but it looks like the old ways worked XD