I have this code :
mob
verb
testoozaru()
if(usr.moon == 1)
usr<<"You see the full moon shining in the sky!"
view(6)<<"[usr] : AHHAHAHAHHHH!"
for(var/mob/characters/M in oview(6))
M.sight = 1
sleep(2)
usr.icon = 'oozaru.dmi'
usr.icon_state = "t1"
usr.oozaru = 1
usr.overlaysave -= usr.overlaysave
usr.overlaysave = usr.overlays
usr.overlays -= usr.overlays
usr.overlays += /obj/oozaruhead
for(var/mob/characters/M in oview(6))
M.sight = 0
sleep(50)
usr<<"You revert to normal size!"
view(6)<<"[usr] : AHHAHAHAHHHH!"
for(var/mob/characters/M in oview(6))
M.sight = 1
sleep(2)
usr.icon = 'male-olive.dmi'
usr.icon_state = ""
usr.oozaru = 0
usr.overlays -= usr.overlays
usr.overlays = usr.overlaysave
for(var/mob/characters/M in oview(6))
M.sight = 0
//--------------------
But when the time is up, he goes back to his icon 'male-olive', but he is bald, and naked! Why don't his overlays come back? And how can I fix this???
~GokuSS4Neo~
Everyone is a newbie, just some more than others!
ID:174605
![]() Aug 3 2003, 12:31 pm (Edited on Aug 3 2003, 5:34 pm)
|
|
Now something odd is happening. Instead of them being added again as overlays, they come back as underlays! This make NO sense!!
Here is the code: mob verb testoozaru() if(usr.race == "Saiya-jin"||usr.race == "Half-Saiyan") if(usr.moon == 1) if(usr.ssj ==null||usr.ssj==0) usr<<"You see the full moon shining in the sky!" view(6)<<"[usr] : AHHAHAHAHHHH!" for(var/mob/characters/M in oview(6)) M.sight = 1 sleep(2) usr.icon = 'oozaru.dmi' usr.icon_state = "t1" usr.oozaru = 1 usr.overlays -= usr.overlays usr.overlays += /obj/oozaruhead for(var/mob/characters/M in oview(6)) M.sight = 0 sleep(50) usr<<"You revert to normal size!" view(6)<<"[usr] : AHHAHAHAHHHH!" for(var/mob/characters/M in oview(6)) M.sight = 1 sleep(2) if(usr.hair == "Spikey") usr.overlays += 'hair_black_spikey.dmi' if(usr.hair == "Long") usr.overlays += 'hair_black_long.dmi' if(usr.hair == "Short") usr.overlays += 'hair_black_short.dmi' if(usr.hair == "Goku") usr.overlays += 'hair_goku.dmi' if(usr.hair == "Vegeta") usr.overlays += 'hair_vegeta.dmi' if(usr.skin=="Pale") usr.icon = 'male-white.dmi' if(usr.skin=="Tan") usr.icon = 'male.dmi' if(usr.skin=="Dark Black") usr.icon = 'male-black.dmi' if(usr.skin=="Olive") usr.icon = 'male-olive.dmi' usr.icon_state = "" usr.oozaru = 0 usr.overlays -= /obj/oozaruhead for(var/obj/O in usr.contents) if(O.worn == 1) usr.overlays += O for(var/mob/characters/M in oview(6)) M.sight = 0 |
Probably because your adding the overlays before the icon, then when you add the icon it goes obove the overlays. Try doing the overlays after the icon part
|
also, I'd suggest using spawn() after for(), in EX:
for(var/mob/M in oview(6,usr) spawn() M.sight=0 that way, all of their variables will be changed instantaneously. And, why are you using "Zeta" programming/icons? O.o |
No its not...
if(usr.hair == "Spikey") See your adding the overlays before the icon and when you add the icon its probably going over the overlays... |
Not really...In my game I have to set the layer to mob_layer+1 when its worn or else it shows as an underlay..
|
Oops! I didn't make myself very clear! The hair overlays are fine! It is the other overlays :
for(var/obj/O in usr.contents) if(O.worn == 1) usr.overlays += O That appear as underlays! ~GokuSS4Neo~ |
Then there is probably something else causing your problem. Look up overlays var in the help section of DM to read about the float layer. :)
|
I know there is another problem..lol.. that's why I posted in the first place. But I can't work out how to fix it, or even what the problem is! The overlays normally work fine, they are always where they are meant to be an so on, but in this verb they go wrong! Can someone please help?
Thank you for your time! ~GokuSS4Neo~ |
That reply was to Koolguy. :P
As for your problem the only think I can think of is that maybe overlaysave isn't defined as a list(which it may not even need to be, I'm not sure). Hope that helps. |
That's what I thought might be wrong, before I even posted, but I have checked it, and it is a list!
~GokuSS4Neo~ P.s. Any chance this could be a BYOND bug? |
Hmmm, I don't know how I missed this:
usr.overlays += /obj/oozaruhead I don't think this can be done like that, it looks like it's adding a type path. It's probably better to add the .dmi instead. :) |
Lol, that part of the coding works fine though! And I have to add it like that, because it is making him a multi-tiled mob, and the obj :
obj/oozaruhead pixel_y = 32 icon = 'oozaru.dmi' icon_state = "t2" is made to BE an overlay! I am sure this part is not the problem! ~GokuSS4Neo~ P.s Thankz anyway! |
Well. I would think you would atleast have make in a new obj or refer to an already made one. Other than that I have no clue though, sorry.
|
for(var/obj/O in usr.contents) That should put it right above the mobs icon. try that. |
hairover, or hairoverlays, or something, and when they make their person, have it set it to the icon.
as for the clothes and stuff.
var/worn (variable if its worn)
just add this:
and that puts clothes back on.