Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Requesting a Guard Can See Player script

Working on an idea for an RPG, and was wondering if I could get a script.

Once a command is given, an event (say a Guard) will search for the player. If the player falls within a Visible Range (6 tiles long by 3 tiles wide in FRONT of the guard's current facing), then the player can be seen, unless the switch "Is Hidden" is ON.

I'm mostly asking for the script which will return boolean if the player can be seen or not, then checks if the player Is Hidden.

If you need more information, I'll do my best.

P.S.: If someone could possibly tell me how I can turn a terrain tag into a doable script (for instance, using a shadow terrain in order to trigger the "Is Hidden" switch) that would be great, too.
 
You can set a variable equal to a character's terrain tag through the event's "control variable" option. So if you make a prallel process event check the player's terrain tag and set a variable equal to it, you can then check that variable to see if the player is "hidden"
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top