Moving statue.

I need help to move this statue in the correct tiles. in the picture shows #1 statue should be push in to the
circle that can seen in the picture and i just want the statue to be pull in specified areas. because when i try
to push the statue it goes everywhere as i push it in different directions. And i want to happend is the door
will be unlocked when you put the statues in the right places as u can see in the picture, sorry for bad
english. if you can help me with this one too it will be a big thanks because till now i don`t know how
to do this, thank you 🙂
The two images appear to be the same.

Are you saying you ONLY want to be able to push the statues along that path, and not anywhere else? Perhaps see if you can find Yanfly's Region Restrictions script for Ace. It won't help with pushing and pulling (there is a tutorial somewhere on how to do that), but I think it will be enough to force the statues to only follow the path you've set.
There's a secret trick if you want to make the statue only move along the path: place empty events around the path (since events can't go one on the other, unless you have "through on").
Both posts are true but while using events is certainly easier using regions seems far more efficient to me. It is not even that hard to achieve. If you want to do it without using scripts you can do with just events. Just set up your event so that it checks the region ID in the new position before moving and do nothing if the said ID is the wrong one.

EDIT: if you want to calculate the new coordinates on your own feel free to do it but I am quite sure you can use a script call to get them using built-in methods.

I am not going to provide the code itself since I do not have access to the engine right now and I do not want to mislead you (I am not confident I remember the method parameters properly). However the method itself is called round_x_with_direction (similarly for the y coordinate). The point here is use your player direction when pushing or its opposite (reverse_dir) when pulling.

If you are interested in those methods just check them in your script editor. If I am not mistaken they should be defined in the Game_Character class (or its super class Game_CharacterBase). This should narrow down your search.
If you make PC Game, just use the invisible Events on below Player. Simple, Easy and Efficient.
If you make Game for Mobile, than maybe use a more complicate solution with less Events, in case testplay on iphone uses to much performance.
I heard that you should not use more than 10 to 30per map on Iphone, not sure if that is true or not. On PC you can have 200+ Events without problems.
If you make Game for Mobile
And this is VXAce, so that isn't an option. And even if it's for PC, I'd recommend using fewer events.
If you make PC Game, just use the invisible Events on below Player. Simple, Easy and Efficient.
Simple? Yes. Easy? Once again yes. Efficient? Absolutely no. I don't see how you can call it efficient. The only efficient part in it is that it is fast to realize, but being fast to do and being efficient are two different things. Checking regions is far more efficient when it comes to something like that.

I do not recommend using events at all. They are a roundabout way to do it if someone does not have enough knowledge to do it in other ways. It gives you the chance to have everything working until you find a better solution, but as someone gets better I strongly recommend avoiding using too many events.

Increasing the number of events also increases the number of scanned elements when checking collision. Even if those events are without graphics - and thus there is no need to draw them - you still have to check them to see if collisions are present.
Increasing the number of events also increases the number of scanned elements when checking collision

Also increases the number of events that are checked every time the map refreshes, to see if a new page needs to be activated.
Also increases the number of events checked on every frame, to see if there's a next command in the list that needs to be run, or a sprite to be changed due to stepping animation, or a movement to make due to an autonomous move route. Even if the event has none of those things and nothing happens, the checks still have to be done.

So yes, adding lots of events is easy to do, but there's a hidden overhead.
I don't think 16 empty events will have much impact on performance. It's the easiest and simplest solution, and won't have a noticeable performance hit.
I don't think 16 empty events will have much impact on performance. It's the easiest and simplest solution, and won't have a noticeable performance hit.
The point is, it might be misleading and eventually they do that for everything and the number of events may grow in a bigger case.
What Theo said is true. And while on most computers 16 empty events are not an issue that cannot be said for slower ones (it is still not that noticeable though). Anyway adding 16 empty events in a map where there 13 events in total means increasing the number of those checks listed above by more than 100%.

Shortcuts are good and they ARE useful, but people should always learn to do things the right way. Once they know how to do them they can decide to take shortcuts.

That said I am 100% sure that map would lag on my old netbook the way it is right now, I don't even want to imagine how it could lag with another 16 events. XD
The best solution in general isn't always the best solution for every situations. If you're computer lags from only 16 events, I would suggest not playing RPG Maker games on it and get a new one. I agree that people shouldn't not do that if it takes like 100 events, but for each case there's a solution that takes into account performance vs implementation time.
That is 100% true but in the same way as the time required to place 16 events is trivial the time required to check region IDs before moving is also trivial. I'd say knowledge is what makes the biggest difference here. Double clicking on an tile, closing the window, copying it then pasting it 15 time while moving the cursor is hardly faster than just adding something like this:

Spoiler: A possible implementation
Code:
ev = $game_map.events[@event_id]
new_x = ev.round_x_with_direction(ev.x, $game_player.direction)
new_y = ev.round_y_with_direction(ev.y, $game_player.direction)
if ($game_map.region_id(new_x, new_y) == put_a_region_id_here)
  ev.move_straight($game_player.direction)
  Fiber.yield while ev.moving? # remove this if you don't want to wait after moving the statue
end

It is just 5 lines (7 if you include the if-end ones). I really don't see why performance should not be improved to just skip four lines. After all - as I wrote in one of my previous posts - there are build-in methods to achieve this. You don't even have to write them on your own. The trick is to combine event coordinates and player direction ($game_player.reverse_dir($game_player.direction) if you want to pull the statue instead of pushing it), methods to round coordinates with direction and to check reverse direction are already part of the code. Everything else is just a simple flow control.

EDIT: if you have to write those lines instead of copy/pasting them it is faster to use events but I think we can agree that the time you manage to save is not going to make any real difference at all, no matter what.
It also depends on the person. A person who has never code, or even never used a script command would find that intimidating. I'm 100% with you if it's someone that doesn't find that solution intimidating.
It also depends on the person. A person who has never code, or even never used a script command would find that intimidating. I'm 100% with you if it's someone that doesn't find that solution intimidating.
They can event this.
> Pick map x and y position from the statue event, assign it in a variable.
> Use a bunch of what-ifs for the direction
> Change the variable accordingly
> Get location info (based on those variables) > Region ID
> If region id match, move away from the player
It's strange that it comes from me though as I prefer to code everything.

But here is the point. All of these are alternatives. The reason why I recommend a better solution for the performance is that they should know it. Knowing both the pros and cons. And if they go to the lazy way like putting event surrounding the path they may do it again in the future and don't bother to try this method. Which is why I said "misleading".
But here is the point. All of these are alternatives. The reason why I recommend a better solution for the performance is that they should know it. Knowing both the pros and cons.
That is also why I said that "shortcuts ARE useful" but at the same time people should learn how to do things the right way. Once they know the right way they can take shortcuts to save time but doing so they know what they are doing and the consequences they will be facing.

@MushroomCake28 It is true that coding knowledge is not strictly required to use the engine itself (it helps a lot though) but script calls are an extremely powerful tool that almost everyone using the engine will face sooner or later. If somebody finds using them intimidating then that is all the more a reason to learn how to use them. When someone does not know the tools at his/her disposal should focus on learning them and implementation time should not be a real concern in my opinion.

Only when that knowledge has been successfully acquired can implementation time and shortcuts be taken into account. Unfortunately there is no shortcut when it comes to learning and one should take his/her time doing so.
I believe in this case we have a very simple task and somehow it ended up that we overthink this to much.
We got a Engine so the Game/Level designer can create the Gameplay, no need to wake the inner coder/scripter for alternate solutions.
Those could be implemented or researched in case the map lags on weak test pcs.
It doesnt matter if it uses 0.05% or5% of performace if the map consumes only a total of 10 to 20% of all performance reserves with all the efects and plugins and stuff, than i believe we overthink this. Because it runs smooth.
But its always helpful to point out different solution ways. But sometimes the easiest is the best.
As someone who has written an anti-lag script in VXAce, I'm very stingy to add more burden by adding unnecessary empty events. 16 events are already like adding 10% to 20% progress toward the starting of fps drops unless you're using my anti-lag. I feel like people nowadays are spoiled with how convenient the technology like how fast are the CPU, internet, and sizes that they don't even bother with the efficiency. If it doesn't work, buy a stronger device, etc.

I would say it again. Know both of the solutions. Always go to the best practice, or at least understand it. So, you know when not to use it for a specific case. If you're a teacher, you may always want to direct your student to use the best practice. Because they don't know. If they ended up knowing it, it's because they know.

However, ultimately it's up to the op to decide which solution they gonna take. And it's funny that the thread escalated much while there was no response at all from the op. Is it already solved? 😛
I feel like people nowadays are spoiled with how convenient the technology like how fast are the CPU, internet, and sizes that they don't even bother with the efficiency. If it doesn't work, buy a stronger device, etc.
Any modern computers would have no problem running 16 events. In fact, almost all of the modern cpus wouldn't have any problem running most of the RPG Maker games. 8 cores CPU are now less than 300$, even i5 laptops have 4 cores, etc. Efficiency is not as huge as a limiting factor as before. It's good to have efficiency, but there's a point where it would take so much time to save something insignificant (talking in general, not about this case in particular).
Any modern computers would have no problem running 16 events
You're totally missing the point.
adding 10% to 20% progress toward the starting of fps drops
I agree with you Theo. Game design needs to be streamlined so that in the future when you need to add on more stuff it will not impact the 'FPS', as the discussion is in this case, allowing the addition of extra stuff to not cause an even more significant 'FPS' drop.

So to any MODS, check the conversation as this is going off topic. The OP has two possible answers to the question.

Original thread: https://forums.rpgmakerweb.com/threads/moving-statue.105624/