Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411646 Posts in 69395 Topics- by 58451 Members - Latest Member: Monkey Nuts

May 15, 2024, 07:28:19 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)Tutorials[GM8 Pro] Learning to "create instance" an array of one object w/ still frames
Pages: [1]
Print
Author Topic: [GM8 Pro] Learning to "create instance" an array of one object w/ still frames  (Read 1201 times)
baconman
Level 10
*****


Design Guru


View Profile WWW
« on: March 04, 2012, 08:44:34 AM »

Okay, so the basic functionality of level generator is up and going, now. Pretty sure the next part is only gonna work with scripting. I have a strip of tiles which I've made into an "oScriptables" object, of 53 frames.

0 = open space
1-9 = edges and central areas of bigger surfaces.
10 = single self-contained block
11-13 = horizontal rows, single tile tall
14-16 = vertical columns, single tile wide
17-20 = single tile diagonals
21-28 = two-tile wide slopes, in pairs
29-36 = two-tile high slopes, in pairs
37-40 = 90-degree inside curves
41-43, 44-46, 47-49, and 50-52 = outer curves, naturally flow-sequenced from left to right.

Now, what I get to try and learn today is how to make a script where I can fill a 15 x 10 "screen" full with these tiles, and instance each of them to the appropriate image_index frame, so that I can script a screen layout via arguments something like the following:

Code:
room_fill (oScriptables) [
08 08 08 08 08 08 08 08 08 08 08 08 05 05 05
00 00 00 00 00 00 00 00 00 00 00 00 44 45 05
00 00 00 00 00 00 00 00 00 00 00 00 00 46 05
12 12 12 13 00 00 00 11 12 12 02 02 38 00 04
00 00 00 00 00 00 00 00 00 00 25 26 40 52 05
00 00 00 00 00 00 00 00 00 00 00 00 50 51 05
12 12 12 12 23 24 00 00 00 00 21 22 12 08 05
00 00 00 00 00 00 00 00 00 00 00 00 00 00 04
00 00 00 00 00 00 00 00 00 00 00 00 00 00 04
02 03 00 00 01 02 02 02 02 02 03 00 00 01 05
]


...so that it creates the desired room layout. Of course, this will be based on conditionals, like the screen's location and "chunkered" orientation. After that, it'll be layered a second time to make graphical tile foregrounds (depending on the biome), and then a third for "hotspots" where other objects are generated as well; but that could be as simple as placing an object at a relative location.

I guess what I'm hoping to learn here is how to make a bunch of this one object generate from a single command, in relative locations, at a correct image_index just by listing an ongoing string of them. The object itself is already instructed at the Create event to maintain an image_speed of 0.

And this to me, is the difference between intermediate and expert GML skill...
« Last Edit: March 04, 2012, 09:00:51 AM by baconman » Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic