Quantcast
Channel: The Battle for Wesnoth Forums
Viewing all articles
Browse latest Browse all 1792

Lua Labs • Re: Updating side variables from LUA script.

$
0
0
The new way of accessing them is documented on the wiki here. You can also use the functions in the wml module on them now, which wasn't possible with the old way.

For example:

Code:

local my_side = wesnoth.sides[1]print(my_side.variables["tactics.tactic[0]"])-- prints {role = "assassin", count = 0, weight = 3}print(wml.array_access.get("tactics", my_side))-- prints {{role='assassin',count=0,weight=3},{role=hunter,count=0,weight=2},{count=0,weight=1}}

Statistics: Posted by Celtic_Minstrel — Yesterday, 1:49 pm



Viewing all articles
Browse latest Browse all 1792

Trending Articles