Custom Level Editor?

For questions about using Classic.

Post » Tue Aug 25, 2009 3:13 am

I am considering building a level editor, and I was wondering if anyone has any suggestions as to what objects or methods might be worth looking into. To be a bit more precise, I am looking to build a level editor that has the following characteristics.

1: Supposing that I built a game that included this hypothetical level editor, an end user should be able to build a level from within the game application, rather than Construct. (This may be obvious, but I just wanted to clarify what I meant by "Custom Level Editor".)

2: From the game application, I would like to be able to save and load level files.

3: A level file should be able to store object instance xyz positions, as well as private variable values.

As far as I can tell, the main options I have for storing level data are the Text object, the Array object, the Hash Table object, the INI object, and possibly some strange usage of the save /load game actions. Of those, I'm leaning towards the Hash Table object at the moment, being that it's far faster to read from and write to than an INI, and will likely be significantly more flexible than an Array or the save/load actions, in terms of what I can store and how I can store it. Obviously there are drawbacks as well, and so before spending a lot of time on it, I figured I'd see if anyone has any advice or suggestions. :)
Posts: 306
Reputation: 5,431

Post » Tue Aug 25, 2009 3:49 am

Honestly I use .ini files along with level editing saving and loading I use hash tables as a varible container for each object that needs pvs because they are easy to set up at runtime. I also made a plugin that makes for easy loading back in for the .ini file and recently modded it to be able to load values into a hash table attached to an object as long as they are in containers.

the problem with hash table it there is no way to easily Identify the object unless you did something like 1name = sprite1 1x=36 1y=24 1z=3 wich could get tedious especially if you wanted pvs to be loaded as well.

with an .ini file every thing is grouped nicely and easy to go load and loop through.


all those values are easily loaded into the runtime with one event
[code:l2poat0l]-foreach group- create object (ini.currentgroup,oid), at (currentgroup,x), (current group y) on layer (currentgroup, z) at angle current group,a.
--for each Item
--current item =/= a,x,y,z,oid-> hash table insert key STR(currentItem), with value ini.value(currentgroup, current Item)[/code:l2poat0l]

Thats pretty close the the sytax I just got off a 12 hour shift at work I have a cap where I tested this and it worked perfectly ill see if I cant dig it up for you ( you would need to install my plugin though)
Posts: 632
Reputation: 2,829

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests