i did something like that, but with a simple distance script. If distance of an event is 0 from another mean theyr on the same square, but for that i would need that event ID. Is there no way to make an event touching another trigger withou needing specific variables for that event ? i will have like 12 doors n 15 npcs walking in/out of em, i would need something that can specify when ANY event is in determine when an event is there. Heres what ive tryed:
CODE
class Game_Event; attr_reader :event; end
class Game_Character
def Portz(switch_num)
frente = @y + 1
traz = @y - 1
if $game_player.x == @x and $game_player.y == frente
return true
else
if $game_player.x == @x and $game_player.y == traz
return true
else
if $game_map.events_xy(@x, frente).find {|e| e.event.name.include?('*')}
return true
print "bingo"
end
if $game_map.events_xy(@x, traz).find {|e| e.event.name.include?('*')}
return true
print "bingo"
end
end
end
end
end
Then , in the 'bingo' i could use a switch to open the door, using the switch_num given by the command. But however, when i use the comand Portz(2) for example in an event its get me an error of undefined method Portz.
Also by this method to work i would have to put a '*' on events that could open the door.
Wtf is wrong ? I need a solution for this.