Shadow Generator

by Kidpaddle45
A little system that generates shadows for selected objects in your game.
ID:1871750
 
After a lot of requests, Shadow Generator can now generate shadows for mobs with overlays. This version requires BYOND 508 BETA since it uses the newly added var "appearance".

The new proc: GenerateShadowMob() can now be used to generate shadows for mobs.

This library was also cleaned up a little and no longer requires a separate icon called "shadow.dmi". The shadows are now full coded and do not need external icons.

Next on my list is adding smooth transition between the shifts from direction to direction and of course, water reflection.

Thanks for reading. :)

awesome work
Shadow system.dm:9:error: SH.appearance: undefined var
Zecronious do u have the new version?
In response to Blackstar1134
I went on the hub and clicked the download button?
You need the new byond Version open pager and go to Home. You should have a message there about the new version.
In response to Blackstar1134
Does this have features from the beta? If it doesn't that makes no difference. I have the latest BYOND version anyway.
the new version has a new var which is needed for the shadow generator read kidpaddles post again ^^.
In response to Blackstar1134
I already have the latest verison ^^
Hmm then I dont know sorry i give it a look later and try it.
In response to Blackstar1134
Oh dude, you're using the beta. You meant to say "Do you have the latest beta?"

I have the latest BYOND version, on my pager it says "up to date" but to use this I need the BETA

Easy mistake. I'm annoyed that they have betas. Half the frickin shit on here never works until they update stable and you can't install 2 BYONDs at the same time.
In response to Zecronious
Zecronious wrote:
Oh dude, you're using the beta. You meant to say "Do you have the latest beta?"

I have the latest BYOND version, on my pager it says "up to date" but to use this I need the BETA

Easy mistake. I'm annoyed that they have betas. Half the frickin shit on here never works until they update stable and you can't install 2 BYONDs at the same time.

Yes im sorry everyone. I meant beta. Gonna edit my post!
nice
what is shadow gemeration about?
exactly what it says dude it generates shadows
That's pretty much what it is indeed.
Seems easy to you but it is indeed helpful to many others, if you can't find any use to it, it doesn't mean it's not helpful to other people who aren't that good with programming yet.

The world doesn't revolve around you.
In response to Kidpaddle45
Kidpaddle45 wrote:
That's pretty much what it is indeed.
Seems easy to you but it is indeed helpful to many others, if you can't find any use to it, it doesn't mean it's not helpful to other people who aren't that good with programming yet.

The world doesn't revolve around you.

(Y)
I'm pretty new to Byond programming and this helped me a lot <3
i should release a library for every 10 lines of code i write

Why not?
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.
Page: 1 2