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?
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...
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).
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