Shadow Generator

by Kidpaddle45
A little system that generates shadows for selected objects in your game. [More]
To download this library for your Linux/Mac installation, enter this on your command line:

DreamDownload byond://Kidpaddle45.ShadowGenerator##version=1

Emulator users, in the BYOND pager go to File | Open Location and enter this URL:

byond://Kidpaddle45.ShadowGenerator##version=1

384 downloads
Version 1
Date added: May 22 2015
Last updated: Jun 11 2015
21 fans

V1.0


This little library will allow you to generate shadows for all the elements in your game. Works with all icons (Big and small)



Whats next in V2.0
-Water reflection



Credits:
Ganite (for the art)



Do you like my creations? Donate, it motivates me! =D










Comments

Yesyesitsme: (Feb 6, 1:04 pm)
if u try to host a game with your shadows codes, the game in dream daemon isn't that smooth like it is in single player, do u know why? it happens with all games, but the real question is , when u host your game in daemon, your character looses shadow, and everything else has it, but if u play single player the character have shadow
Kitsueki: (Feb 1 2016, 8:42 pm)
First off, nice library, excellent way to go about making shadows, and from what I can tell, its a good implementation. There are a few things I changed with how I'm using it: I set the appearance, color, and alpha vars of the shadow in it's New() proc, passed the atom through to it. Also, instead of having 3 variants of shadow I'm going to be linking it to the day cycle of my game to update the shadow every in game hour, so I'll be doing some math based on that to calculate the position of the shadow.

Second, for those of you trying to use this, if you want to call it in atom/movable/New or obj/New.. do a sanity check to make sure you're not also calling it for /shadow types, as they inherit obj's (and by extension /atom/movable's) behavior. It was infinitely generating shadows for shadows and it lagged hardcore for me, I was thinking I wouldnt be able to use this but thankfully my debugging skills showed me the problem.

tl;dr make sure you don't generate shadows for shadows
Xirre: (Sep 8 2015, 1:20 pm)
Marcus55 wrote:
Noticed an issue. Whenever you save the game with the shadow currently on a mob (not sure with turfs), and you reload into the world, the shadow system duplicates your player icon and shadow.

You probably shouldn't be saving the player's icon then. Never do that.
Marcus55: (Jul 21 2015, 7:09 pm)
Noticed an issue. Whenever you save the game with the shadow currently on a mob (not sure with turfs), and you reload into the world, the shadow system duplicates your player icon and shadow.
Kboy33: (Jul 9 2015, 3:12 am)
To anyone that gets the "undefined var: SR.appearance" error, insert the following code at the beginning of the 'Shadow system.dm' file:

atom/var/appearance