Shadow Generator

by Kidpaddle45
A little system that generates shadows for selected objects in your game.
More efficient micro libraries I say.

 Shadow system.dm:9:error: SH.appearance: undefined var
Shadow system.dmb - 1 error, 0 warnings


Didn't touch anything. But why the error. No variable defined for appearance in the code.


//Dont touch this code, this is what generates the shadow. Simply add this to your game and use
//GenerateShadow(src,DIRECTION)

atom/var/shadows[0]
atom/var/shadow = 0

///SHADOW GENERATOR FOR MOBS/////////////////////////////
proc/GenerateShadowMob(atom/A, var/Dir = EAST)
var/shadow/SH = new ; SH.appearance = A ; SH.color = "black" ; SH.alpha = 80
var/icon/I = new/icon(A.icon,A.icon_state) //Used to calculate the size of the icon
SH.pixel_y -= I.Height()/1.2


Non mob works fine though so good job.
In response to Sir Quizalot
Sir Quizalot wrote:
More efficient micro libraries I say.

 Shadow system.dm:9:error: SH.appearance: undefined var
> Shadow system.dmb - 1 error, 0 warnings
>

Didn't touch anything. But why the error. No variable defined for appearance in the code.


//Dont touch this code, this is what generates the shadow. Simply add this to your game and use
> //GenerateShadow(src,DIRECTION)
>
> atom/var/shadows[0]
> atom/var/shadow = 0
>
> ///SHADOW GENERATOR FOR MOBS/////////////////////////////
> proc/GenerateShadowMob(atom/A, var/Dir = EAST)
> var/shadow/SH = new ; SH.appearance = A ; SH.color = "black" ; SH.alpha = 80
> var/icon/I = new/icon(A.icon,A.icon_state) //Used to calculate the size of the icon
> SH.pixel_y -= I.Height()/1.2

Non mob works fine though so good job.


Again, this library works for BYOND brta builds. You'll get an error if you don't have the latest beta BYOND built. You can download that from the front page.

As someone else suggested if you do not want to use the beta build you can create a var and call it: var/appearance.

Hope this clears up the confusion. :)

Have a good day.
Page: 1 2