#------------------------------------------------------------------------------- # # SDS is an advanced stealthdetectionsystem for use in RPG Maker VX games. # To use the system, you need to build an event that begins with a script call: # # $game_stealth.detector(eventID, detectRange, detectAction, # tunnelVision, trueSight) # # eventID: The ID of the event. Use @event_id as it's the easiest way # detectRange: How far the "guard" is able to see. Higher numbers require # more CPU time to proccess! Lag increases exponentially if # you are NOT using tunnel vision. # detectAction: The action to perform when the guard detects the player # DEFAULT = 1 # 0: Goto jail event # 1: Game Over # 2: Execute common event # 3: MGS Mode # tunnelVision: determines whether the guard's field of view cones out or # goes in a straight line. # DEFAULT = false # trueSight: determines whether the guard can see through obstacles # DEFAULT = false # # NOTE: You do NOT have to set parameters that have a default. # # MGS MODE EXPLAINATION: # # When using detectAction 3 (MGS Mode) guards will be "alerted" if # they spot the player. The guard will run to the position they spotted # the player at, then begin to look around for the player again. If the # guard sees the player a second time, the captureAction is performed. # #-------------------------------------------------------------------------------
Game_Stealth options:
Tunnel width option:
CODE
#--------------------------------------------------------------------------- # If you use tunnel vision, set the tunnel width here. It MUST be an ODD # number or the game will round up to the next odd number! Widths over 3 # are not recomended. #--------------------------------------------------------------------------- @tunnelWidth = 3
To specify the common event for Mode 2:
CODE
#--------------------------------------------------------------------------- # The common event ID to execute when using the common event detect action #--------------------------------------------------------------------------- @common_event_id = 1
To specify the speed of an intercepting MGS guard:
CODE
#--------------------------------------------------------------------------- # The speed and frequency the guards move when they detect the player in # MGS mode. # speed: 1: x8 slower, # 2: x4 slower # 3: x2 slower # 4: normal # 5: x2 faster # 6: x4 faster # # frequency: 1: lowest # 2: lower # 3: normal # 4: higher # 5: highest #--------------------------------------------------------------------------- @guardInterceptSpeed = 4 @guardInterceptFrequency = 5
To set the MGS Mode capture action:
CODE
#--------------------------------------------------------------------------- # When in MGS mode, the action to be performed if the guard detects the # player a second time. This is set by default to game_over since all other # options require some configuration. Valid values are: # captureAction: 0: Goto jail event # 1: Game Over # 2: Execute common event #--------------------------------------------------------------------------- @captureAction = 1
To set the search time for an alerted guard in MGS mode:
CODE
#--------------------------------------------------------------------------- # How many frames a guard will wait before executing each turn when # searching for the player after detecting them in MGS mode. #--------------------------------------------------------------------------- @waitTime = 60
To disable "awareness" bubble around guards:
CODE
#--------------------------------------------------------------------------- # Change this to false to disable the detection radius around guards. # This means the player can safely stand next to a guard as long as he's # not in the guard's line of sight. #--------------------------------------------------------------------------- @allowDetectRadius= true
Compatibility
Requires RGSS2. Redefines Scene_Title, Scene_Map and Game_Event
Screenshot
Guard field of view explanations:
Normal Cone Vision: An obstacle in the way hides the area behind the object: Tunnel Vision with an obstacle: Tunnel Vision and True Sight:
Copy the script files into your game under the materials section.
Todo List:
Check pathfinding logic more thouroughly
Add ability to stop checking FoV when all tiles in a row are blocked
Add ability for fighting MGS events
Add option for more realistic FoV obstacles (blocking cones should extend out at the angle of incidence)
Fix mgs goto bug where guard stops in front of player if the player doesn't move
FAQ
None yet!
Terms and Conditions
Feel free to use this in your game, but please give me a shout in the credits! Also, feel free to edit this for your own personal purposes but please do not repost an edited version without my consent first.
Hey guys, it's 1:30am and I'm really tired, so I'm just going to post the demo and the script and goto bed, then come back tomorrow morning and add the screen shots and detailed instructions and all that jazz.
This script was extremely easy to write until I decided to implement an MGS stealth option @.@ There is no pathfinding in RGSS so I had to program my own routine to handle it. I'm 90% certain that it is finding the shortest route, but I still need to do a few more tests to verify. Anyway there is one known bug: when a guard in MGS mode heads to your location, if you stand still and don't move out of the way he will just sit there next to you, trying to get onto the space you are occupying. Other than that I think it should mostly work.
Please enjoy, full details tomorrow.
Cool, I'll test it out tomorrow...too sleepy to do anything. Also I'll need you to explain a bit more about the script because I'm confused.
This post has been edited by Netto: Jun 11 2008, 11:39 PM
__________________________
Current Project[RC]: Twilight Realm 3DMMORPG w/dx9, and char creation through mysql after I get a server, now C++ scripting Current Project[VX]: Obsidian Trilogy just started 08/12/2008 Current Project[XP&RM2K3]: none
HEROES COME BACK! OH YEAH THIS IS THE END OF R-R-R!!! FTP PASSWORD WAS GOT HE'S READY TO DELETE ALL CONTENT OH SO YEAH!!! HEROES BECAME DEMONS!!! ANY ACCOUNT HERE CAN HACK BY THE "FTP MASTER" ALSO KNOWN AS NIGHTMARE ZERO!!! 3-2-1 MAKE SOME LOUD!!!
Group: Member
Posts: 59
Type: Event Designer
RM Skill: Skilled
very nice, I like this script. I just have one question. if you get caught, you can add dialouge to it, then have a game over? or is it just a mini-game?
This post has been edited by Neo22: Jun 12 2008, 01:29 PM
Cna yuo raed tihs? Olny 55% of plepoe can. I cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt! fi yuo cna raed tihs, palce it in yuor siantugre.
The following sentence is true. The previous sentence is false. This sentence is a lie.
QUOTE
Welcome to the Internet - where the men are men , the women are men and the children are the FBI
very nice, I like this script. I just have one question. if you get caught, you can add dialouge to it, then have a game over? or is it just a mini-game?
Yes, you can do this with Mode 2 or Mode 3. You'll need to build a common event for the message and game over.
QUOTE (Mr_E_Man @ Jun 12 2008, 04:06 PM)
You should be flattered you're worth harrassing
This is an excellent script. It was a nightmare calculating line of sight with events. I look forward to the upgrades.
Thanks ^^ Calculating LoS in an event would be murder on the game engine's performance as well.
QUOTE (bob_saget @ Jun 12 2008, 04:30 PM)
Will you marry me!? This is exactly what I needed for my Metal Gear Solid mini-project!
Only if you're a girl
QUOTE (Calintz16438 @ Jun 12 2008, 04:37 PM)
This system looks pretty amazing, I'm not gonna lie.
Thanks ^^ I hope it just keeps getting better!
QUOTE (bowser @ Jun 12 2008, 04:45 PM)
Great! found a bug though. When you get caught it proscesses events twice. Like trasfers and tranfers again.
Yeah for some reason that started when I turned on the true sight for those events. I need to track that one down. Thanks for reminding me!
For the past couple of months I've been learning RGSS and I've got the basic stuff down such windows, variables, conditional statements, ect. But, I can't see myself making big scripts such as a jumping system or a side view battle system. I was wondering how you learned to script because I really want to know how to script really well.
Thanks in advance.
Hey there,
Well I don't make battle neither though I can still teach you some things :)... The way I've learned to script is by reading other scripts for the most part. I've allways been interested in other peoples work but this time I though I had to try to make something myself...and it worked!! The most importand thing when you go scripting is (at least in my case) that you want to make something to help an other wich can't script. You also need to feel the competition that's around in the scripting-community. Cause, I have to say, if you get pushed to get a sertain request done before an other scripter does, you feel POWERFULL!! :P So that's an other thing... You also don't need to be afraid to learn from others or helpfiles. When I write my scripts, I actualy always have the helpfiles open to look things up I don't know or remember. Then, you must be calm, cause you need to try the script a lot of times. When I write a script, I test it after almost every changes. First I set up the major structure. Like when I make a window-script or part of a script I start with something like this:
CODE
class Window_Name < Window_Base def initialize(x,y,width,height) super(x,y,width,height) refresh end
def refresh self.contents.clear draw_contents end
def draw_contents draw_something(with, some, parameters) end
def update refresh if @something != @what_it_should_be end end
So that's also very important. Then, the biggest thing I learned scripting from is TRIAL AND ERROR. That's the most irritating way to learn something, cause it's more ERROR than TRIAL, but it does the trick realy good.
So that's it how I did it. Now it's up to you. Do some requests (if I didn't do it allready :P) and learn from them.
Hope that helped you out a little. If not, keep your eye on the Scriptology-topic (see my sig) where I'll be updating for my scripting(video)tutorials. Perhaps they're going to be usefull for you one day ;)
very nice, I like this script. I just have one question. if you get caught, you can add dialouge to it, then have a game over? or is it just a mini-game?
Yes, you can do this with Mode 2 or Mode 3. You'll need to build a common event for the message and game over.
QUOTE (Mr_E_Man @ Jun 12 2008, 04:06 PM)
You should be flattered you're worth harrassing
This is an excellent script. It was a nightmare calculating line of sight with events. I look forward to the upgrades.
Thanks ^^ Calculating LoS in an event would be murder on the game engine's performance as well.
QUOTE (bob_saget @ Jun 12 2008, 04:30 PM)
Will you marry me!? This is exactly what I needed for my Metal Gear Solid mini-project!
Only if you're a girl
QUOTE (Calintz16438 @ Jun 12 2008, 04:37 PM)
This system looks pretty amazing, I'm not gonna lie.
Thanks ^^ I hope it just keeps getting better!
QUOTE (bowser @ Jun 12 2008, 04:45 PM)
Great! found a bug though. When you get caught it proscesses events twice. Like trasfers and tranfers again.
Yeah for some reason that started when I turned on the true sight for those events. I need to track that one down. Thanks for reminding me!
Im talking about ones w/o true sight... mgs mode... it triggers the commone event or w/e and then before you move it does again.
Cna yuo raed tihs? Olny 55% of plepoe can. I cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt! fi yuo cna raed tihs, palce it in yuor siantugre.
The following sentence is true. The previous sentence is false. This sentence is a lie.
QUOTE
Welcome to the Internet - where the men are men , the women are men and the children are the FBI
Excellent work cmpsr2000, your scripting continues to amaze me. What a very useful script.
__________________________
Currently working on:
Underground Syndicate (mafioso/modern type RPG) Mind Maze (old school dungeon crawler with a different feel) Dragon Adventure (Dragon Quest type fangame with more customization) Dark Grind (Survival horror RPG)
Cna yuo raed tihs? Olny 55% of plepoe can. I cdnuolt blveiee taht I cluod aulaclty uesdnatnrd waht I was rdanieg. The phaonmneal pweor of the hmuan mnid, aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it dseno't mtaetr in waht oerdr the ltteres in a wrod are, the olny iproamtnt tihng is taht the frsit and lsat ltteer be in the rghit pclae. The rset can be a taotl mses and you can sitll raed it whotuit a pboerlm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe. Azanmig huh? yaeh and I awlyas tghuhot slpeling was ipmorantt! fi yuo cna raed tihs, palce it in yuor siantugre.
The following sentence is true. The previous sentence is false. This sentence is a lie.
QUOTE
Welcome to the Internet - where the men are men , the women are men and the children are the FBI
i like the demo and the sound effect, shocked my some time cool!! haha realy nice.
QUOTE (The Wizard 007 @ Jun 13 2008, 02:15 AM)
Excellent work cmpsr2000, your scripting continues to amaze me. What a very useful script.
QUOTE (bowser @ Jun 13 2008, 05:34 AM)
Ok good, Ive wanted sneak stages for a while.
Thanks for the kind words, guys. b^^b
Important edit: There was a problem with the demo file that From_Ariel pointed out to me: The player was configured to start on map 3 instead of map one. I updated the demo. You don't have to re-download the update, just open the project file and change the start position to somewhere on the left grey dragon on map001.