• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code why do I need tilemap data to retrieve a tile position in a tileset?

S

Shadowblitz16

Guest
why do I need tilemap data to retrieve a tile position in a tileset?
in the help docs it says I get the tile with tile_get_index but that requires tiledata that requires a tilemap.
I'm just trying to draw a tile from a tileset I shouldn't need a tilemap to do this.

tilemaps should be their own thing.
if they were not meant to be then there is no point in tilesets and tilemaps should just be their own resource and assigned the sprite directly
 
Last edited by a moderator:

Nocturne

Friendly Tyrant
Forum Staff
Admin
No, that's not how it works. If you just want to draw a single image, then use the asset layer and draw sprites (that's what it's there for). Tiles are heavily optimised, and so require a framework within which they are placed, parsed, and rendered, and that framework is a tilemap (which in turn goes on a layer).
 
S

Shadowblitz16

Guest
well there seems to be alot of intermingling with the 3 types of assets aka sprites, tilesets, tilemaps when there could just be sprites and tilesets or allowing the three to be separate objects.
also sprites are not what I want, I would have to make a alternative tile engine just to use sprites and I shouldn't since there is already one there that could be used
I made a suggestion in my topic "suggestions"
 
Last edited by a moderator:

Nocturne

Friendly Tyrant
Forum Staff
Admin
If you are trying to use an existing 1.4 based engine in 2, then you are heading for disaster. Tiles in the old sense have been completely removed and you need to rethink how you use them. Old tiles were really slow and inefficient, essentially mini-objects, and the new tile system is blindingly fast. Remember, this is a NEW product, not an update to a previous one and as such you can't expect it to work the same or for old paradigms to fit.
 
S

Shadowblitz16

Guest
I just don't see why I can't draw tiles directly from a tileset it is requesting the parameter for a tileset not a tilemap so it is really confusing
also the parameter tiledata should be called tilemapdata

also is there any possibility in the future for tilemap based objects?
basicly object that use tilemaps or tilesets instead of sprites?
 
Last edited by a moderator:

Nocturne

Friendly Tyrant
Forum Staff
Admin
Tiledata is a fine name because it s the data for a tile. it doesn't HAVE to be on a tilemap and you can create "blobs" of tiledata and add them into a tilemap at any time. As for tilemap based objects, I have no idea what you mean... an object can create a tilemap at any time and add/remove/edit tiles in it at any time. You can make a tile layer in the room editor, and then simply have the object manipulate that too... And you CAN just draw a tile, btw. It's not going to be as fast as using the tile maps on layers, but you can do it using draw_tile. Check the manual...
 
S

Shadowblitz16

Guest
@Nocturne
I was using draw_tile but it takes a tiledata parameter and I don't know what to put there since I don't have a tilemap and I don't want to have to create one just to get the tile data.
 
Last edited by a moderator:

Mike

nobody important
GMC Elder
tiledata isn't a tilemap, its the tile index - combined with a few flip/mirror/rotate flags - if your going to use them. If you're not, it's just the tile index.

The manual does explain the tiledata thing....
 
S

Shadowblitz16

Guest
@Mike sorry i typed tiledata in the index search on the help page and nothing came up.

one more thing is the tile with the checkered flag tile 0?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
The manual index is for function names more than anything else... Just look at the draw_tile function, for an example of use of tiledata.
 
S

Shadowblitz16

Guest
@Nocturne
the description on the frame argument is empty so I'm not sure whats the difference between that and the tiledata
I just wanted to point that out

Edit: also the example doesn't seem to use the frame argument but it throws errors if I don't
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Okay, frame is explained in the text, even though it's not in the argument box (and also note that the code example is erroneous because it was written before changes to the function and tiles were made, but the next beta update will have the correct docs for all tiles). It's the frame for an animated tile, so if it's not an animated tile you are drawing just use 0. The text does explain everything, even though there are issue further down the doc...
 
Top