How do I make an npc do something if it sees another npc?

Focusbit

Villager
Member
Joined
Jan 1, 2017
Messages
10
Reaction score
0
First Language
English
Primarily Uses
The title is pretty much my question.



So Pretty much i'm working on a game and I wanted to make it if someone finds a dead body, you lose, so I was wondering if that was possible, and if so, how do I do that?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,356
Reaction score
7,671
First Language
German
Primarily Uses
RMMV
you have to use control variables to get the coordinates of the NPC event and the coordinates of the dead bodies and compare them, making that game over if the distance is in sight (or do a more complex mathematics to check for true line of sight in maps).


There is no simple way to do this, because the computer does not have any form of image recognition...
 

BrandedTales

StoryTeller
Veteran
Joined
Dec 30, 2016
Messages
203
Reaction score
116
First Language
English
Primarily Uses
N/A
Is this for a minigame that would be done over and over (or some other recurring phenomenon), or a one-time scene in the game?


The former would be complicated, but if it's a one time thing, you might be to create the illusion of npcs searching for the body.  However, the location of the body and the path taken by the searchers isn't truly random... it's scripted to look that way.     At the end of their route, they "find" the body unless the player has somehow broken out of it (easily handled with a switch).
 

Soyer

PvP Player
Member
Joined
Dec 28, 2016
Messages
10
Reaction score
2
First Language
Portugues
Primarily Uses
RMMV
Probably you should try a event with create region around the body(when/if he dies) and select the option "Event Touch" (maybe some conditions ) then Game over
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,356
Reaction score
7,671
First Language
German
Primarily Uses
RMMV
Probably you should try a event with create region around the body(when/if he dies) and select the option "Event Touch" (maybe some conditions ) then Game over
absolutely wrong - "event touch" means the event touching the player, nothing else.


There is no event-to-event touch trigger, that is why such cases need to be handled by coordinates and control variable checks.
 

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

Latest Threads

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,854
Messages
1,016,998
Members
137,562
Latest member
tamedeathman
Top