Hello internet friends
can I please have some help with my stealth code
I am super new to rpg maker mv and have never used Java script before
I am enjoying adding a little stealth level to my game
I am mainly copying these cool tutorials even tho they are for vx ace and I am using
I am trying to create a moving guard with a limited line of sight
because the guard is moving (patrolling up and down) in such a long area they go off screen
the guards limited line of sight/vision cone must move with them to prevent the player been seen from so far away that they can't even see the guard 🙁
again I've never used java script b4
so the code I'm trying to write is:
----------------------------------------------------------------------
if ( $gamePlayer.x =<93 &&
$gamePlayer.x =>103 &&
$gameGuard.isFacing(down)
$gamePlayer.y = ($gameGuard.y +6)
{
$gameMessage.add("HEY!?, You can't be in here!");
$gamePlayer.reserveTransfer(Map_1, x, y, direction, fade type);
}
------------------------------------------------------------------------
what I am trying to do in my code:
------------------------------------------------------------------------
if the player is inside the guards line of sight (setting the left border of guards vision)
then setting the right border of guard vision
and if the guard is facing down
and if the player gets 6 squares away from the guard
then show some text of guard saying "HEY!?, You can't be in here!"
and transfer the player to another map (in this case a continue screen)
-------------------------------------------------------------------------
I found this link which helped
but at this point beginning it's literally a new language for me
the reason I'm trying to do this by coding is the 4th line where I'm trying to find a way to make the game react to the player getting within 6 squares of a moving guard
I hope a coding hero can help with my coding quest please?
can I please have some help with my stealth code
I am super new to rpg maker mv and have never used Java script before
I am enjoying adding a little stealth level to my game
I am mainly copying these cool tutorials even tho they are for vx ace and I am using
I am trying to create a moving guard with a limited line of sight
because the guard is moving (patrolling up and down) in such a long area they go off screen
the guards limited line of sight/vision cone must move with them to prevent the player been seen from so far away that they can't even see the guard 🙁
again I've never used java script b4
so the code I'm trying to write is:
----------------------------------------------------------------------
if ( $gamePlayer.x =<93 &&
$gamePlayer.x =>103 &&
$gameGuard.isFacing(down)
$gamePlayer.y = ($gameGuard.y +6)
{
$gameMessage.add("HEY!?, You can't be in here!");
$gamePlayer.reserveTransfer(Map_1, x, y, direction, fade type);
}
------------------------------------------------------------------------
what I am trying to do in my code:
------------------------------------------------------------------------
if the player is inside the guards line of sight (setting the left border of guards vision)
then setting the right border of guard vision
and if the guard is facing down
and if the player gets 6 squares away from the guard
then show some text of guard saying "HEY!?, You can't be in here!"
and transfer the player to another map (in this case a continue screen)
-------------------------------------------------------------------------
I found this link which helped
but at this point beginning it's literally a new language for me
the reason I'm trying to do this by coding is the 4th line where I'm trying to find a way to make the game react to the player getting within 6 squares of a moving guard
I hope a coding hero can help with my coding quest please?
