Jump to content

read from .map


Trevit

Recommended Posts

Posted

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?

Posted
  
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 
  

Posted

You should just use the map like normal, the use getElementsByType and getElementData...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...