[tutorial]tile based level editor w/ array object

Post your own tutorials, guides and demos.

Post » Sat Feb 04, 2012 3:46 pm

heavily commented
only 13 events
loading/saving
tile 'painting' leftclick-drag to draw tiles/rightclick-drag to erase
bare bones example

download herelucid2012-02-04 15:48:38
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Wed Feb 08, 2012 8:13 pm

Wow, I didn't know i can use an expression when spawning an object! That's a great feature, the most useful one I've learned in months. Thank you for making such a great tutorial.

On the other hand, I think this method would lag a lot if i try to use it for making bigger tile maps.Wouldn't it be better if instead of destroying every tile every tick, and then recreating the whole map, you just change the tile that's under the mouse?

Here's my try for that:
http://dl.dropbox.com/u/52670878/MapArrayEditor.cap
It's an edit of an old example made by Thuwe, redesigned for superspeed when making huge maps.
B
6
S
1
G
1
Posts: 69
Reputation: 1,019

Post » Fri Feb 17, 2012 10:04 pm

i agree @shadowlord. also it'd be useful to have some type of behavior system, too. also more dimensions for more data about each thing, etc
I wanted to make it as basic as possible, so people have a bare bones example they can build off of, and learn from, without any extra frills making it harder to see how it works.
Spriter Dev
B
88
S
21
G
12
Posts: 3,240
Reputation: 16,486

Post » Sat Feb 18, 2012 6:31 am

13 events? Ha! My example of a tile based level editor used to explain the array object (source) uses more events overall, because it controls a selfmade gui, but the barebones only use 8 events for a full functional editor (look in group "Array" on layout "Array")

Now who's next? Do I hear 5? tulamide2012-02-18 06:32:57
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Feb 18, 2012 6:58 am

1
On click, text set text to getText&mouse.x&","&mouse.y&"|"

Course its a little different for the actual import.

Start of layout
->for n = 0 to getToken(string).count-2
-->system create object at int(tokenat(tokenat(string, loopindex("n"), "|"), 0, ","))
int(tokenat(tokenat(string, loopindex("n"), "|"), 1, ","))

And you add a loop for each sting..., or add another token to define a different object type, but you would have to do a for loop on a family.

I'll probably be using this method now since FF broke Rojo's canvas plug.
... end rant.

Any way its usable in both CC, and C2. In CC you can paste it as a variable, etc, or import as text. For C2 copy paste is the more obvious method, but you can import using jscript.newt2012-02-18 07:12:23
Image Image
B
161
S
48
G
91
Posts: 7,358
Reputation: 67,271


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests