In response to Kaioken
I didn't intend for it to, I just wanted it known.
In response to DerDragon
DerDragon wrote:
you mostly just basically have to copy the line you used to add the overlay, and change the '+=' there to '-=', thats about it.

This is of course assuming you're doing this within the same section of code, which would be meaningless, or you're adding an overlay defined globally, which aside from object types, would also be silly.

First, note I said 'mostly'.
And;

This is of course assuming you're doing this within the same section of code

Nope. Actually it IS meaningful to use in the same 'section', but you're referring to the 'same section' as 'same proc' it appears (which could still be meaningful FYI, actually) in.
Anyway, no reason to start looking for errors and holes in my posts, thankfully I know what I'm talking about, so stop picking. =)
In response to Keeth
Keeth wrote:
You can't just go digging around in the overlays list, which means unless you have an existing referance of the object/image/icon you're trying to get rid of

IIRC, for images and possibly /icon's too, if you reproduce a new image with the same 'image data' (same icon...) you can use that to remove an overlay. So this actually works:
overlays += image('myicon.dmi","mystate")
sleep(30)
overlays -= image('myicon.dmi","mystate")



And sometimes you don't have control over the overlays being added to something. I can't think of a scenario off of the top of my head, but god knows there's one out there.

As for images, unless you know the values of the original image (the icon and icon state, etc).. well... you can't very well get rid of it, can you?

How it is different than most cases when you need to remember the value of a type path, icon filename, etc?
It isn't (apart from having to know something different, of course :P).

You will need an outside reference of the image somewhere to get rid of it in most cases.

Well, no, you don't, you can reproduce a brand new one and use it, as said above.
In response to Kaioken
IIRC, for images and possibly /icon's too, if you reproduce a new image with the same 'image data' (same icon...) you can use that to remove an overlay. So this actually works:

mob/verb
addthisimage()
var/image/I
switch(rand(1,4))
if (1)
I = image('pixie.dmi',"wings")
if (2)
I = image('angel.dmi',"halo")
if (3)
I = image('demon.dmi',"horns")
if (4)
I = image('dancer.dmi',"tutu")
usr.overlays += I

removetheimage\!()
// AIEEE, where do I go to find out which one it added without going through and removing each one from the overlays!?

// not that it'd be so devestating to have to go through and make sure the image doesn't exist in the overlays out of 4 other images. But that isn't the point I'm going for.


Actually, that's what I'm getting at.
What if you're in a situation where the object or image in question isn't within the verb to begin with.

You can't just go digging around in the overlays list, which means unless you have an existing referance of the object/image/icon you're trying to get rid of (which you can't actually learn from the overlay list, etc...

By that I meant, there's no way to get any data from the overlays list, so unless you know exactly what you're trying to get rid of, there's no way to remove the overlaying image/icon/object without some kind of reference to the overlay you're trying to dump (icon and/or icon_state, or just a general reference to the object).
In response to Keeth
Keeth wrote:
Actually, that's what I'm getting at.
What if you're in a situation where the object or image in question isn't within the verb to begin with.

Actually, that isn't what your previous post implied.

You can't just go digging around in the overlays list, which means unless you have an existing referance of the object/image/icon you're trying to get rid of (which you can't actually learn from the overlay list, etc...

By that I meant, there's no way to get any data from the overlays list, so unless you know exactly what you're trying to get rid of, there's no way to remove the overlaying image/icon/object without some kind of reference to the overlay you're trying to dump (icon and/or icon_state, or just a general reference to the object).

Yes, again that isn't what your original post said; strictly meant a reference to the object used to add the overlay. Which also made the most sense to me, seeing as 'a reference to an icon_state' etc doesn't make much sense.
In response to Kaioken
Actually, that isn't what your previous post implied.

Actually, that's exactly what it implied.

You can't just go digging around in the overlays list, which means unless you have an existing referance of the object/image/icon you're trying to get rid of (which you can't actually learn from the overlay list, which means it all has to be attained through external sources, although in most scenarios, you will know what you're trying to get rid of), it will be very hard to remove it.

In other words:

"You cannot get information from the overlay list, so you cannot remove an overlay without having the proper information stored somewhere else for later usage"

Yes, this does not include procedures that add overlays and get rid of them later on within the same procedure.

Which also made the most sense to me, seeing as 'a reference to an icon_state' etc doesn't make much sense.

Well, you can't exactly add an icon state to the overlay, so I was actually refering to the use of the image() proc and icon (ie, 'blah.dmi') here.

I added the and/or part to clarify that you could just have added the icon to the overlay, so you may need one or both (for getting rid of icons, you'd need to know which icon was used. for getting rid of images, you'd need to know which icon was used, AND the icon_state, assuming it had one).
Page: 1 2