Help please

Hello people of RPG MAKER,

               I really need your help. I'm making a game using RPG MAKER VX ACE. The problem is my brain.  :headshake:   I want to make an event but I can't lol because I don't even know how. OK, let me explain to you what I want.

                Let say there is a ghost in a room. The ghost will guard the room. But if the ghost sees you, you will die. The problem is, HOW? How do I make this event.  ;_;   Well, if you can help me (which I'll appreciate) , please help me!  🙂  

Thank you  🤣  

P/S: I wish there is no thread that ask the same question. I know I should find them, but I don't know what to type. But if there is one, please give me the link.  😀   

Another P/S: If there is some grammar error, please tell me so I can improve mine. 
I'd suggest reading this by Andar:

http://forums.rpgmakerweb.com/index.php?showtopic=14727

It is pretty good for starting people, read all of it don't just skim through it. It has helped me a lot and it still does.
Line-of-Sight reactions aren't easy to do, but there are several ways. All of those ways require you to do the mathematics of position calculations, so you need to know how to handle variables and parallel processes. I suggest reading tutorials until you do what they are about, especially the variables guide - you'll find the tutorials linked in my topic for starters, see link inmy signature or above.


That said, if you search the forum for Stealth or line of sight you should find other topics and tutorials about that problem.
Thank you Mr/s Blood and Mr/s Andar. Line-of-Sight, that's the word that I need. And I think I can do that event. I just need to read this :  http://forums.rpgmakerweb.com/index.php?/topic/3452-direction-based-line-of-sight-events/ 

By the way, I've read Andar's tutorial many times and yes, it really help me. Okay so thanks and bye.

(You may close it)
I made a game that hopefully might help you in general.

It's in my signature. 

Also check @Andar's signature. Pretty neat tutorials in there.

Finally a specific reply:

Well you have to know what variables are first.

If you do, then you have to dig into VX Ace.

You will find out that variables can store data, drawn from... almost anything.

One thing could be X and Y xooprdinates (counted in tiles) of the map.

If you use pixel movement scripts you will habe problem with this, since it does not tile count stuff, but by default VX Ace uses the tiles grid anyway.

You got a ghost. It has a position.

The ghost sight is let's say 4 tiles in front of it. If the ghost is facing down and it is at (X,Y) = (14,19) then you check the column iunder it ( ghost is facing facing down) so you check Y-1, Y-2, Y-3, and Y-4 tiles. That means tiles (14,18),(14,17),(14,16),(14,15)

So you now have to express this as an event.

First you have to get the X and Y of the ghost and store them in two variables. Lets say GhostX and GhostY. Name two like this and select the appropriate values (Ghost Event's Xposition and Yposition)

Now make a Variable GhostYsight.

Add GhostY value in it.

Then add 4 in it. 

You must get every hero's movement. So you need variables like HeroX and HeroY too.

As parallel proccess you do the check on the ghost.

Now look. If the ghost is facing down, you make a conditional branch.

IF HeroX is equal to GhostX Then

   IF HeroY > GhostY and HeroY <= GhostYSight Then

      The ghost got you

   else:

      Do not add anything here.

else: 

Do not add anything here

and conditional branch is over.

Confusing? Hell it is. So just do what @Andar told you to do.

Read some tutorials, learn well the tools,

then you will be able to do more stuff than that. 😉

Anyway. Hope my game will help you figure out some things.
Thank you very very much Dreadshadow. You really help me  😀  Okay have a nice day 

P/S: Solved 😀

Original thread: https://forums.rpgmakerweb.com/threads/help-please.34947/