Right now, I have one friendly NPC set to random. And one hostile NPC set on a patrolling path. And I don't want them to block each other's movement route. But I still want the player to be able to interact with both of them. The hostile NPC will make the player fight it if the NPC runs into the player or the player runs into it. The friendly NPC will only react if the player interacts with it. The friendly NPC can stop the hostile one, and when it moves, the hostile one continues on its path.
I'm having trouble with events blocking other events.
RPG Maker VXAce SupportSeems to me like the easiest solution would be to block the random route NPC from walking into the path of the patrolling one.
I'm not familiar with the RMVXAce. IIRC in RM2k you could accomplish this by making a little "cage" out of empty events and place the roaming NPC in it. This doesn't work anymore in vanilla RMMV so they obviously got rid of it at some point, but there is a chance it might still in the maker you're using. So I would try to experiment with that.
I'm not familiar with the RMVXAce. IIRC in RM2k you could accomplish this by making a little "cage" out of empty events and place the roaming NPC in it. This doesn't work anymore in vanilla RMMV so they obviously got rid of it at some point, but there is a chance it might still in the maker you're using. So I would try to experiment with that.
That would be done with Regions. The hostile NPC parols in a loop so there is nowhere for the friendly NPC to go. I want the player to have to catch the friendly NPC.
Can you show a picture of the map with the patrol route marked on it? I'm unable to visualize this properly.
The 1st is the Hostile NPC patrol path and the friendly one is in the middle of it. There are also 5 other friendly and hostile NPCs that cross paths.
Through on?
Have you try to turn on Through in Event Option yet?
This implies you want a pause and wait function for when the hostile npc can't move due to the friendly npc blocking the way.
That could also mean that the hostile npc will move even if the friendly npc is blocking, so they will be on top of one another at one point.
Here is a way to make it so that the patrolling npc will not stop if running into the friendly npc.
Try this - put a comment on the npc that is patrolling. <patrol>
This code will also allow an npc to move over another event that is below characters.
Ruby:
class Game_CharacterBase
def collide_with_events?(x, y)
$game_map.events_xy_nt(x, y).any? do |event|
return false if (self.is_a?(Game_Event) && patrol)
event.normal_priority?
end
end
def patrol
self.list.each do |line|
if line.code == 108
return true if line.parameters.include?("<patrol>")
end
end
return false
end
end
No 'through on' would prevent the player from interacting with them.
Ruby:
event.normal_priority? || (self.is_a?(Game_Event) && event.normal_priority?)
That condition has an unnecessary redundancy. It turns out that it doesn't matter if the character is the player or any event, using just event.normal_priority? as its conditional statement is more than enough to pass the test.
It already has a pause wait function. Someone suggested using X and Y coordinates so the friendly NPC would move away from the Hostile NPC. Your way sounds easier.
I just crafted a script that will let you create "sheep" aka friendly NPC that will never go beyond the area with a predefined Region ID.
You can read all the details pertaining to this script of mine here.
You can read all the details pertaining to this script of mine here.
Bad news. I already have a script that does that.
That won't make me remove it. 😛
My script has secondary features that makes it easy to handle, guys. 😀
My script has secondary features that makes it easy to handle, guys. 😀
Yes, that's basically Yanfly Engine Ace - Move Restrict Region with the same issue of preventing free-roaming friendly NPC from moving around most of the map. It would be stuck in small areas. And the idea is the player has to catch them. Even now, with it at top speed, it still isn't much of a challenge.
Tested further and true. This was taken from my project, which I must have something that blocks the normal behavior. When I added that in it worked as expected for normal events.
My EventRegionBox seems to have solved the blocked passage issue for my patroller and my sheep. I don't think my script works in the same way as Yanfly's for mine is mainly focused on the sheep aka ally and just a bit on the patroller aka enemy.
Original thread: https://forums.rpgmakerweb.com/threads/im-having-trouble-with-events-blocking-other-events.160173/