ID:150199
 
is there any possible way to clear all images shown to the mob? I have an idea, and it will work if i can just clearn all images some how...

FIREking
Have you tried setting it to null?
In response to Nadrew
yes, doesnt work

ive even tried calling

src << image(null, null)

nothing happens. And there is no way i can set a variable for each image, because there will be 13*13 images on the screen that i have to delete and change each time the mob moves. All i need to know is just how to clear ALL images!

FIREking
In response to FIREking
FIREking wrote:
And there is no way i can set a variable for each image, because there will be 13*13 images on the screen that i have to delete and change each time the mob moves. All i need to know is just how to clear ALL images!

I believe just del(image) will work to delete it, where image is the result of the image() proc. You probably knew this.
As for deleting 13x13 of them, I suggest using a list to handle your images:
var/list/imagelist=list()
for(var/y=1,y<=13,++y)
for(var/x=1,x<=13,++y)
imagelist+=image( ... )

Then, to delete those images:
for(var/img in imagelist) del(img)

One thing you'll probably find easier, though, is to download the new beta. It sounds to me like you only want to make minor modifications to the images, possibly move them around or change their icons, and deleting a bunch and then re-creating them each time will be a severe drain. In 307 there's an image datum (var/image/...) that has some atom-like properties including loc, x, y, z, icon, icon_state, layer, and so on; this sounds appropriate to your situation.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
FIREking wrote:
And there is no way i can set a variable for each image, because there will be 13*13 images on the screen that i have to delete and change each time the mob moves. All i need to know is just how to clear ALL images!

I believe just del(image) will work to delete it, where image is the result of the image() proc. You probably knew this.
As for deleting 13x13 of them, I suggest using a list to handle your images:
var/list/imagelist=list()
> for(var/y=1,y<=13,++y)
> for(var/x=1,x<=13,++y)
> imagelist+=image( ... )

Then, to delete those images:
for(var/img in imagelist) del(img)

One thing you'll probably find easier, though, is to download the new beta. It sounds to me like you only want to make minor modifications to the images, possibly move them around or change their icons, and deleting a bunch and then re-creating them each time will be a severe drain. In 307 there's an image datum (var/image/...) that has some atom-like properties including loc, x, y, z, icon, icon_state, layer, and so on; this sounds appropriate to your situation.

Lummox JR

would i be able to do

for(var/image/I in oview(6))
del(I)

plus, all those 13*13 images are made in a weird fasion.

imagine the playing filed, with world view = 6
its a 13x13 area.

in the outer edge of the 13x13 area is a rectangle, not filled.

inside that box is another box not filled, and so on and so on until you get to the src.loc

FIREking
In response to FIREking
FIREking wrote:
would i be able to do

for(var/image/I in oview(6))
del(I)

Ah. That I don't think so, since images are just graphical. I think to do that you'll need to create cross-references to the images like this:
obj
// this is a list of lists
var/list/attached_images

New()
..()
attached_images=list()
...

proc/GetImages(player)
return attached_images[player]

proc/AttachImage(player,image/img)
var/list/images=attached_images[player]
if(!images)
images=new
attached_images[player]=images
images+=img

proc/DetachImage(player,image/img)
var/list/images=attached_images[player]
if(images) images-=img

proc/DetachAllImages(player)
var/list/images=attached_images[player]
if(images)
for(var/image/img in images) del(img)
attached_images-=player
del(images)

Then you could do this:
for(var/obj/O in oview(6))
O.DetachAllImages(usr)

Completely untested code, but I think something like that could work.

Lummox JR
In response to Lummox JR
bah, way too much work for what im wanting to do.

i do however have a .bmp file that has the full 13x13 pattern that im using. is it possible to just show that, if the only coord i know is where the middle of the bmp should be? i also know where the bottom left, right, top left, right coords are as well.

this way i could just use one variable, show the bmp, then delete it using the variable, and repeat the process when needed

is this possible?
or is it not possible to show a whole bmp that way, btw the bmp is 13*32 pixels wide, and 13*32 pixels high
which is exactley oview(6)

FIREking
In response to FIREking
FIREking wrote:
bah, way too much work for what im wanting to do.

2 lines is too much work? *Boggles*

Alathon
In response to Alathon
Alathon wrote:
FIREking wrote:
bah, way too much work for what im wanting to do.

2 lines is too much work? *Boggles*

Alathon

um, in order for those two lines to work, you would have to have the entire code he put.

plus, this has to happen very rapidly.