ID:143731
 
Code:
turf/var
gtfs
tx
ty
tz
turf/proc
gettile(var/tileX,var/tileY,icon/tileset)
tileX *= 32
tileY *= 32
src.icon = tileset
pixel_y=tileY
pixel_x=tileX

turf/New()
if(src.gtfs == 1)
src.gettile(tx,ty,tz)
..()

turf/skelleton_sandtest
gtfs = 1 //is 1 to show it is getting from tileset
tx = 6 //the tile is 6 tiles to the right
ty = 1 //the tile is 1 tile down
tz = 'tileset.png' //the tileset name

mob/Login()
src.loc = locate(1,1,1)
world/turf = /turf/skelleton_sandtest


Problem description:
i am trying to make a lib that takes a specific tile from the set of tiles. For example, if i choose the tileset from
http://www.rmxpu.net/downloads/uploads/Ultimate_Tileset.png
(it is already in the folder), and i wanted to get the skeleton in sand facing east i would go

turf/skelleton_sandtest
gtfs = 1 //is 1 to show it is getting from tileset
tx = 6 //the tile is 6 tiles to the right
ty = 1 //the tile is 1 tile down
tz = 'tileset.png' //the tileset name


and it would make the turf's icon into
Image Hosted by ImageShack.us
Shot at 2007-07-16

but instead it looks like this:
Image Hosted by ImageShack.us
Shot at 2007-07-16

could anyone tell me if i am doing somthing wrong?

If so could you tell me how you would fix?


if this works, it will save many people the time of cutting up HUGE tilesets int 32*32 tiles
Those are some pretty nice tiles. I've seen them before somewhere; what game are they from?

Lummox JR
play around with the icon_state. for .png files, after setting the icon, it will try to shrink the whole icon into one 32x32 square. if you set the icon_state to "0,0" "0,1" "1,2" etc, it will split the png up and show a section of the png corisponding to those coors.

-Lute
Do you get anything different if you change the targeted "tile"? Say to tx = 1 and ty = 6.
In response to Lummox JR
Lummox JR wrote:
Those are some pretty nice tiles. I've seen them before somewhere; what game are they from?

Lummox JR

RPG Maker XP by Enterbrain
In response to Evre
Yep and technically speaking, people are not allowed to use them unless they pay for the license to do so.
In response to Lutelian
Vermolius wrote:
Do you get anything different if you change the targeted "tile"? Say to tx = 1 and ty = 6.

No, i always get the same thing

Revenant Jesus wrote:
Yep and technically speaking, people are not allowed to use them unless they pay for the license to do so.

they specificly said "Can be used for RMXP games only."
but hey, people do use them anyways. i have seen a few games on byond using them.

Lutelian wrote:
play around with the icon_state. for .png files, after setting the icon, it will try to shrink the whole icon into one 32x32 square. if you set the icon_state to "0,0" "0,1" "1,2" etc, it will split the png up and show a section of the png corisponding to those coors.

-Lute

what do you mean by this? I know it shrinks the whole thing into a 32*32 tile, but how do you stop this by happening? do you just set the icon_state to "0,0" and it will be the first tile?


thanks for the help

edit
figured it out