Aquin25

Veteran
Veteran
Joined
Aug 9, 2014
Messages
94
Reaction score
15
First Language
English
Primarily Uses
RMMV
So, I want to formulate a simple stealth system into my game. (Enemies wandering around with field of view indicators that result in a loss when seen.)

Any reccomendations on how to pull this off? Because I'm sadly drawing a blank. (Would LOVE if it were just a simple plugin or something.)
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,467
Reaction score
10,890
First Language
German
Primarily Uses
RMMV
This is extremely difficult to pull off correctly, because the engine has absolutely no help for that.

Yanfly has a plugin that allows an event to react to the player coming into a certain distance. That might be a start, but it is very limited from what I remember.
I don't have the link, you'll have to check his main list for yourself.
 

peq42_

Yeet
Veteran
Joined
Feb 5, 2016
Messages
561
Reaction score
353
First Language
Portuguese(BR)
Primarily Uses
RMMV
well, there's a few ways.

-You can implement a constant check for if the player is running, and if they're, immediately make them get caught(since running makes noise). To make that, you can use $gamePlayer.isDashing() inside a parallel process event.
-check if the event is looking at the player
-then check distance between event and player on top of it(use $gameMap.distance($gamePlayer._x, $gamePlayer._y, yourevent_x, yourevent_y). If they're closer than say 3-4 tiles, they're caught or the event walks towards them, and if it touches them its game over.

Also, due all respect to andar, its not a extremely difficult thing to pull off. Most things aren't. You just need to plan and think about what you want to do and break it into smaller, simpler parts.


More useful scripts:

 

Showsni

Villager
Member
Joined
Jun 21, 2022
Messages
26
Reaction score
17
First Language
English (UK)
Primarily Uses
RMMV
So, I want to formulate a simple stealth system into my game. (Enemies wandering around with field of view indicators that result in a loss when seen.)

Any reccomendations on how to pull this off? Because I'm sadly drawing a blank. (Would LOVE if it were just a simple plugin or something.)

There are two plugins I've been trying out for this - first is Yanfly's Event Chase Player and Event Chase Stealth extension. Event Chase Player lets you set Movement Routes on events, generally as part of a custom move route, which will make the event either chase or run away from the player once it comes within range (with an option for if the event needs to see the player or not). The Chase Stealth extension lets you trigger a "stealth mode" for the player to make it undetectable whilst it lasts.

The other one is Mankind's Player Sensor plugin (there's a video example of it in action on this tweet thread). This lets you put a notetag on events to designate them as sensors - you can choose if you want them to be able to see just in a straight line, in a triangle shape, or in a D shape, what range, and whether they can see through walls or not. You can then run a script to make any event with the notetag start or finish searching. It will display a line of sight for each event that is searching, and if they spot the player it will cause them to turn on a Self Switch (of your choice), and turn it off again once they lose line of sight to the player. You can then obviously use the Self Switched Event page to decide what you want to happen next (i.e. they could start chasing the player, or instantly catch them, or whatever).
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,952
Reaction score
754
First Language
German
Primarily Uses
RMMZ
Here is a useful Thread about different kinds of Line of Sight possibilities.
 

Aquin25

Veteran
Veteran
Joined
Aug 9, 2014
Messages
94
Reaction score
15
First Language
English
Primarily Uses
RMMV
The other one is Mankind's Player Sensor plugin (there's a video example of it in action on this tweet thread). This lets you put a notetag on events to designate them as sensors - you can choose if you want them to be able to see just in a straight line, in a triangle shape, or in a D shape, what range, and whether they can see through walls or not. You can then run a script to make any event with the notetag start or finish searching. It will display a line of sight for each event that is searching, and if they spot the player it will cause them to turn on a Self Switch (of your choice), and turn it off again once they lose line of sight to the player. You can then obviously use the Self Switched Event page to decide what you want to happen next (i.e. they could start chasing the player, or instantly catch them, or whatever).
This looks good, but... forgive my ignorance, will the fact that this is a Japanese plugin effect it's usage?

Like, will I need to imput in Japanese command codes or something to make it work?
 
Last edited:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
38,467
Reaction score
10,890
First Language
German
Primarily Uses
RMMV
that this is a Japanese plugin effect it's usage?
only in sofar as you need to understand the plugins instruction and help, and use the commands invented by the plugin programmer.

the data structures themselves are language-independent and always the same.
 

Showsni

Villager
Member
Joined
Jun 21, 2022
Messages
26
Reaction score
17
First Language
English (UK)
Primarily Uses
RMMV
This looks good, but... forgive my ignorance, will the fact that this is a Japanese plugin effect it's usage?

Like, will I need to imput in Japanese command codes or something to make it work?
There shouldn't be any issues - I've been using Google Translate to read the help file - and all the Plugin commands and Notetags it uses seem to be in English.
 

Aquin25

Veteran
Veteran
Joined
Aug 9, 2014
Messages
94
Reaction score
15
First Language
English
Primarily Uses
RMMV
There shouldn't be any issues - I've been using Google Translate to read the help file - and all the Plugin commands and Notetags it uses seem to be in English.
Mind a little tutorial then? All I'm trying to do here for the record, is the following...

Cone shaped FOV (1-3-3 shape)

The player being caught activates an autoplay event.

Guard characters controlled via their normal movement pattern control.

Sorry to to get so specific, it's just clear you have experience in this field, and would love some help in this regard.
 

Showsni

Villager
Member
Joined
Jun 21, 2022
Messages
26
Reaction score
17
First Language
English (UK)
Primarily Uses
RMMV
Mind a little tutorial then? All I'm trying to do here for the record, is the following...

Cone shaped FOV (1-3-3 shape)

The player being caught activates an autoplay event.

Guard characters controlled via their normal movement pattern control.

Sorry to to get so specific, it's just clear you have experience in this field, and would love some help in this regard.
So, if you're using the Player Sensor plugin, you'd go in to each of your Guards and add the Notetag to the event <PsensorF:3>.

Then run the plugin command PSS start somewhere on the same map (say, in an autorun event that turns itself off after) and the guards will be activated. Run the plugin command PSS stop if you want them to stop searching again.

deo4nUv.png
8J5wSzB.png


In the Plugin Settings, the top option lets you select a letter A, B, C or D - this will be the Self Switch that the guards will turn on if they see you.

Iq0scNe.png


So set it to, say, D, then in your Guard event add a page with the condition Self Switch D is on, set it to Autorun, and event out your capture event in there.

aeswmbT.png
6saAW65.png


One issue I did find is that having a lot of guards on the same map caused some significant lag (I think I had more than 30 on the same map...). If you have this problem, the solution I used was to split my map up into chunks, and only activate certain guards when I was close enough, so they're not all searching at once. To do this, for the guard Notetag use <!PsensorF:3> instead (with an ! mark). This will stop the guard searching even when you use PSS start. Then, when you want to activate specific guards, use a script call and write something like
$gameSystem.onSensor(2);
$gameSystem.offSensor(4);
(where the 2 and 4 are the Event IDs of guards I am turning on and off from searching).

Hopefully that all makes sense!
 

Aquin25

Veteran
Veteran
Joined
Aug 9, 2014
Messages
94
Reaction score
15
First Language
English
Primarily Uses
RMMV
I get the idea... but it's not working, sadly. Nothing is happening.

Here's some screenshots. Maybe you'll know what's wrong?
 

Attachments

  • Screenshot (27).png
    Screenshot (27).png
    93.6 KB · Views: 6
  • Screenshot (28).png
    Screenshot (28).png
    210.2 KB · Views: 7
  • Screenshot (29).png
    Screenshot (29).png
    223.1 KB · Views: 8
  • Screenshot (30).png
    Screenshot (30).png
    93.5 KB · Views: 6
  • Screenshot (31).png
    Screenshot (31).png
    85.9 KB · Views: 4

Showsni

Villager
Member
Joined
Jun 21, 2022
Messages
26
Reaction score
17
First Language
English (UK)
Primarily Uses
RMMV
Your Event 8 (to turn the PSS on) doesn't have the condition "Self Switch A" ticked on page 2 - that means it will only check page 2, so it's never turning on the sensors. Just need to add the condition "Self Switch A on" to page 2 of that event and see if it works then.
 

Aquin25

Veteran
Veteran
Joined
Aug 9, 2014
Messages
94
Reaction score
15
First Language
English
Primarily Uses
RMMV
Your Event 8 (to turn the PSS on) doesn't have the condition "Self Switch A" ticked on page 2 - that means it will only check page 2, so it's never turning on the sensors. Just need to add the condition "Self Switch A on" to page 2 of that event and see if it works then.
I always forget to do that when eventing, damn I feel like an idiot.

Thanks for the help. Seems to have fixed things.
 

BK-tdm

Waifumancer
Veteran
Joined
Jun 21, 2018
Messages
532
Reaction score
1,622
First Language
English
Primarily Uses
RMMV
So, I want to formulate a simple stealth system into my game. (Enemies wandering around with field of view indicators that result in a loss when seen.)

Any reccomendations on how to pull this off? Because I'm sadly drawing a blank. (Would LOVE if it were just a simple plugin or something.)
Ah stealth mechanics! *cracks fingers*

Do you want instant gameover when seen or some event to happen when you get caught?

If you want a cone-o-vision to be drawn on the events themselves you will need to edit the event sheets OR make a vision cone sheet which will be drawing in front of the npc, the latter will require some eventing to follow the npc's facing while the former is plug and play, but will need to be done PER sprite, which one is up to you, if you want the eventing one i can share you a way to follow the sprite's facing.

If the first question is the event thing, do you want to be chased by the npc who spotted you?
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

I swear it looked better in my head. But this ain't bad. Had to experiment to make the characters stand out and not blend too much with the background.

Also, before anyone say this. Yes, she is holding a winrar.
Posted my second Battle System, namely KEarthBound VX!
My first one was Kolloseum States for XP, he, he.
I never thought I'd ever make one for VX anyways. :rswt:
You can search the internet. It seems fine to call children little petri dishes. My wife and I raised 4 of them and they brought everything home. But apparently calling students plague bearers is a bridge too far. :LZSlol:
Which universe are you from? Berenstain or Berenstein?
Trying out Greedfall. The story is interesting and the voice acting is good, but holy cow are the faces and their animations distractingly terrible.

Forum statistics

Threads
131,673
Messages
1,222,094
Members
173,414
Latest member
DarkMessenger05
Top