Read from random File

Get help using Construct 2

Post » Thu Sep 06, 2012 11:32 pm

I know there is no direct way to do this, but I am open to suggestions.

I want to be able to read from a local folder a series of xml.

/root
Application.exe
/levels
1.xml
2.xml
3.xml

I want to be able to point Construct 2 at a folder, pick a file at random, and load it. One way is to say get file Int(Random(0,100))+".xml" or something like that. But I'm not seeing a way to do it on the fly. This leads to issues like people slipping bad data into an XML file.

(maybe put some type of key system in there)

I could make it one large XML, but I don't know if that is scaleable. Consider this, if I have an XML with 200 nodes of level data, you have to walk that entire document every time. If you break it up into 200 files, your app can target a much smaller dataset.

Thoughts?
B
30
S
10
G
7
Posts: 416
Reputation: 7,234

Return to How do I....?

Who is online

Users browsing this forum: Radulepy, tarek2, TiagoCesar and 18 guests