SetTile question

Asked by german on 2013-09-20

what exactly represents the first number in the SetTile command?

i never get any way to use patches in stratagus, so i decided to make maps in other platforms, then with scripts editors i managed to translate the codification to stratagus map code, the problem is that the first number (i guess that it is the tile index) doesn't seem to be the one that appears in the script of the tileset
like this one:
"solid", { "light-grass", "land", {160 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,}}, //(tile in the first column and in the ninth row, according to mi file.png that has rows of 20 columns)

in the map the tile with that graphic has this configuration:
SetTile(1936, 0, 0, 0)

so, what would be the "1936"?

PD:i use tiles of 24X24

Question information

English Edit question
Stratagus Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
german (pepeelgranjero) said : #1

to make what i would like, i removed the mixed tiles, so i only work with singular tiles (one by one)

Joris Dauphin (joris-dauphin) said : #3

To be more specific about SetTile(1936, x, y, value):

1936 is an index in the "lua table" done in tileset.lua.

There is 16 values per raw. Each raw defines a "type".

As 1936 = 121 * 16, it is 1rst column of the 121th line in the "tile table".

x,y are the coordinates of the map (starting at 0, 0 for top-left).
'value' is special for wood/wall.

german (pepeelgranjero) said : #4

mmm i realized then that, that number i could get it multiplying by 16