I herd you like map editors

Post your own tutorials, guides and demos.

Post » Fri Jan 21, 2011 12:45 am

So I put a editor in your map, so you can edit while you....
map.


Details follow....
From the Wiki:
[code:th8qqjys]Operator Meaning Example
at, @ Array access {1, 7, 4} at 2 (= 7) [/code:th8qqjys]

With the format used for "Set XY":
{x,y}
You can make an array:
{{x1,y1},{x2,y2}}

So basically what I'm saying is: with this you can simply paste an array into your events instead of importing an external file.

Included in the cap is a basic editor, and an example of a pasted array.
Hence the editor in your map... blah, blah, blah.


[url:th8qqjys]http://dl.dropbox.com/u/666516/pasta-editor.cap[/url:th8qqjys]

Questions?
Comments?
Pimp my cap?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Mon Jan 24, 2011 4:24 am

Interesting. Don't understand the stuff you added to the string with right click though?
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Mon Jan 24, 2011 4:59 am

Yes that's correct.
Really all its doing is treating the position as a single component rather than a separate x, and y.
If someone were to make a plug, this method would be ideal as a behavior to me.
What you would do is add the behavior to the object, then open a edit screen like what we have for the bones, or path plug, click where you want the tile to be placed, and then in events have an event that would generate the tiles.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Mon Jan 24, 2011 6:32 am

Cool, needs an erase though.

Art:
[code:2wvcgqzk]{{334,313},{340,338},{356,360},{368,379},{389,392},{416,366},{438,346},{454,325},{473,302},{480,272},{479,247},{449,237},{423,222},{394,233},{359,250},{374,233},{343,269},{338,292},{273,196},{289,181},{290,153},{298,115},{299,126},{321,112},{342,105},{356,100},{382,103},{391,123},{419,137},{437,121},{442,107},{427,83},{392,65},{407,77},{369,47},{337,40},{309,37},{279,43},{253,53},{222,65},{206,79},{186,96},{168,116},{148,137},{137,165},{133,194},{124,221},{130,243},{136,276},{143,308},{165,331},{186,355},{209,381},{224,389},{213,357},{229,328},{244,309},{235,284},{213,255},{221,223},{241,199},{282,194},{299,167},{264,206},{139,257},{403,372},{193,325},{191,288},{159,265},{191,210},{154,197},{207,181},{174,169},{192,134},{206,153},{234,153},{256,166},{264,112},{234,124},{209,103},{252,86},{305,75},{282,92},{334,68.9999847412109},{363,75},{373,277},{403,298},{423,308},{443,285},{420,258},{396,266},{363,307},{394,319},{406,345},{378,341},{459,258},{459,223},{435,223},{219,303},{167,306},{199,232},{173,239},{154,223},{195,271},{263,140},{412,105},{0,0}}@loopindex(106)[/code:2wvcgqzk]
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Mon Jan 24, 2011 7:19 am

heh Scirra logo ftw!

Actually, seeing that, I bet you could literally draw your map using the image manipulator, and an imported image, perhaps even using the canvas.


Haven't quite figured out how to do an erase yet. Hence the 0,0 at the end, that's just there for formatting the last append.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Wed Mar 02, 2011 6:55 pm

I was trying to use this method to create some objects on a level editor i'm making. But I can't find a way to load it from the ini so it works.
This happens:

I made a global variable called "load_string" that will store the string from the ini. So far so good, the global var stored {{0,0},{20,20},{30,30}}
On the events, i have a event that shows this text: global('load_string')@1 which displays the original string for some reason
If i make the text show {{0,0},{20,20},{30,30}}@1 it displays {0,0} correctly

tl;dr: it doesn't recognise an array if its inside a global variable?
B
83
S
21
G
15
Posts: 1,039
Reputation: 15,134

Post » Wed Mar 02, 2011 9:54 pm

Yeah it would be nice if that worked, but the array cant be modified at runtime.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests