Game Development Community

Tile Editor: Script (when shown) and Custom Data?

by Teck Lee Tan · in Torque Game Builder · 03/22/2005 (3:06 pm) · 9 replies

I was wondering if there was any documentation somewhere that explained what can be accessed or done via the "Script" and "Custom Data" entries in the tile properties dialogue? I'm trying to think of creative ways to use random tile images within a "tileset" for specified tiles (eg. a 10x10 tile area that picks random grass variations from within a "grass" tileset).

#1
03/22/2005 (3:26 pm)
Not sure if you can do this with tile layers as I haven't really messed with them, but you could have a large graphic that contains all of the different tiles you want to use. A random number can be generated, and then you display that frame of the tile image.

I do this with sprites to randomly pick a cloud to scroll across the screen.
#2
03/22/2005 (3:29 pm)
That's actually exactly what I'm looking for. :) I know how to do this with a sprite, but is this possible with tiles? I'm not sure how to define a tile image in script.

edit: It just occurred to me that I should probably look through the tile editor scripts to figure this out, since I recall Melv saying it was written entirely in script. I'm not in any rush or anything, just something that would be nice to know. :)
#3
03/22/2005 (3:40 pm)
www.garagegames.com/mg/forums/result.thread.php?qt=26526

You could use something like what I use to fix the collision info to scan the map, and when it sees a specific tile, replace it with a random tile.
#4
03/22/2005 (4:27 pm)
Ohh, sweetness. Thanks!
#5
03/22/2005 (11:10 pm)
Just be careful though as there is a bug in "Custom Data" that means it doesn't save from the tile-editor.

- Melv.
#6
03/23/2005 (7:12 am)
Melv, thanks for the heads up. I'll see if I can find some time this week to look through the tile editor code, and I'll be sure to keep that in mind.
#7
03/23/2005 (7:41 am)
The change is easy to make, it's just that the load/save for the custom data was missed from the "loadStream()" and "saveStream()" calls in the fxTileLayer2D. My fault. *bends over for a good kicking*

Fixing this is easy but we're just dealing with the issue related to not breaking peoples existing work at the moment for load/save of objects.

- Melv.
#8
03/23/2005 (7:53 am)
*kicks Melv*
:)
#9
03/23/2005 (11:50 am)
Yeah, sorry. ;)

*limps away*