Hi there, how do i make NPC interact e.g. talk and do things between different NPCs, and are there any plugins to do this?
NPC interact with other NPC
RPG Maker MV Supportno, because you're missing two basic facts of the engine:
First, there are no NPCs - there are only events pretending to be NPCs.
That is an important distinction because events can do things that NPCs cannot - like having different events pretending to be the same NPC and more.
Second, in any cutscene (and what you describe is a cutscene) there can only be one controlling event that remotely controls all other events as placeholders for NPC.
That controlling event will play the show text - the placeholder events with the sprites must never contain any single command. (set move route can be targeted at other events)
There are several tutorials here on the forums on how to handle cutscenes, please search for them and work through them.
First, there are no NPCs - there are only events pretending to be NPCs.
That is an important distinction because events can do things that NPCs cannot - like having different events pretending to be the same NPC and more.
Second, in any cutscene (and what you describe is a cutscene) there can only be one controlling event that remotely controls all other events as placeholders for NPC.
That controlling event will play the show text - the placeholder events with the sprites must never contain any single command. (set move route can be targeted at other events)
There are several tutorials here on the forums on how to handle cutscenes, please search for them and work through them.
You can script whatever interaction you want in a cutscene. If you want them to approach another event as part of their regular map movement you need to script in a proximity check every time they move (or every x frames as part of a parallel event).
Something like (Pseudocode):
This plugin may be relevant to your interest. It lets you put conditional statements in a move route and include a distance check function
Something like (Pseudocode):
Code:
A moves randomly
if (A is within X distance of B){
self switch to a page with new move route where A moves toward B
}
if(A is next to B){
Do stuff
}
This plugin may be relevant to your interest. It lets you put conditional statements in a move route and include a distance check function
Thanks all
No i am not referring to a cut scene. what i am referring to is while DURING playing the game npc will move about the map and talk to other NPC or do their own stuffs and not predefined (i think rpg maker mv can only do like random number and then i predefine for a certain type of npc character and from there the npc will do the predefined chords, etc),. which what @AquaEcho replied is what i needed (with the checkdistance feature), however when i tried seems it was restricted in the set movement only and i think i might be missing some setting or have not tried enough
I can confirm the plugin I linked works. First two lines:
START_IF: this.distanceEvent(-1) < 2
$gameSelfSwitches.setValue([$gameMap.mapId(), this._eventId, 'A'], true)
If the event is within 2 tiles of the player (event -1), turn on the event's self switch A
START_IF: this.distanceEvent(-1) < 2
$gameSelfSwitches.setValue([$gameMap.mapId(), this._eventId, 'A'], true)
If the event is within 2 tiles of the player (event -1), turn on the event's self switch A
Thanks i tried the plugin cmd in movement route, seems it will activate self switch a when the character met or is with in the setup distance and not the actual event number, cause i tried with one npc event num is ok, but i tried on another npc event which is further away seems this plugin call below will activate whenever any event is near it, not sure if its my plugin but i tried to move the plugin around eg top to bottom and vice versa still same result, i had also entered a map id as well
START_IF: this.distanceEvent(10) < 2
$gameSelfSwitches.setValue([$gameMap.mapId(), this._eventId, 'A'], true)
I just tried it with a bunch of NPCs boxed into a fence walking around. It only activated the self switch when the event number defined in the script was within 2 tiles.
Original thread: https://forums.rpgmakerweb.com/threads/npc-interact-with-other-npc.167559/