Platform-Level Editor(P-LED)

For questions about using Classic.

Post » Wed Mar 31, 2010 10:35 am

I am making a platform game level editor for..ahem..no reason and the basic stuff is pretty much done but still I have many problems. Here is the .cap

Please refer to the in game help or the readme file before testing it.

[url:1bjkdhp0]http://www.box.net/shared/rbtzq89jia[/url:1bjkdhp0]

(used construct v0.99.84)



Now, about the problems :
How to make the screen scrollable?, not like that it follows player but when he user is editing the level and he wants to scroll the layout using arrow keys but when he starts the level(to play) the level scrolls with the player, i know it's kind of confusing

one way is to make a invisible sprite with 8 direction behaviour that can help in scrolling but when the level is stopped for editing then the timeScale is set 0 so the behaviour will not respond


How to save the level?, I tried using the save/load function and saving the level and next time the player opens the editor it loads automatically from the saved file. But here the problem is when there is not saved file(i.e the user starts the editor for the first time) the editor works but when the user starts the editor for the second time(i.e there is a saved file from previous time) the temp.exe crashes.

Hope you understand what I want to say.

Right now everything is messed up because everything is controlled by shortcut keys and many times I am also confused while making a level(you don't know how much time I spent making that level in sreenshot)

If you make something nice with the editor, feel free to post the screenshot(please!!)
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Wed Mar 31, 2010 12:50 pm

I made a level editor once, for a game project that has been halted for a bit...

viewtopic.php?f=3&t=5272&p=42276&hilit=gammabeam+editor#p41889

The editor saves a 8 x 10 level made from a tile set.
The interface is very crappy, there's no feedback :P

It basically stores different types of rooms, so you design the room by clicking the tiles and dragging the level. Then, you type the number of the room you want to save and press "save"... You can repeat this to every other room. When you want to save your levels, you just have to press "Publish" - it will save a text file on the same folder of your .cap. To load the levels again, restart the level and press open. Then, type the numbers you want to load and press "load".

Well, since this was a prototype, I wasn't trying to make it functional yet. But the whole saving/loading works very well!

If you need any additional advice, keep on asking! I don't know how familiar you are with Construct, but these events should be hard to understand.

EDIT**
Oops I forgot about the scrolling thing.

The System events have a "Scroll to X" and "Scroll to Y", and you have the ScrollX and ScrollY values too. So you can easily do a:

* "X" key is down ---> System: Scroll to X - ScrollX + 10

Voil!
B
107
S
40
G
10
Posts: 456
Reputation: 13,202

Post » Wed Mar 31, 2010 5:21 pm

thanks for your help , like you said I couldn't understand a thing :( since I am a beginner and don't know much about stuff like array, ini files etc.
I think I will have to remake the whole thing and use tiles instead of just duplicating a sprite and dragging it and should probably change the name to something else P-LED sounds ugly...

And one more question - is there any way to load an external image as the sprite at RUNTIME?
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Wed Mar 31, 2010 5:38 pm

[quote="abhilash2863":wmp2v95s]And one more question - is there any way to load an external image as the sprite at RUNTIME?[/quote:wmp2v95s]

Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Mar 31, 2010 5:42 pm

hehe nice way to reply... :lol: but i tried it and it didn't work, it may sound a little dumb but i did the following -
save the external file which is of same size of the sprite and and saved it in .gif format(i suppose it is the only format which can have animation) and used the condition you circled in pic and the path as
apppath & "pic.gif" but it didn't work :(
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Wed Mar 31, 2010 5:49 pm

Construct doesn't use .gifs. You should use .png.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Mar 31, 2010 5:54 pm

[quote="abhilash2863":2d4yj69d]save the external file which is of same size of the sprite and and saved it in .gif format(i suppose it is the only format which can have animation) and used the condition you circled in pic and the path as
apppath & "pic.gif" but it didn't work :([/quote:2d4yj69d]
It didn't work because this is not the way to import animations. Look closely at the action. It says: Load animation frame from file. What you have to do is split your animation to as many images as needed and then load them one by one. Also, you are using the wrong image format. Supported format are listed here

EDIT: Damn, too slow again :mrgreen:
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Wed Mar 31, 2010 6:03 pm

yay! it worked :D
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Tue May 11, 2010 10:59 am

hi
Thank you for this exemple, it's interesting.

I would like to create a level-map editor for the game I work on, so I will study your example, and the example of gammabeam for the save\load technics, even if I prefer to have map separated (not in a big file).

Have you plain to add other things, like color change ?Can we change the RGB value of a sprite ? I have don't find that.

Another thing : I would like to know what is the "string" saved when we save a map made with your editor ?


Thank you :)
B
2
S
1
G
2
Posts: 23
Reputation: 846

Post » Tue May 11, 2010 1:23 pm

i'm sorry to tell but i stopped working on this experiment a while ago but i do have a another version in which is more simplified and usable and a save/load function can be implemented easily in it. But in this example save/load is almost impossible. Colour change can be done i think, there are events for that(maybe). You can even have sprites frames loaded at runtime giving the user ability to use his own sprites. My other example has this feature.

I'll upload it later maybe after an hour or two...going for classes :)
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests