Cat and Dog

Ursa Koda

Veteran
Veteran
Joined
Jun 10, 2016
Messages
110
Reaction score
76
First Language
Samoan
Primarily Uses
N/A
RPG Maker MV:


Hei, how to make a cat(event) move if a dog(event) is next tile to it?


how make event 1 move or react or make some other action when event 2 is close, next to it?


And how to make some event happen if 3 events is next to eachother in line?


like pushing boulders or objects, and when the 3 is horisontally in line for example, something happens?


Like it dissappears or you get point? get my point?  :popcorn:

ex-order-event.png
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
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.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
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.
 

Ursa Koda

Veteran
Veteran
Joined
Jun 10, 2016
Messages
110
Reaction score
76
First Language
Samoan
Primarily Uses
N/A
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 ;)
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
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 ;)
People do something like this a lot of times in RM games - it's just that it is not simple for the computer, but needs a more complex check.


Computers aren't intelligent, they need to be told whatevery they do by logic sequences, and that can require a lot of programming...
 

Ursa Koda

Veteran
Veteran
Joined
Jun 10, 2016
Messages
110
Reaction score
76
First Language
Samoan
Primarily Uses
N/A
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 :D
 

Internetomancer

Veteran
Veteran
Joined
Nov 16, 2015
Messages
57
Reaction score
26
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top