I've been looking for instructions/tutorials to remove the global variables I've used, but when I follow the directions I found, it does not work. I've tried to put in attr_accessor in the game interpreter, and game_actor but the information does not pass through unless I use a global variable. I also tried making a game temp to do this, again no good.
Here is what I have setup to try and pass through variable/switch data from game interpreter.
However what works is if I use global variables and do this
Advice?
Here is what I have setup to try and pass through variable/switch data from game interpreter.
Code:
class Game_Interpreter
attr_accessor :sublevelup
attr_accessor :sublevelcnt
def command_316
$game_temp.sublevelup = true
value = operate_value(@params[2], @params[3], @params[4])
$game_temp.sublevelcnt = value
iterate_actor_var(@params[0], @params[1]) do |actor|
actor.change_level(actor.level + value, @params[5])
end
end
end
class Game_Temp
attr_accessor :sublevelup
attr_accessor :sublevelcnt
alias r2_old_init_92sd initialize
def initialize
r2_old_init_92sd
@sublevelup = false
@sublevelcnt = 0
end
end
class Game_Actor < Game_Battler
attr_accessor :sublevelup
attr_accessor :sublevelcnt
However what works is if I use global variables and do this
Code:
class Game_Interpreter
def command_316
$sublevelup = true
value = operate_value(@params[2], @params[3], @params[4])
$sublevelcnt = value.to_i
iterate_actor_var(@params[0], @params[1]) do |actor|
actor.change_level(actor.level + value, @params[5])
end
end
end
class Game_Actor < Game_Battler
Advice?