darkcieran
Member
I tried to use a cond. branch to check if a certain group of switches are on but got an error. I used $game_switches[10...14].id = true. but got an error msg. any ideas?so
darkcieran":307wi7pf said:I tried to use a cond. branch to check if a certain group of switches are on but got an error. I used $game_switches[10...14].id = true. but got an error msg. any ideas?
switch_ids = (10..14).to_a
switch_ids.each { |id|
$game_switches[x] = true if
$game_switches[id] == true}
class Game_Switches
def [](switch_id)
if switch_id.is_a?(Range)
return ( legal_range(switch_id) ? @data[switch_id] : [] )
end
if switch_id <= 5000 and @data[switch_id] != nil
return @data[switch_id]
else
return false
end
end
def legal_range(r)
return ( (r.first > 0) and (r.last <= 5000) )
end
end