LightFighter's Lua Lab
Moderator: Forum Moderators
Re: LightFighter's Lua Lab
Because of the quotes, that will store the value into a variable called "cfg.save_in" (that is, "[cfg]save_in=") instead of the correct place. Also it may be userfriendlier to provide a default variable name:LightFighter wrote:Code: Select all
wesnoth.set_variable("cfg.save_in", cfg[wesnoth.get_variable "difficulty"])
Code: Select all
wesnoth.set_variable(cfg.save_in or "quantity", cfg[wesnoth.get_variable "difficulty"])
Re: LightFighter's Lua Lab
I know I have a lot to learn...silene wrote:Because of the quotes, that will store the value into a variable called "cfg.save_in" (that is, "[cfg]save_in=") instead of the correct place. Also it may be userfriendlier to provide a default variable name:LightFighter wrote:Code: Select all
wesnoth.set_variable("cfg.save_in", cfg[wesnoth.get_variable "difficulty"])
Code: Select all
wesnoth.set_variable(cfg.save_in or "quantity", cfg[wesnoth.get_variable "difficulty"])
Formerly known as the creator of Era of Chaos and maintainer of The Aragwaithi and the Era of Myths.