Calling a Hud command proc to make coding simpler [SOLVED] in Developer Help
|
|
This problem has been solved/fixed thanks to Emasym
If some1 is interested on how it was fixed & how it's implemented into code refer to this post
http://www.byond.com/developer/forum/?id=743734
and thanks again Emasym ^.^
---------------------------------------------------------------------------
Code:
client/proc/FadeToBlack(mob/M) M.client.screen += new/obj/Fade/black25 sleep(1) for(var/obj/Fade/black25/o in M.client.screen)del(o) M.client.screen += new/obj/Fade/black50 sleep(1) for(var/obj/Fade/black50/o in M.client.screen)del(o) M.client.screen += new/obj/Fade/black75 sleep(1) for(var/obj/Fade/black75/o in M.client.screen)del(o) M.client.screen += new/obj/Fade/black100 sleep(2) client/proc/FadeToNorm(mob/M) sleep(2) for(var/obj/Fade/black100/o in M.client.screen)del(o) M.client.screen += new/obj/Fade/black75 sleep(1) for(var/obj/Fade/black75/o in M.client.screen)del(o) M.client.screen += new/obj/Fade/black50 sleep(1) for(var/obj/Fade/black50/o in M.client.screen)del(o) M.client.screen += new/obj/Fade/black25 sleep(1) for(var/obj/Fade/black25/o in M.client.screen)del(o)
obj/Fade icon='HUD.dmi';name="" black100 icon_state="black100" layer = MOB_LAYER +1000 screen_loc="0,0 to 15,10" black75 icon_state="black75" layer = MOB_LAYER +1000 screen_loc="0,0 to 15,10" black50 icon_state="black50" layer = MOB_LAYER +1000 screen_loc="0,0 to 15,10" black25 icon_state="black25" layer = MOB_LAYER +1000 screen_loc="0,0 to 15,10"
|
Problem description:
If I put the " M.client.screen += new/obj/Fade/black25" and such directly in the code and not in a proc it works alright, but I can't figure out how to make the proc to be able to be able to be called.
If i set it to "mob/proc/FadeToBlack()" and then go "M.FadeToBlack()" in the call it runs but comes up with an error when triggered.
How do I get it to where I can just call a "FadeToBlack()" proc instead of repeating what I have in the proc in multiple areas?
|