I can offer you another vversion of this script:
MAP_LIST = {
#Mapid => Switchid
1 => 2,
2 => 3,
3 => 4,
}
class Scene_Map
alias update_auto_Switches_at_maps update_transfer_player unless $@
def update_transfer_player
for i in MAP_LIST.keys
if i == $game_map.map_id
$game_switches[MAP_LIST[i]] = true
else
$game_switches[MAP_LIST[i]] = false
end
end
update_auto_Switches_at_maps
end
end
Deity
really nice of you Deity , thanks a lot ^^
could i request a script if i ask you?
EDIT: this is what Mithran made
class Game_Map
SWITCH_BINDINGS = {
# map_id => switch_id
48 => 100
#~ 2 => 24,
#~ 3 => 64,
#~ 4 => 62
}
alias setup_orig_bind_switch_to_map setup
def setup(map_id)
$game_switches[SWITCH_BINDINGS[@map_id]] = false if SWITCH_BINDINGS.include?(@map_id)
$game_switches[SWITCH_BINDINGS[map_id]] = true if SWITCH_BINDINGS.include?(map_id)
setup_orig_bind_switch_to_map(map_id)
end
end