Cant use vml array in lua
Moderator: Forum Moderators
Cant use vml array in lua
I have variable like this.
and lua code:
Should show 20, but error happens - nil value. Somehow wesnoth.message(string.format(t.gold)) shows 10. How i can use this wml array in lua?
Code: Select all
[set_variables]
name = themes.elves
[value]
code = Gg
gold = 10
[/value]
[value]
code = Gg
gold = 20
[/value]
[/set_variables]
Code: Select all
local t = wesnoth.get_variable("themes.elves")
wesnoth.message(string.format(t[1].gold))
Re: Cant use vml array in lua
There is a doceuemntation about how wml talbes are encoded in lua in the Luawml wiki page.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.