ID:174309
 
Hey, Its me again! Confused by another problem =/.. K well is there anyway for me to get transitions when teleporting to a knew place.. like on dbtc.. also i need help making an earth quake effect.. i know lots of you are going to say abyssdragons demo but im pretty sure it doesnt work... anyway thx in advance
1) this belongs in Newbie Central, because you have no code or problem with a code
2) AbbyssDragons demo DOES work, you are doing something wrong, please go back and try again, or show us the problem with your code.
Here's how it works in DBTC (and also in Murder Mansion)...

You need two procs set up under /mob, and one object:

mob
proc
Fadeout(color)
if (src.client)
var/obj/fadeout/f = new
src.client.screen += f
if(!color)
color = "black"
flick("fadeto[color]",f)
sleep(6)
f.icon_state = "[color]"

Fadein(color)
if (src.client)
if(!color)
color = "black"
for(var/obj/o in src.client.screen)
if(istype(o,/obj/fadeout))
flick("fadefrom[color]",o)
sleep(6)
o.icon_state = ""
sleep(10)
del(o)
obj
fadeout
layer = 55
icon = 'fadeout.dmi'
screen_loc = "NORTH,WEST to SOUTH,EAST"
mouse_opacity = 1


(The layer var is what it is set for in Murder Mansion, which puts it above everything else, but below the HUD layer... This can be set to whatever number you want, as long as it is above the layer of everthing that you want to cover up...)

Then, all you have to do is add calls to the two procs where necessary, like so:

Fadeout("black")
// do your teleporting, or whatever scene transition you need to do here
Fadein("black")

It will fade the screen out to the color you put into the proc, teleport the mob, and then fade the screen back in...

The icon for the fadeout object needs to have an animated state with successively darker dithers (from a clear frame, to a completely filled in frame) in whatever color you want the screen to fade to (which is why the procs take a color argument, so you can use any color you want, as long as the fadeout object's icon has that color in one of its icon_states), name that one "fadeout[whatevercolor]" (replacing [whatevercolor] with whatever color you're using, of course)... Then, it needs a non-animated state that is just one solid block of the color, named "[whatevercolor]" (again, replace that with the actual color name that you're using)... Finally, it needs another animated icon_state that goes backwards from the fadeout icon_state (go from solid to clear, instead of clear to solid) named "fadein[whatevercolor]" (again, replace with your color)...

Make each of these three icon_states for any number of colors you wish... DBTC uses all kinds of them, like black, blue, green, red, yellow, white, pink, light blue, aqua, etc...

The icon also needs one blank icon_state with no name... Just one, no matter how many different colors you're using...

Obviously, if you want to use a different color (red, for instance), just call the procs with "red" as the argument...

Hope that helps!
In response to SuperSaiyanGokuX
thx alot... your a nice guy for even sharing your coding most coders are selfish