RPG Maker Forums

Hi all,
 


This script is made to:


-give guards a simple AI,
-give guards a line of sight,
-enable them to follow you,
-enable them to look for you
 


In this script you can:


-hide behind obstacles to avoid detection
-hide inside objects to avoid detection (like the vase)
-kill and carry guards (lowers speed)
-attract guards attention by putting a corpse somewhere on their way


Keys:


W - hide (face the vase)
S - go out of your hideout
D - back stub the guard
Q - pickup corpse
A - drop corpse


How to use:


1. Download and unzip SneakPL archive,


2. Copy all three scripts

  • SneakPL
  • PathFinder
  • Event_window

3. Copy the guard wherever you like and set his move route.


you are good to go


A brief explanation:


This is a script that lets the guards act much like those in metal gear solid. The have a certain line of sight but can't see through obstacles. The rule here is simple. The line of sight is a tree of tiles that is being checked depth first (starts in rootNode variable uses Node class) https://en.wikipedia.org/wiki/Tree_(data_structure). If one of those tiles contains an obstacle deeper nodes are not checked. In other words once behind an obstacle you can not be seen. Once detected the position of the player is clear to all guards and they will try to catch him. However you are able to flee them. When last guard looses you from the line of sight he will proceed to search for you. The algorithm takes your last seen location and direction and makes a mark 10 (appr_fields variable) fields  further in that direction. From that point the guard will choose another point within a radius of 5 (search_radius variable) and go there with hope to find you there. If not he will choose another point. This works good when there are rooms nearby. Looks quite natural. All guards will look for you for 15 seconds (alarm_time variable). After that they will go back to their starting position.


The guards have four states


A - attacks
B - is being carried
C - is searching 
D - is dead


Some info:


I have made this script for my friend back in 2013. The game is long dead but maybe someone will find it useful. This was my first encounter with Ruby and first script for RPG Maker ever so please be gentle :D. Anyway if anyone finds this one interesting feel free to use it and don't forget to add me and the guys below in credits. The code has commentary in polish (log too). If anyone is interested in changing it let me know. I will translate it. 


And for those brave and curious https://www.duolingo.com/course/pl/en/Learn-Polish-Online



Requires:


PathFinder by Karanum
Event_Window by Yanfly


Credits:


All credits for path finding go to Karanum
All credits for event window go to Yanfly
 

View attachment SneakPL_6.3.zip

View attachment SneakPL.txt

Latest Threads

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,034
Messages
1,018,446
Members
137,820
Latest member
georg09byron
Top