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

Lua Labs • Re: How to move WML table

$
0
0
Loading it back in is going to be pretty much the same procedure as saving it was. The scalar ones should be easy, literally the exact same loop you used to save but flip the assignment. Container variables will be a bit more tricky. I think something along these lines may work?

Code:

local tags = {}for index, elem in ipairs(save_data) dotags[elem.tag] = trueendfor tag,_ in pairs(tags) dowml.array_variables[tag] = wml.child_array(save_data, tag)end
There might be a more efficient way (as each assignment here is probably looping over all of save_data again), but I think that approach should do the job.

Statistics: Posted by Celtic_Minstrel — Yesterday, 11:07 pm



Viewing all articles
Browse latest Browse all 1444

Trending Articles