I've seen a few custom scripts around here a long time ago that can deal with this but they were seperate scripts and I think they may have had some issues with pixel movement scripts, which Blizz ABS is. I was wondering but is there a way to have event range scripts that as long as they are facing the player, they can for example, send them outside a building that you are trying to sneak around? You know, kind of like in Zelda OoT/Wind Waker where you have to sneak around and not get caught.
i quickly wrote this up to achieve such:
class Interpreter
def in_range?(event, range)
#checks if the players x is the same as the events
if $game_player.x == $game_map.events[event].x
#checks if the players y is lower than the events, if the player is in
#range and if the event is facing up
if $game_player.y < $game_map.events[event].y &&
$game_map.events[event].direction == 8 && $game_player.y >=
$game_map.events[event].y - range
# returns true if conditions are met
return true
#checks if the players y is higher than the events, if the player is in
#range and if the event is facing down
elsif $game_player.y > $game_map.events[event].y &&
$game_map.events[event].direction == 2 && $game_player.y <=
$game_map.events[event].y + range
# returns true if conditions are met
return true
end
#checks if the players y is the same as the events
elsif $game_player.y == $game_map.events[event].y
#checks if the players x is lower than the events, if the player is in
#range and if the event is facing left
if $game_player.x < $game_map.events[event].x &&
$game_map.events[event].direction == 4 && $game_player.x >=
$game_map.events[event].x - range
# returns true if conditions are met
return true
#checks if the players x is higher than the events, if the player is in
#range and if the event is facing right
elsif $game_player.x > $game_map.events[event].x &&
$game_map.events[event].direction == 6 && $game_player.x <=
$game_map.events[event].x + range
# returns true if conditions are met
return true
end
end
return false
end
end
in a conditional branch, choose script and put the following script call: in_range?(EVENT_ID, RANGE)
this will only work linear from the event, you can put whatever you want to happen in the conditional branch :)
im not sure if blizz abs has a method you can use as it will have built in functions to locate the player from the event, and as for pixle movement, it should be fine as long if the pixle movment only affects the sprite coordinates and not the real coordinates
Question, is that script you said that you found, is it a portion of any script or is that an entire custom script itself?
Also, does that only apply to when the event is facing you? I'm basically trying to get an event triggered just by an event that happens to be facing you.
An example being, if the event is facing right and you happen to walk by him/her/it while facing right, something will happen. If walking by him while he's facing right but you happen to be behind him/her/it instead of in front of him/her/it, you happen to slip by him/her/it.
i did not find it, as i said:
Quote from: diagostimo on October 31, 2012, 04:27:04 pm
"i quickly wrote this up"
it will act exactly as you said, say you set the range to 10, if you pass in there view point within 10 squares, it will trigger, when i said linear thats what i meant, the script itself manages to trigger depending on the direction the event is facing and if the player is within the range of that direction, just like on pokemon games when entering battle, try it out and see :)
I thought of just using an enemy battler that utilizes the command enemy_can_see?, but the command doesn't take walls into consideration. I played around with this a bit and found out that "the enemy can't see you if there is a wall in between" doesn't work 100% of the time.
Hey thanks guys, much appriciated. Script seems to be working so far, no errors encountered.
Hi, I'm back but this time I have found an error. It appears if you set a parallel process that calls out the script call "in_range?(EVENT_ID, RANGE)" In my case it was:
in_range?(5, 25)
And as for the error message, it said:
Script 'Blizz ABS Addon - Enemy Vision' line 4: NoMethodError occurred
undefined method `x' for nil:NilClass
Oh yeah, I ask this to diagostimo. Can this script go into the database? I think it would be great script for those who can use Blizz ABS. I've seen similar scripts like this that are in the database and have tried them out a long time ago but with Blizz ABS they somehow do not work correctly(for example, an enemy can face up, you walk by its right and they still catch you, or enemy is facing down, you walk past their field of vision and nothing happens, I think that is what happened. I can't remember exactly but I did face something similar to what I explained) and this is probably the closest stealth script to Blizz ABS there is.