ID:175266
 
I am making a Travel() verb for obj SpaceCraft.
If they haev the obj they can use the verb.
I have a problem though. When they choose the verb, how can I make it so that there icon is the SpaceCraft, and ALL there underlays are invisible, until the end of the verb, when their icon returns to Player, and all overlays become visble again.
<font size=1>Try this:
obj
spacecraft
verb
Travel()
usr.icon = 'ship.dmi' //or what ever the icon is
del(usr.underlays) //You could also use usr.underlays -= whatever, and might be faster
sleep(200)
usr.icon = 'player.dmi' //or what ever the icon is
//put the overlays here...

I think this is bug free. If not, lemme know. Also, why do you want the underlays to go away, then the overlays to come back?</font>
In response to Draks
Minor problem with this code: You need some way to disable using the verb again while it's still in use.

Lummox JR
In response to Draks
Sorry that was a typo, I wanted the Overlays to go away and then the Overlays to come back.

I found a problem with your code though.
I don't know how to add the overlays they had before you get rid of them. They could be wearing clothes, or they may not be, and I don't know how to do that!
In response to Gokuss4neo
Uhh I'm completely not sure about this, but I think you could save them in a list. Something like this:

mob/var/list/oldOverlays

and use these in your code:

src.oldOverlays = src.overlays
src.overlays += src.oldOverlays

I'm pretty sure you can save them in a list, but this probably doesn't work because I'm utterly useless when it comes to lists. :)
In response to Jnco904
Thank you, I shall try that.