Trevit Posted June 2, 2011 Share Posted June 2, 2011 Hi, I have a little scripting problem: I have the following line in my map file: Now i want to read the line ( from an other resource ) in the script. Spawnpoints = {} Spawnpoints = -- read all spawnpoints How can i manage it? Link to comment
karlis Posted June 2, 2011 Share Posted June 2, 2011 function getNodes(mapfile,name) local xml=xmlLoadFile(mapfile) local tbl={} if xml then local child=xmlNodeGetChildren(xml) for k,v in ipairs(child) do if xmlNodeGetName(v)==name then tbl[#tbl+1]=xmlNodeGetAttributes(v) end end return tbl end end Link to comment
Trevit Posted June 2, 2011 Author Share Posted June 2, 2011 it returns 2 spawnpoints but there is only 1 Link to comment
karlis Posted June 2, 2011 Share Posted June 2, 2011 strange, it should return table containing tables of all info about particular child... Link to comment
eAi Posted June 4, 2011 Share Posted June 4, 2011 You should just use the map like normal, the use getElementsByType and getElementData... Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now