Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Line Of Sight
« previous next »
  • Print
Pages: [1]

Author Topic: Line Of Sight  (Read 2072 times)

Offline MajorSkalle

  • Member
  • Initiate
  • *
  • Posts: 5
Line Of Sight
« on: February 22, 2008, 09:08:21 PM »
Yes, people. I am absolutely aware that this has been posted LOADS of times. I have been searching GamingW and Charas (even google), and really, I can't find anyone who can make a more detailed description of what exactly needs to be done.

Well, over to my problem. I want to place guards on a map, and when hero is seen, something happens. It really don't matter.
Actually I want the guards to move, but I can't even get this to work with stationary guards. Creating events with conditional branches and "touched by" will not work. If the hero already stands in the sight of the guard, he won't be noticed.

So, it is here you guys come in. I know variables is the thing here. I'm not really good at variables (I know what they are, but can't really use them).
So please. I would appreciate some (detailed) help here.

Thank you.

EDIT: Wow. Forgot. I am talking about RPG Maker 2003. Sorry for that.
Logged

Offline Moosetroop11

  • Sage
  • *
  • Posts: 7,398
(No subject)
« Reply #1 on: February 23, 2008, 01:33:15 AM »
With the stationary guards, have you tried making it 'collision with' rather than 'touched by'?

I had the same problem where if you stood still you couldn't be seen. I can't remember whether collision with hero makes it work...
Logged
Maaaaaaaaaaaaaaaaaaaaaaaaaaan I missed this place.

Quote from: drenrin2120
Maaaaaaaaaaaaaaaaaaan I missed you.

Quote from: fruckert
Maaaaaaaaaaaaaaan I missed that welcome.

Offline MajorSkalle

  • Member
  • Initiate
  • *
  • Posts: 5
(No subject)
« Reply #2 on: February 23, 2008, 09:38:17 AM »
Quote
Originally posted by Moosetroop11
With the stationary guards, have you tried making it 'collision with' rather than 'touched by'?

I had the same problem where if you stood still you couldn't be seen. I can't remember whether collision with hero makes it work...


Well, I just tried but it didn't work. Actually it crashed. I created a conditional branch to check if the guard was facing in the right direction, and tried adding a 0.1 pause as I have heard that may work.
But no luck here.

Variables is the only way out is it?
Logged

Offline MajorSkalle

  • Member
  • Initiate
  • *
  • Posts: 5
(No subject)
« Reply #3 on: March 02, 2008, 09:39:29 AM »
Well. Finally I found a understandable guide. (I found it HERE, check out the intermediate tutorials)
At least I got the guards to notice the hero.

My only problem is that the guard may even see the hero if he moves in the back. Suggestions?
Logged

Offline DedlellyDeth

  • Exemplar
  • *
  • Posts: 1,215
(No subject)
« Reply #4 on: March 28, 2008, 06:25:56 AM »
 Branch if they're in the same row or column. Record the distance between guard and hero. Wait however long it takes for a guard to move. Record again in different variable. The second variable is less, then it means that he is moving towards hero; facing hero and moving forward as there are only two directions, the other one making the distance more.
Logged
The previous post may contain rudeness. I'm just trying to help people, is all. I apologize for any damages inflicted. I just want to be friends. :flower:

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • Line Of Sight
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum