DakiLLa Posted April 21, 2009 Share Posted April 21, 2009 hi. does xml has bugs in dp2.3? just i have a script which contains checks on xml nodes.. and sometimes script cant load file or something goes wrong so i cant do next operations.. well, the part of code: function onExitHouseMarkerHit( player ) -- when player hits marker... toggleAllControls( player, false ); setTimer( toggleAllControls, 2000, 1, player, true ); setTimer( xmlOperation, 1000, 1, source, player ); end function xmlOperation( marker, hitPlayer ) local houseNumber = getElementData( marker, "number" ); local hdb = xmlLoadFile( "houseDaBase.xml" ); local rootNode = xmlFindSubNode( hdb, "root", 0 ); local houseNode = xmlFindSubNode( hdb, "house"..tostring( houseNumber ), 0 ); local dim = xmlNodeGetAttribute( xmlFindSubNode( hdb, "house"..tostring( houseNumber ), 0 ), "dim" ); local playerDim = getElementDimension( hitPlayer ); if tonumber( dim ) == playerDim then local epX = xmlNodeGetAttribute( xmlFindSubNode( hdb, "house"..tostring( houseNumber ), 0 ), "epX" ); local epY = xmlNodeGetAttribute( xmlFindSubNode( hdb, "house"..tostring( houseNumber ), 0 ), "epY" ); local epZ = xmlNodeGetAttribute( xmlFindSubNode( hdb, "house"..tostring( houseNumber ), 0 ), "epZ" ); epX = tonumber( epX ); epY = tonumber( epY ); epZ = tonumber( epZ ); fadeCamera( hitPlayer, false, 1.0, 0, 0, 0 ); setTimer( fadeCamera, 1000, 1, hitPlayer, true, 1.0 ); setTimer( setElementInterior, 1000, 1, hitPlayer, 0, epX, epY, epZ ); setTimer( setElementDimension, 1000, 1, hitPlayer, 0 ); end end and after 5 minutes of good working script, i'm getting warnings (bad argument) in 'rootNode' and 'houseNode' nodes, so after these warnings script cant work fine.. and i need to restart a script again and again and again.. does this like bug and it fixed in 1.0 or i'm too dumb that i cant understand something ? Link to comment
[DKR]silverfang Posted April 21, 2009 Share Posted April 21, 2009 Is there any reason why you are using XML over SQL / MYSQL?? Link to comment
DakiLLa Posted April 22, 2009 Author Share Posted April 22, 2009 ehm... its my first time when i using data bases so i have started from xml.. I think that for sql's i need to have some experience, but i never tryed just to look what is this... Link to comment
Mr.Hankey Posted April 22, 2009 Share Posted April 22, 2009 You either need to use xmlSaveFile and xmlUnloadFile after you finished retrieving information from the file or just use xmlLoadFile onResourceStart and store it in a global variable rather than opening it everytime someone enters a house marker. Link to comment
DakiLLa Posted April 22, 2009 Author Share Posted April 22, 2009 yea, thx a lot, hankey, it works fine now 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