Cant use vml array in lua

Discussion of Lua and LuaWML support, development, and ideas.

Moderators: Forum Moderators, Developers

Cant use vml array in lua

Postby Smok » June 14th, 2016, 7:05 pm

I have variable like this.
Code: Select all
         name = themes.elves
            code = Gg
            gold = 10
            code = Gg
            gold = 20

and lua code:
Code: Select all
local t = wesnoth.get_variable("themes.elves")

Should show 20, but error happens - nil value. Somehow wesnoth.message(string.format( shows 10. How i can use this wml array in lua?
Posts: 50
Joined: June 14th, 2016, 11:52 am

Re: Cant use vml array in lua

Postby gfgtdf » June 14th, 2016, 7:29 pm

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.
Posts: 914
Joined: February 10th, 2013, 2:25 pm

Return to Lua Labs

Who is online

Users browsing this forum: No registered users and 1 guest