INI Level Loader for SuperV

Post your own tutorials, guides and demos.

Post » Sat Sep 27, 2008 3:37 pm

Here is a INI Level Loader example for the topic here: [url:3ck5mt56]http://www.scirra.com/phpBB3/viewtopic.php?f=3&t=1704[/url:3ck5mt56]

Just download the .cap and open notepad and paste this

[code:3ck5mt56][Global]
NumObjs=2

[Obj1]
Type = Sprite1
X = 3
Y = 5

[Obj2]
Type = Sprite2
X = 6
Y = 7[/code:3ck5mt56]

Save the notepad file as Level1.ini inside the same folder as the .cap and run =)

EDIT: Replaced the file with a shorter name, for some reason the file seemed to crash alot with the old name (IniLevelLoader)

EDIT 2: Here is an advanced version of the loader -> [url:3ck5mt56]http://www.scirra.com/forum/viewtopic.php?f=8&t=1721#p12309[/url:3ck5mt56]

EDIT 3: Here's the editor for the advanced loader -> [url:3ck5mt56]http://www.scirra.com/forum/viewtopic.php?f=8&t=1721#p12414[/url:3ck5mt56]
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sat Sep 27, 2008 4:49 pm

Thanks! :D

Looking at it now, you've been very gentle :)
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Sat Sep 27, 2008 4:53 pm

I hope it does what you need ^^ If not then I made a few changes so it can also support loading the objects width, height and rotation and I can upload it too.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sat Sep 27, 2008 5:04 pm

Very useful! I got it :D

Upload the other one, it can be useful!
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Sat Sep 27, 2008 5:10 pm

Ok, but you also need to change the Ini file to this (however, the old .cap will ignore the extra commands and also still work with it)

[code:3ry4usxp][Global]
NumObjs=2

[Obj1]
Type = Sprite1
X = 100
Y = 100
Width = 64
Height = 64
Rot = 0

[Obj2]
Type = Sprite2
X = 102
Y = 102
Width = 32
Height = 32
Rot = 45[/code:3ry4usxp]
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sat Sep 27, 2008 5:43 pm

Maybe I'm asking too much now... But is it possible to make a level editor that saves to a INI?
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Sat Sep 27, 2008 6:20 pm

Yep, ill make another example, dont worry about asking because this is how the community gets better games and Construct gets noticed :D Although, I might not get it done tonight.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sat Sep 27, 2008 7:44 pm

Thank you!!!
You are so friendly :D
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Post » Sun Sep 28, 2008 5:50 pm

No problem SuperV glad to help.

Ok I have created the level editor, it works well but has no layering (red objects are always on top of the black objects when saved/loaded). It is easy to do this by adding and saving another value ("Z") to the INI file but then you would need to also edit the level loader. If you need this then I can do it, but you probably know how to do it now :wink:

Hope it helps :D
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sun Sep 28, 2008 7:43 pm

Awesome! Mind if I use an heavily-modified version of that for my game?
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

Next

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests