1
Script Discussion / Can we use XML for 0.4?
« on: October 13, 2014, 03:41:51 pm »
Hi,
I wanted to ask whether we can use XML files for 0.4.If yes that please tell me the basic functions and if no then please tell me the best replace for XML.I wanted to use it for this :
I wanted to ask whether we can use XML files for 0.4.If yes that please tell me the basic functions and if no then please tell me the best replace for XML.I wanted to use it for this :
Quote from: stormeus
To save the path of the bus, you'd have to run a timer every 100ms and save it in an XML file or hash table with its own ID, which is created by making a variable that starts at zero and adding 1 every time the timer runs (so you'd get BusLoc0, BusLoc1, BusLoc2, etc.).
To load the bus' path, you'd load the XML file and read it in a while loop, with a counter that starts at 0 and increases every time the loop runs. As long as the loop can find an XML node with the name BusLoc<COUNTER>, it will write each location into a table that is stored in the server's memory.
You would then create a timer that runs every 100ms, the same rate you were saving the locations at, and move a vehicle to the next position in the table until it reaches the end and resets itself to BusLoc0.