I need help understanding this script

ZackNH

Veteran
Veteran
Joined
Mar 26, 2018
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMMV
I'm new to the forum, so I'm not sure if this is the right place to post this.

I've been trying to put stealth into an RPG Maker VX Ace game using this script by Jet10985, but I'm having trouble with it. For some odd reason, events won't detect anything directly in their line of sight. If I'm standing off to the side, it's fine, but if I'm dead-on right in it's face, nothing.

I know very little about scripting, so I don't have the faintest idea as to why this is happening.

This is the script:

I set up a test area with as few variables as possible to show what I'm talking about.



EDIT:
Further testing has revealed that having a wall behind you, even when in vision, SOMETIMES hides you.







 
Last edited:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA

I've moved this thread to RGSSx Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,365
Reaction score
7,675
First Language
German
Primarily Uses
RMMV
Where do you setup the height numbers for Region IDs and Terrain Tags?
That is most probably where you made your mistake, because without that setup the script does not know which tiles should block sight and which not.
 

ZackNH

Veteran
Veteran
Joined
Mar 26, 2018
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMMV
Where do you setup the height numbers for Region IDs and Terrain Tags?
That is most probably where you made your mistake, because without that setup the script does not know which tiles should block sight and which not.
I have no regions or terrain tags set. I haven't modified anything at all. Terrains and Regions are 0 by default, so there shouldn't be any reason why I can't be seen in front of it, but can be to the side.


Even when I do set Terrain Tags, they don't change anything.
When I try to use the scripts set_terrain_height(terrain_id, number) or set_region_height(region_id, number), I always get this:

This happened when I put in: set_terrain_height(1, 1)


Setting a Terrain Tag without the script call does nothing.
The same with Regions



 
Last edited:

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
The terrain script call error happens because of a copy/paste line forgotten how it is in the script.
Line 453 is this:
Code:
def set_region_height(ter, height)
But it should be this instead:
Code:
def set_terrain_height(ter, height)
So change that and it should work.

The second error with the region script call also happens because of a typo in the script.
Line 482 looks like this originally:
Code:
$game_map.set_right_height(reg, height)
But it should be this:
Code:
$game_map.set_region_height(reg, height)
Change these lines and the crashes won't happen anymore.
 

ZackNH

Veteran
Veteran
Joined
Mar 26, 2018
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMMV
The terrain script call error happens because of a copy/paste line forgotten how it is in the script.
Line 453 is this:
Code:
def set_region_height(ter, height)
But it should be this instead:
Code:
def set_terrain_height(ter, height)
So change that and it should work.

The second error with the region script call also happens because of a typo in the script.
Line 482 looks like this originally:
Code:
$game_map.set_right_height(reg, height)
But it should be this:
Code:
$game_map.set_region_height(reg, height)
Change these lines and the crashes won't happen anymore.
Awesome, that fixed the crashes, and the terrain tags seem to be working normally. Thanks.

However, I still can't be seen when standing directly in front the event. Perhaps there's another error in the script?
 

ZackNH

Veteran
Veteran
Joined
Mar 26, 2018
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMMV
I'm sorry if bumps aren't allowed, but my main problem wasn't fixed.

I still can't be seen when standing in front of the event, even with no terrain tags or regions, and I don't understand why standing against a wall will sometimes make it so you can't be seen at all.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top