events cannot trigger other events, so you need to place that code into a master event that checks the position of each event after a move.
How that is done depends a lot on what triggers the event moves - if possible at all that should also check the results of the move.
A disadvantageous solution would be to use a parallel process event for checking positions - only do this if there is no other way to trigger the position check as it will create lag on your game.
This forum is for discussing the design of game mechanics. Your query is more a "How to...?" and so belongs in the Support forum for the particular engine you are using.
Based on the information under your avatar, I am, therefore, moving this to MV Support.
Thank you very much,both of you 🙂
I was thinking get event location, x and y, for the randomly moving dog for instance, and then make the cat move accordingly with variable based on the dogs location.
Move +1 away from dog or something.
But i guess that is maybe too much different type of game mechanics than what rpg maker is for, allthough it surprises me,
because it seems like a simple problem. Newbie or not, maybe only newbie at this forum 😉
Haha yes, just like children does. If homework <1 then gametime =0.
I am way too lazy to program, I like easy and automatic for easy things 🙂
I work on logic too; less time for programming, gives me more time for other types of creative work.
My strength is not programming, so i focus on what i can do good, instead of wasting time doing mediocre work 😀
You're getting there! The script for telling the cat to move away from the dog is:
$gameMap._events[1].moveAwayFromCharacter($gameMap._events[2])
But replace 1 with the event ID of the cat, and 2 with the event ID of the dog.
(IDs are at the top of the window when you go to edit an event).
So.. now you just need a way of telling when they're near each other, (eg. getting the x and y positions and doing a little math...)
And running that somehow in the background...
I go back and forth on how worthwhile it is to try to figure things out like this. Typically, I say "Well this shouldn't be too hard... all I have to do is..." and then 5 hours later, I figure out the magic words I actually have to type to make it happen, and it's really depressing to think how many hours I just wasted trying to write that one line. On the other hand, I'm slowly getting better at programming, which is a bit like slowly getting better at being a wizard.