proc
tilePNG(var/atom/tile,width,height,var/atom/location)
width /= 32
height /= 32
var/x = location.x
var/y = location.y
var/z = location.z
for(var/widthprog = 0,widthprog < width,widthprog ++)
for(var/heightprog = 0,heightprog < height,heightprog ++)
var/atom/temp = new tile(locate(x+widthprog,y+heightprog,z))
temp.icon_state = "[widthprog],[heightprog]"
ID:270837
Sep 27 2006, 1:15 am
|
|
How do i make it delete the picture?
|
In response to Nadrew
|
|
Nice for() Nadrew..
Hn, do you think NRP should make a new type path so it would make it easier to find and delete the tiled PNG? Example of what I mean: tiles Now there's a path /tiles which has the same capabilities of /atom but it would be easier to search for and delete: ... - GhostAnime - ??? |
In response to GhostAnime
|
|
I was just giving him a starting point. I was actually going to mention that looping over all atoms is a bad idea and that he should make a child-type or datum for it after the code itself, but I got in a hurry and just submitted after the code was typed up. Thanks for covering me, I hate when life makes me hurry, I have too much on my mind to remember things when I have to hurry.
|
In response to Nadrew
|
|
Ah I see >_>
- GhostAnime - !_! |
In response to GhostAnime
|
|
ym gohost can you explain your code
|
In response to NR Productions
|
|
Hn, I'll try.
You know there's the default: /datum,/sound,/icon,/image,/atom,/area,/turf,/atom/movable,/ obj,/mob You can have your own /path by doing this: Path_name_here Lets say I want the path /item as a /obj item And let's say I have a path set up as /mob/NPC/Enemies/Special and I want to make it shortened down to /SEnemy without losing the path that has been set up: SEnemy ------------------------ - GhostAnime - Um, is this any clearer? >_>;; |
In response to GhostAnime
|
|
i mean a better example for making the picture disspear XD
|
In response to GhostAnime
|
|
GhostAnime wrote:
Hn, I'll try. i lold |
In response to DivineO'peanut
|
|
Fine, *changes /dantum to /datum... there, fixed ... I don't know why I keep saying datum as dantum >_>''
And NRP, I can't think of a better example, a worse one (well, not really) is something like the following: for(var/tiles/T in world) del T It looks for all /tiles types and deletes them.. >_> - GhostAnime |
In response to GhostAnime
|
|
You don't get it. dan-tum. Dantom? >.>
|
In response to DivineO'peanut
|
|
Now you made me feel dumb :/
- GhostAnime /dantom |
Since you're using code I gave you, here's an updated version of the same procedure.
proc tilePNG(atom/tile,width,height,turf/location,x,y,z,save) atom/tile = any atom that's icon is a png width = width in pixels of that png height = height in pixels of that png turf/location = a turf to where it will place the bottom-left most corner of the image x, y, z = the x, y and z of where it will place the bottom-left most corner of the image. If location is set to null it will use these instead save = if this is set to null then it will not keep a list of the atoms used to make the png. if this is set to 1 then it will return a list of the atoms used to make the png. if this is set to an existing list it will add the atoms used to make the png to the existing list. Examples of how to delete the picture: var/list/thepicture = list() or mob That, uh, should work. If anyone can see any rubbishness in my code, please point it out. |
This is just an example, you'd call this delPNG('icon.dmi') to remove all of the atoms with the icon 'icon.dmi'.