Jump to content

[NOT SOLVED]Another XML question :/


denny199

Recommended Posts

Hey there,

I was making a new house system, but now I have got a problem

I don't know how I can get this:

  
<houses> 
        <house dim="0" interior="1" num="0" x="2132.9653320313" y="-1309.9451904297" z="23.981597900391" lx="2126.8481445313" ly="-1320.8674316406" lz="26.624277114868" cost="55555" owner="denny19" street="DenR Kutjes Street" sellprice="55555" lockStatus="unlock" NAAM_ah_grepaper2="http://www.mostert.org/3dindepraktijk/afbeeldingen/h4/cedfence.jpg" NAAM_ah_grepaper2="http://frexpaper.com/wp-content/uploads/2013/01/Wood-texture-image.jpg"></house> 
</houses> 
  
--etc... 
  

These lines from the file:

NAAM_ah_grepaper2="http://www.mostert.org/3dindepraktijk/afbeeldingen/h4/cedfence.jpg"

and this line:

NAAM_ah_texturename1="http://frexpaper.com/wp-content/uploads/2013/01/Wood-texture-image.jpg"

etc.. etc..

My local code of getting line one and further of the xml file.

  
housenumber = 0 
 root = xmlLoadFile ("homes.xml") 
  local houseHeadRootNode = xmlFindChild (root,"houses",0) 
  local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber))   
  
-- don't know how to continue 
  

So, how can I get those two lines?

Kindly Regards,

Danny

Edited by Guest
Link to comment

I tried different codes, but I still didn't find out why it didn't work:

Like:

function naamen() 
housenumber = 0 
 root = xmlLoadFile ("homes.xml") 
  local houseHeadRootNode = xmlFindChild (root,"houses",0) 
  local houseRootNode = xmlFindChild (houseHeadRootNode,"house",tonumber(housenumber))   
    for _, shader in ipairs ( xmlNodeGetChildren ( houseRootNode ) ) do 
        local name = xmlNodeGetName ( shader ):gsub ( "NAAM_", "" ) 
        outputChatBox ( name ) 
    end 
end 
end 
addCommandHandler ( "testname", naamen ) 

But nothing happens...

Link to comment

Just for the people who are not understanding me:

Well, I'm actually trying to make costum texture for houses from a link, so it will save in the xml system where all the houses with info are located for exmaple, I'm choosing ingame the world texture "funturf_bla" then that will save in the xml at the same line at where you are in like this:

NAAM_funturf_bla = "texturelinkfromwebsite.com/lol.png"

Now I want to get everything behind NAAM_ So After that I can get all the texturelinkfromwebsite.com/lol.png paths etc. So I can import it to a world texture with shaders from a website link.

Edit:

Sorry for double post.

Link to comment

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...