StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
Set-up: We are using 3 events as the "line-of-sight" for an NPC. If you step onto this event, they go into alert mode. Currently, we are testing this using random graphics for the "line-of-sight" events. "Through" is checked, which allows them to land on the player, but not pass through tiles with an "X" passibility.

Problem: When giving the "line-of-sight" events no graphics, they ignore tiles with an "X" passibility, thus going through them. This is troublesome, as an NPC shouldn't be able to spot the player through walls and the like.

Solution: Since we're not sure there's a way deal with this without using a plugin, thus, here I am.

Thanks!
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,315
First Language
English
Primarily Uses
RMMV
remove the Through, which will stop them going through things, and set their priority to Below Characters, which will allow the player to walk on them.

How are you moving them?
 

StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
The player can walk on them when its setup how you described, but other events are blocked from over the event.

◆Control Variables:#0006 gx-1 = Map X of This Event
◆Control Variables:#0005 gy-1 = Map Y of This Event
◆If:This Event is facing Down
◆Set Movement Route:Locater 1 (Repeat, Skip)
:Set Movement Route:◇Move Down
◆Set Movement Route:Locater 2 (Repeat, Skip)
:Set Movement Route:◇Move Down
◆Set Movement Route:Locater 3 (Repeat, Skip)
:Set Movement Route:◇Move Down
◆Set Event Location:Locater 1, ({gx-1},{gy-1})
◆Control Variables:#0006 gx-1 += 1
◆Set Event Location:Locater 2, ({gx-1},{gy-1})
◆Control Variables:#0006 gx-1 -= 2
◆Set Event Location:Locater 3, ({gx-1},{gy-1})

:Else
◆If:This Event is facing Left
◆Set Movement Route:Locater 1 (Repeat, Skip)
:Set Movement Route:◇Move Left
◆Set Movement Route:Locater 2 (Repeat, Skip)
:Set Movement Route:◇Move Left
◆Set Movement Route:Locater 3 (Repeat, Skip)
:Set Movement Route:◇Move Left
◆Set Event Location:Locater 1, ({gx-1},{gy-1})
◆Control Variables:#0005 gy-1 += 1
◆Set Event Location:Locater 2, ({gx-1},{gy-1})
◆Control Variables:#0005 gy-1 -= 2
◆Set Event Location:Locater 3, ({gx-1},{gy-1})

:Else
◆If:This Event is facing Up
◆Set Movement Route:Locater 1 (Repeat, Skip)
:Set Movement Route:◇Move Up
◆Set Movement Route:Locater 2 (Repeat, Skip)
:Set Movement Route:◇Move Up
◆Set Movement Route:Locater 3 (Repeat, Skip)
:Set Movement Route:◇Move Up
◆Set Event Location:Locater 1, ({gx-1},{gy-1})
◆Control Variables:#0006 gx-1 += 1
◆Set Event Location:Locater 2, ({gx-1},{gy-1})
◆Control Variables:#0006 gx-1 -= 2
◆Set Event Location:Locater 3, ({gx-1},{gy-1})

:Else
◆Set Movement Route:Locater 1 (Repeat, Skip)
:Set Movement Route:◇Move Right
◆Set Movement Route:Locater 2 (Repeat, Skip)
:Set Movement Route:◇Move Right
◆Set Movement Route:Locater 3 (Repeat, Skip)
:Set Movement Route:◇Move Right
◆Set Event Location:Locater 1, ({gx-1},{gy-1})
◆Control Variables:#0005 gy-1 += 1
◆Set Event Location:Locater 2, ({gx-1},{gy-1})
◆Control Variables:#0005 gy-1 -= 2
◆Set Event Location:Locater 3, ({gx-1},{gy-1})

:End

:End

:End

Lineofsightevent.png
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,315
First Language
English
Primarily Uses
RMMV
That seems a really strange way of doing things. I assume you have another parallel process event that moves these events based on when the NPC moves or changes direction, and yet another that compares the player's position with the events? That's a lot of parallel process events, and I'm not sure why they're needed.

Whether they have a graphic or not should have no bearing on whether they go through passable tiles or not.

I'd consider rethinking the approach to something more simple.
 

StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
(Disclaimer: My boyfriend made this event for our game, and has no time to post on forums.)

I'm sure there's some weird reason he's doing it this way.

Either way, his problem still remains. Without a graphic the line-of-sight events still pass through walls.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,315
First Language
English
Primarily Uses
RMMV

StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
Yes, but what about the issue at hand?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,315
First Language
English
Primarily Uses
RMMV
the issue at hand may not be an issue if you reconsider the approach and do it a different way. There are several downsides to the way you're trying to do it.
 

StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
Perhaps, but um, what exactly IS the different way? He may not even know.

His free-time is rather limited, so any suggestions would be useful, I suppose.

(You can move this post to RPG Maker MV Support, if you wish.)
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,315
First Language
English
Primarily Uses
RMMV
Can you give a screenshot of your map, showing how these events are arranged around the NPC, and a bit of a description of how the NPC moves, and how the events move when that happens?
 

StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
Here's the map:

Scottys_Map.png


For now, the guard is simply stationary and turns in all directions, with the "line-of-sight" events moving with him. When he sees the Player, he does chase after her. It looks like he uses variables and x,y coordinates to follow the guard's front side.

The evented table, btw, is for the player when in "crawl" mode to hide under it in order to escape the guard's attention.

He's using a temporary graphic on the "line-of-sight" event so it doesn't go through the walls.

When caught, the guard follows the player, unless the player runs away fast enough. Then he stays where he last saw the player, looks around, then returns to his previous destination. The "line-of-sight" events following him the entire way.

I don't think this is important, but the player can sneak behind the guard while in "crawl" mode. But I doubt that effects the events.

If you need more screenshots or whatever, I'll provide.

Thanks.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,315
First Language
English
Primarily Uses
RMMV
So the guard will only chase if the player is on one of those three tiles? If the player is on that tile immediately above the statue, will the guard chase?

If the range is more than one tile away, let me know how many tiles.

I think this can be done using only the guard event and no extra events at all.
 

StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
The events extend 7 tiles outwards. So she'd get caught at the statue, yes.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,315
First Language
English
Primarily Uses
RMMV
Have you already searched for line of sight plugins and tutorials?

I'll have a think about this for a bit.
 

StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
While he was well-versed in VX Ace/XP, he was unfamiliar with MV, so thus he decided to not use a plugin. I know they *do* exist, however. Since he worked on this so much, he won't use one now.

Also, I was told that when he puts an event on "through" ONLY the player can walk on it. Any other events cannot. Regardless of graphics.
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,315
First Language
English
Primarily Uses
RMMV
that sounds right
 

StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
So it's native to MV? He said it didn't happen in ACE/XP.

Is there some sort of plugin we can use to work around it?
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,315
First Language
English
Primarily Uses
RMMV
There was a discussion about that a while ago - might be a bit hard to find the thread, and I don't recall what the conclusion was.

For the most part, MV was a straight port of Ace, to Javascript instead of Ruby. Most of the functionality wasn't changed - just new things added.
 

StrawberryFlower

The Talking Fruit
Veteran
Joined
Nov 23, 2012
Messages
1,791
Reaction score
585
First Language
English
Primarily Uses
RMMV
I remember trying to look it up, but I couldn't find the keywords. Or maybe I looked in the wrong section.

(P.S. I think he doesn't quite recall how ACE worked. :p)
 

Latest Threads

Latest Posts

Latest Profile Posts

Redesigning characters after such a long time feels great. Makes me excited to work on an old game again.
Phone menu to replace main menu WIP:
It's been that long since I wrote a plugin, it took me 4 attempts to realize it's != rather than #. In a 40-line plugin, 20 of those lines being documentation!
Disk Check Plugin - Running on Linux:
RMMV-Game-Mint.png
workin on some graphics for my game. was originally planning on doing a cartoony style for the town but I might stick with this instead

Forum statistics

Threads
116,086
Messages
1,095,649
Members
151,462
Latest member
julienrg
Top