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 am back asking for help with another modification to this script. I thought of doing this on my first post on the script but I called it solved and it's supposed to be closed. I have an enemy that I recently added that can take on the looks and ability of other enemies one of which was my first post on this script. Now the method for that one was naming the event flying beast. but from what I researched just renaming my shapeshifting event. Whenever it becomes the flying enemy was difficult and would not work.
So what my sleep-deprived brain is getting at is I needed to find a new method that gave me control to overrides the event overall region restrict on and off. My solution is to use event comments. I thought it was going to be easy but I hit roadblocks my good news is I have scripts that read the event comments already it just that yanfly script won't use it
here is one way I tried for testing it to get it to work
I am back asking for help with another modification to this script. I thought of doing this on my first post on the script but I called it solved and it's supposed to be closed. I have an enemy that I recently added that can take on the looks and ability of other enemies one of which was my first post on this script. Now the method for that one was naming the event flying beast. but from what I researched just renaming my shapeshifting event. Whenever it becomes the flying enemy was difficult and would not work.
So what my sleep-deprived brain is getting at is I needed to find a new method that gave me control to overrides the event overall region restrict on and off. My solution is to use event comments. I thought it was going to be easy but I hit roadblocks my good news is I have scripts that read the event comments already it just that yanfly script won't use it
here is one way I tried for testing it to get it to work
Code:
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 $game_map.events[1].note == (/<flight>/)
return true
end
return false if $game_map.npc_restrict_regions.include?(region)
if @event.name.downcase.include?(text.downcase)
return true
end
return false
end
def note
event_note = @event.note
p(@event.note)
/<flight>/ =~ event_note
return false unless $~
return true
end