Page 1 of 1

Making a Level Creator

PostPosted: Wed Dec 11, 2013 9:38 am
by Hydef
Hi guys, I want to make a level creator so that users can create custom levels for my game. Would I have to save the levels as dat files, or is there anyone that can run me through on this? Thanks!

Re: Making a Level Creator

PostPosted: Wed Dec 11, 2013 4:55 pm
by skydereign
You don't need to use .dat as the file extension. Really there doesn't need to be any file extension, gE will read it in the same way. If you need some guidance there are a few examples/tutorials on this if you search the forums. Here's one Hblade did. http://game-editor.com/forum/viewtopic.php?f=4&t=12520&p=89557

Re: Making a Level Creator

PostPosted: Thu Dec 12, 2013 7:24 am
by Hydef
Thanks for that, but every time I search, it ignores editor. Can you help me post a link to one of the tutorials on it?

Re: Making a Level Creator

PostPosted: Fri Dec 13, 2013 7:45 pm
by skydereign
Hydef wrote:Thanks for that, but every time I search, it ignores editor.

That is quite unfortunate. I do remember there being one or two actual tutorials, but all I can find are examples (most of them Hblade's). However you could learn quite a lot just by taking a look at the code, and if you have questions about it feel free to ask. The general idea is that there is a 2d array that stores what tiles go where. You fill that in by placing the tiles and then save the array to a file. You can then do the reverse operation to load it into your game.

Re: Making a Level Creator

PostPosted: Wed Dec 18, 2013 5:41 pm
by Hydef
Oh okay, thanks anyway. im having another problem though. when i load another ged ingame using the loadgame function, and the loaded one has a tile actor, thee tiles do not appear at all. is there any solution to this? thanks!

Re: Making a Level Creator

PostPosted: Wed Dec 18, 2013 9:19 pm
by skydereign
Hydef wrote:when i load another ged ingame using the loadgame function, and the loaded one has a tile actor, thee tiles do not appear at all. is there any solution to this? thanks!

This won't happen when you export your game. But currently there is no way around it in the editor.

Re: Making a Level Creator

PostPosted: Thu Dec 19, 2013 10:17 am
by Hydef
ok, but im having another problem. in game mode, the second ged will load but without tiles. when i export it though, the second ged wont load at all, it wil just reload the same one. thanks for your help!

Re: Making a Level Creator

PostPosted: Sat Dec 21, 2013 8:50 am
by skydereign
What is the line of code you are using to load the file? And what is the file name of the game you are trying to load. I don't quite remember offhand the nuance behind what gE is able to understand (for instance loading file.ged will still work even if there is a file.exe or not). But that issue occurs when it cannot load the file you say to load (either the file does not exist, or is not a game to load).

Re: Making a Level Creator

PostPosted: Sat Dec 21, 2013 5:41 pm
by Hydef
never mind, i have solved it. i exported it as a dat instead of an exe. thanks for all your help.