Again I like how modules can make things simpler like so.
module Gv
def self.getval(id)
return $game_variables[id]
end
def self.setval(id, val)
$game_variables[id] = val
end
def self.addval(id, val)
$game_variables[id] += val
end
def self.subval(id, val)
$game_variables[id] -= val
end
def self.multval(id, val)
$game_variables[id] *= val
end
def self.divval(id, val)
$game_variables[id] / val
end
end
Ok instead of using something like this
$points = $game_variables[id]
you can use this instead
$points = Gv.getval(id)
To me it makes things alot quicker. Here are the different operatoins you can use
Gv.getval(id) # Get the value of the game variable
Gv.setval(id, val) # Set the value of the game variable
Gv.addval(id, val) # Add value to the game variable
Gv.subval(id, val) # Subtract value from the game variable
Gv.multval(id, val) # Multiply value to the game variable
Gv.divval(id, val) # Divide value by the game variable
id = variable id
val = the value you want to set/add/subtract/multiply/divide the variable to
I set modules to do something shorter for me when I know I'm going to be using alot of that command line. I also made on for play sounds so I can use very few letters to make it play a sound