AgentN107

Bringer of laughter
Veteran
Joined
Aug 21, 2018
Messages
33
Reaction score
3
First Language
English
Primarily Uses
RMVXA
so first of all I am making a modification to YANFLYS Move Restrict Region script here https://yanflychannel.wordpress.com/rmvxa/field-scripts/move-restrict-region/
I made a change if I name an event in the editor it overrides the event overall region restrict. Now all of this has been going well the problem is that if I name one event the right name all events get the effect. so how do I make it only affect the event with the name? oh and here is my custom code
def event_name
return true if @map.events[@num].name == "Flying Beast"
return false
end

I did try making an event reader but could not find a way to stop it at the last event
def event_name
@num = 1
name = ""
while "Flying Beast" != name
name = @map.events[@num].name
@num = @num + 1
end
return true if @map.events[@num].name == "Flying Beast"
return false
end
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,984
Reaction score
665
First Language
English
Primarily Uses
RMVXA
I added that option onto the script I had previously updated.
Put the name flying in the name of the event and the script will take care of the rest.
Change the word if you wish.
Ruby:
#==============================================================================
#
# ▼ Yanfly Engine Ace - Move Restrict Region v1.03d
# -- Last Updated: 2021.03.07
# -- Level: Normal
# -- Requires: n/a
# -- additions by Roninator2
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-MoveRestrictRegion"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2021.03.07 - Added Feature: npc unrestricted # roninator2
# 2019.07.25 - Added Feature: <player fly: x> # roninator2 for Galv Superman
# 2019.05.27 - Added Feature: <player block: x> # roninator2
# 2018.10.14 - Added Feature: <vehicle restrict: x> # roninator2
# 2012.08.26 - Added Feature: <all restrict: x>
# 2011.12.26 - Bug Fixed: Player Restricted Regions.
# 2011.12.15 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Not everybody wants NPC's to travel all over the place. With this script, you
# can set NPC's to be unable to move pass tiles marked by a specified Region.
# Simply draw out the area you want to enclose NPC's in on and they'll be
# unable to move past it unless they have Through on. Likewise, there are
# regions that you can prevent the player from moving onto, too!
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Map Notetags - These notetags go in the map notebox in a map's properties.
# -----------------------------------------------------------------------------
# <all restrict: x>
# <all restrict: x, x>
# Players and NPC's on the map will be unable to move past region x even if
# they have the "through" flag set. The only thing that can go past is if the
# player is using the debug through flag. Draw out the area you want to close
# the player and NPC's in with the regions and both will be unable to move onto
# any of those tiles marked by region x. If you want to have more regions
# restrict NPC's, insert multiples of this tag.
#
# <npc restrict: x>
# <npc restrict: x, x>
# NPC's on that map will be unable to move past regions x unless they have a
# "Through" flag on. Draw out the area you want to close NPC's in with the
# regions and the NPC's will be unable to move onto any of those tiles marked
# by region x. If you want to have more regions restrict NPC's, insert
# multiples of this tag.
#
# <player restrict: x>
# <player restrict: x, x>
# Players will not be able to move on tiles marked by region x unless the
# player has a "Through" flag on. Draw out the area you want to close the
# player in with the regions and the player will be unable to move past any of
# those tiles marked by region x. If you want to have more regions restrict the
# player, insert multiples of this tag.
#
# <player block: x>
# <player block: x, x>
# Players will not be able to move on tiles marked by region x even if
# they have the "through" flag set. The only thing that can go past is if the
# player is using the debug through flag. Draw out the area you want to close the
# player in with the regions and the player will be unable to move past any of
# those tiles marked by region x. If you want to have more regions restrict the
# player, insert multiples of this tag.
#
# <player fly: x>
# <player fly: x, x>
# Players will not be able to move on tiles marked by region x even if
# they have the "through" flag set. The only thing that can go past is if the
# player is using the debug through flag. Draw out the area you want to close the
# player in with the regions and the player will be unable to move past any of
# those tiles marked by region x. If you want to have more regions restrict the
# player, insert multiples of this tag.
#
# <vehicle restrict: x>
# <vehicle restrict: x, x>
# Players will not be able to move on tiles marked by region x unless the
# player has a "Through" flag on. Draw out the area you want to close the
# player in with the regions and the player will be unable to move past any of
# those tiles marked by region x. If you want to have more regions restrict the
# player, insert multiples of this tag.
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
  module MOVE_RESTRICT
 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Default Completely Restricted Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want there to always be a region ID that will forbid both the
    # player and NPC's from passing through, insert that region ID into the
    # array below. This effect will completely block out both players and NPC's
    # even if they have the "through" flag. However, it does not block the
    # debug_through flag for players.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    DEFAULT_ALL = [60]
 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Default Player Restricted Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want there to always be a region ID that will forbid the player
    # from passing through, insert that region ID into the array below.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    DEFAULT_PLAYER = [61]
 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Default Player Blocked Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want there to always be a region ID that will forbid the player
    # from passing through, insert that region ID into the array below.
    # Including if @through is set.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    PLAYER_BLOCK = [59]
 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Default Player fly Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want there to always be a region ID that will forbid the player
    # from passing through, insert that region ID into the array below.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    PLAYER_FLY = [58]
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Default NPC Restricted Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want there to always be a region ID that will forbid NPC's from
    # passing through, insert that region ID into the array below.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    DEFAULT_NPC = [62]
 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Override NPC Restricted Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want an NPC to be unrestricted, add the name below to the
    # event name
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    EXCLUDE_NPC = "flying"
 
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Default Player Restricted Regions -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # If you want there to always be a region ID that will forbid the player
    # from passing through, insert that region ID into the array below.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    DEFAULT_VEHICLE = [63]
 
  end # MOVE_RESTRICT
end # YEA

#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

module YEA
  module REGEXP
  module MAP
 
    ALL_RESTRICT =
      /<(?:ALL_RESTRICT|all restrict):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    NPC_RESTRICT =
      /<(?:NPC_RESTRICT|npc restrict):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    PLAYER_RESTRICT =
      /<(?:PLAYER_RESTRICT|player restrict):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    PLAYER_BLOCK =
      /<(?:PLAYER_BLOCK|player block):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    PLAYER_FLY =
      /<(?:PLAYER_FLY|player fly):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
    VEHICLE_RESTRICT =
      /<(?:VEHICLE_RESTRICT|vehicle restrict):[ ]*(\d+(?:\s*,\s*\d+)*)>/i
 
  end # MAP
  end # REGEXP
end # YEA

#==============================================================================
# ■ RPG::Map
#==============================================================================

class RPG::Map
 
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :all_restrict_regions
  attr_accessor :npc_restrict_regions
  attr_accessor :player_restrict_regions
  attr_accessor :player_block_regions
  attr_accessor :player_fly_regions
  attr_accessor :vehicle_restrict_regions
 
  #--------------------------------------------------------------------------
  # common cache: load_notetags_mrr
  #--------------------------------------------------------------------------
  def load_notetags_mrr
    @all_restrict_regions = YEA::MOVE_RESTRICT::DEFAULT_ALL.clone
    @npc_restrict_regions = YEA::MOVE_RESTRICT::DEFAULT_NPC.clone
    @player_restrict_regions = YEA::MOVE_RESTRICT::DEFAULT_PLAYER.clone
    @player_block_regions = YEA::MOVE_RESTRICT::PLAYER_BLOCK.clone
    @player_fly_regions = YEA::MOVE_RESTRICT::PLAYER_FLY.clone
    @vehicle_restrict_regions = YEA::MOVE_RESTRICT::DEFAULT_VEHICLE.clone
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::MAP::ALL_RESTRICT
        $1.scan(/\d+/).each { |num|
        @all_restrict_regions.push(num.to_i) if num.to_i > 0 }
      when YEA::REGEXP::MAP::NPC_RESTRICT
        $1.scan(/\d+/).each { |num|
        @npc_restrict_regions.push(num.to_i) if num.to_i > 0 }
      when YEA::REGEXP::MAP::PLAYER_RESTRICT
        $1.scan(/\d+/).each { |num|
        @player_restrict_regions.push(num.to_i) if num.to_i > 0 }
      when YEA::REGEXP::MAP::PLAYER_BLOCK
        $1.scan(/\d+/).each { |num|
        @player_block_regions.push(num.to_i) if num.to_i > 0 }
      when YEA::REGEXP::MAP::PLAYER_FLY
        $1.scan(/\d+/).each { |num|
        @player_fly_regions.push(num.to_i) if num.to_i > 0 }
      when YEA::REGEXP::MAP::VEHICLE_RESTRICT
        $1.scan(/\d+/).each { |num|
        @vehicle_restrict_regions.push(num.to_i) if num.to_i > 0 }
      #---
      end
    } # self.note.split
    #---
  end
 
end # RPG::Map

#==============================================================================
# ■ Game_Map
#==============================================================================

class Game_Map
 
  #--------------------------------------------------------------------------
  # alias method: setup
  #--------------------------------------------------------------------------
  alias game_map_setup_mrr setup
  def setup(map_id)
    game_map_setup_mrr(map_id)
    @map.load_notetags_mrr
  end
 
  #--------------------------------------------------------------------------
  # new method: all_restrict_regions
  #--------------------------------------------------------------------------
  def all_restrict_regions
    return @map.all_restrict_regions
  end
 
  #--------------------------------------------------------------------------
  # new method: npc_restrict_regions
  #--------------------------------------------------------------------------
  def npc_restrict_regions
    return @map.npc_restrict_regions
  end
 
  #--------------------------------------------------------------------------
  # new method: player_restrict_regions
  #--------------------------------------------------------------------------
  def player_restrict_regions
    return @map.player_restrict_regions
  end
 
  #--------------------------------------------------------------------------
  # new method: player_restrict_regions
  #--------------------------------------------------------------------------
  def player_block_regions
    return @map.player_block_regions
  end
 
  #--------------------------------------------------------------------------
  # new method: player_fly_regions    Galv Superman addon
  #--------------------------------------------------------------------------
  def player_fly_regions
    return @map.player_fly_regions
  end
 
  #--------------------------------------------------------------------------
  # new method: player_restrict_regions
  #--------------------------------------------------------------------------
  def vehicle_restrict_regions
    return @map.vehicle_restrict_regions
  end

end # Game_Map

#==============================================================================
# ■ Game_CharacterBase
#==============================================================================

class Game_CharacterBase
 
  #--------------------------------------------------------------------------
  # alias method: passable?
  #--------------------------------------------------------------------------
  alias game_characterbase_passable_mrr passable?
  def passable?(x, y, d)
        return true if npc_exclude_allow?(x, y, d)
    return false if npc_region_forbid?(x, y, d)
    return false if player_region_forbid?(x, y, d)
    return false if player_block_forbid?(x, y, d)
    return false if player_fly_forbid?(x, y, d) unless !@in_air
    return false if vehicle_region_forbid?(x, y, d)
    return game_characterbase_passable_mrr(x, y, d)
  end
 
  #--------------------------------------------------------------------------
  # new method: npc_forbid?
  #--------------------------------------------------------------------------
  def npc_region_forbid?(x, y, d)
    return false unless self.is_a?(Game_Event)
    region = 0
    case d
    when 1; region = $game_map.region_id(x-1, y+1)
    when 2; region = $game_map.region_id(x+0, y+1)
    when 3; region = $game_map.region_id(x+1, y+1)
    when 4; region = $game_map.region_id(x-1, y+0)
    when 5; region = $game_map.region_id(x+0, y+0)
    when 6; region = $game_map.region_id(x+1, y+0)
    when 7; region = $game_map.region_id(x-1, y-1)
    when 8; region = $game_map.region_id(x+0, y-1)
    when 9; region = $game_map.region_id(x+1, y-1)
    end
    return true if $game_map.all_restrict_regions.include?(region)
    return false if @through
    return $game_map.npc_restrict_regions.include?(region)
  end
 
  #--------------------------------------------------------------------------
  # new method: npc_exclude_allow?
  #--------------------------------------------------------------------------
  def npc_exclude_allow?(x, y, d)
    return false unless self.is_a?(Game_Event)
    region = 0
    case d
    when 1; region = $game_map.region_id(x-1, y+1)
    when 2; region = $game_map.region_id(x+0, y+1)
    when 3; region = $game_map.region_id(x+1, y+1)
    when 4; region = $game_map.region_id(x-1, y+0)
    when 5; region = $game_map.region_id(x+0, y+0)
    when 6; region = $game_map.region_id(x+1, y+0)
    when 7; region = $game_map.region_id(x-1, y-1)
    when 8; region = $game_map.region_id(x+0, y-1)
    when 9; region = $game_map.region_id(x+1, y-1)
    end
    text = "#{YEA::MOVE_RESTRICT::EXCLUDE_NPC}"
    if @event.name.downcase.include?(text.downcase)
      return true
    end
    return false
  end
 
  #--------------------------------------------------------------------------
  # new method: player_region_forbid?
  #--------------------------------------------------------------------------
  def player_region_forbid?(x, y, d)
    return false unless self.is_a?(Game_Player)
    return false if debug_through?
    region = 0
    case d
    when 1; region = $game_map.region_id(x-1, y+1)
    when 2; region = $game_map.region_id(x+0, y+1)
    when 3; region = $game_map.region_id(x+1, y+1)
    when 4; region = $game_map.region_id(x-1, y+0)
    when 5; region = $game_map.region_id(x+0, y+0)
    when 6; region = $game_map.region_id(x+1, y+0)
    when 7; region = $game_map.region_id(x-1, y-1)
    when 8; region = $game_map.region_id(x+0, y-1)
    when 9; region = $game_map.region_id(x+1, y-1)
    end
    return true if $game_map.all_restrict_regions.include?(region)
    return false if @through
    return $game_map.player_restrict_regions.include?(region)
  end
 
  #--------------------------------------------------------------------------
  # new method: player_region_forbid?
  #--------------------------------------------------------------------------
  def player_block_forbid?(x, y, d)
    return false unless self.is_a?(Game_Player)
    return false if debug_through?
    region = 0
    case d
    when 1; region = $game_map.region_id(x-1, y+1)
    when 2; region = $game_map.region_id(x+0, y+1)
    when 3; region = $game_map.region_id(x+1, y+1)
    when 4; region = $game_map.region_id(x-1, y+0)
    when 5; region = $game_map.region_id(x+0, y+0)
    when 6; region = $game_map.region_id(x+1, y+0)
    when 7; region = $game_map.region_id(x-1, y-1)
    when 8; region = $game_map.region_id(x+0, y-1)
    when 9; region = $game_map.region_id(x+1, y-1)
    end
    return true if $game_map.all_restrict_regions.include?(region)
    return true if $game_map.all_restrict_regions.include?(region) && @through || @in_air
    return $game_map.player_block_regions.include?(region)
  end
 
  #--------------------------------------------------------------------------
  # new method: player_region_forbid?
  #--------------------------------------------------------------------------
  def vehicle_region_forbid?(x, y, d)
    return false unless self.is_a?(Game_Vehicle)
    return false if debug_through?
    region = 0
    case d
    when 1; region = $game_map.region_id(x-1, y+1)
    when 2; region = $game_map.region_id(x+0, y+1)
    when 3; region = $game_map.region_id(x+1, y+1)
    when 4; region = $game_map.region_id(x-1, y+0)
    when 5; region = $game_map.region_id(x+0, y+0)
    when 6; region = $game_map.region_id(x+1, y+0)
    when 7; region = $game_map.region_id(x-1, y-1)
    when 8; region = $game_map.region_id(x+0, y-1)
    when 9; region = $game_map.region_id(x+1, y-1)
    end
    return true if $game_map.all_restrict_regions.include?(region)
    return false if @through
    return $game_map.vehicle_restrict_regions.include?(region)
  end
 
  #--------------------------------------------------------------------------
  # new method: player_fly_forbid? - Galv superman addon
  #--------------------------------------------------------------------------
  def player_fly_forbid?(x, y, d)
    return false unless self.is_a?(Game_Player)
    return false if debug_through?
    region = 0
    case d
    when 1; region = $game_map.region_id(x-1, y+1)
    when 2; region = $game_map.region_id(x+0, y+1)
    when 3; region = $game_map.region_id(x+1, y+1)
    when 4; region = $game_map.region_id(x-1, y+0)
    when 5; region = $game_map.region_id(x+0, y+0)
    when 6; region = $game_map.region_id(x+1, y+0)
    when 7; region = $game_map.region_id(x-1, y-1)
    when 8; region = $game_map.region_id(x+0, y-1)
    when 9; region = $game_map.region_id(x+1, y-1)
    end
    return true if $game_map.all_restrict_regions.include?(region) unless @in_air
    return true if $game_map.player_fly_regions.include?(region) && @in_air
    return $game_map.player_fly_regions.include?(region)
  end
 
end # Game_CharacterBase

#==============================================================================
#
# ▼ End of File
#
#==============================================================================
 

AgentN107

Bringer of laughter
Veteran
Joined
Aug 21, 2018
Messages
33
Reaction score
3
First Language
English
Primarily Uses
RMVXA
Oh this gives some other features on top that's neat and looking at the update log galvs superman script can be used which is a great bonus. Sorry for a but getting in here but I will start with explaining how am doing the mechanic so I have enimes events that need through on to enteract with other events so I use the overall reagion restrict to keep them no going anywhere. Now there are red spots where they can't cross but the player can. My flying versions of these enimes are well flying unlike the others it can travel anywhere ecept for story reasons and mechanics not the red spot which was working with the code I gave in the op post. I do see in your script mod that the player can be blocked in flight so I am guessing this is possiable for events but if there are easer ways to do it which is why I explined the mechanic would be fine to.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,984
Reaction score
665
First Language
English
Primarily Uses
RMVXA
I have enimes events that need through on to enteract with other events
if you need the npc's to move with through on then change line 346 to true
this will not block npc's for the npc block region
 

AgentN107

Bringer of laughter
Veteran
Joined
Aug 21, 2018
Messages
33
Reaction score
3
First Language
English
Primarily Uses
RMVXA
if you need the npc's to move with through on then change line 346 to true
this will not block npc's for the npc block region
Oh sorry, I already knew that and had done that already. I brought it up for full clarity of how I have things currently set up. My problem was directed at if I should do a slight restructure of my use of my setup or have another feature on the script that must be possible as player flight restricts. so event flight restricts. I just don't want anyone doing more work than they need to.



EDIT: okay I found it and did not want to double post so I waited for a reply so I wouldn't double post. To future devs I went to the line npc_exclude_allow? and replaced/added the event restrict like this

def npc_exclude_allow?(x, y, d)
return false unless self.is_a?(Game_Event)
region = 0
case d
when 1; region = $game_map.region_id(x-1, y+1)
when 2; region = $game_map.region_id(x+0, y+1)
when 3; region = $game_map.region_id(x+1, y+1)
when 4; region = $game_map.region_id(x-1, y+0)
when 5; region = $game_map.region_id(x+0, y+0)
when 6; region = $game_map.region_id(x+1, y+0)
when 7; region = $game_map.region_id(x-1, y-1)
when 8; region = $game_map.region_id(x+0, y-1)
when 9; region = $game_map.region_id(x+1, y-1)
end
text = "#{YEA::MOVE_RESTRICT::EXCLUDE_NPC}"
return false if $game_map.npc_restrict_regions.include?(region)
if @event.name.downcase.include?(text.downcase)
return true
end
return false
end

it now works as intended. thanks for all help mods may close this now
 
Last edited:

Latest Threads

Latest Profile Posts

[CM]
5VaUMjAFpz1I6fSsgDrfJc.jpg

Title is star.
Dam, does the night get to me, I sound and look like a monster. Its 3:54 am right now...I need sleep...or...coffee.
It has nothing to do with my project, but I'm in love with voxels
If you feel like your story isn't that great, just look at final fantasy.
Nightmare Traveler: A game where we play as... the bad guy?

Forum statistics

Threads
110,484
Messages
1,053,613
Members
143,572
Latest member
Sparyx
Top