ID:1127959
 
(See the best response by Magicsofa.)
I am unclear about this...

I'm not sure if something like this will cause a transfer or if it is smart enough to use the client side cache...

turf/wall
New()
..()
var/turf/t = get_step(src, EAST)
if(t && !t.density)
t.overlays += icon('shadows.dmi', "slanted")


assuming shadows.dmi is included somewhere in the RSC
This will create a new /icon object, which should only be done if you want to modify the icon at runtime.

I also think this will take a very long time if you have a big map. I'd recommend either mapping all the shadows by hand or saving the map after doing your shadow generation so that you don't have to do it repeatedly

EDIT: overlays can be added using only an icon state. So if you had the shadow graphic in t's icon states, just do overlays += "shadow"
So this would be faster?

obj/shadow/slanted

turf/wall
New()
..()
var/turf/t = get_step(src, EAST)
if(t && !t.density)
t.overlays += /obj/shadow/slanted


I actually do plan on saving my map, autojoin states shadows, and all in the end. But I do want to know which one of these methods is quicker/proper.
Best response
yes that would be better, no new icons are created
In response to Magicsofa
Magicsofa wrote:
EDIT: overlays can be added using only an icon state. So if you had the shadow graphic in t's icon states, just do overlays += "shadow"

Nice tip, but in my specific scenario it would not make sense to have shadow images in the same icon file as the turf.
In response to FIREking
FIREking wrote:
Nice tip, but in my specific scenario it would not make sense to have shadow images in the same icon file as the turf.

I believe Magicsofa meant generating the map once, then saving it as a DMM. (Instead of generating it on each world/New)
In response to Murrawhip
Murrawhip wrote:
FIREking wrote:
Nice tip, but in my specific scenario it would not make sense to have shadow images in the same icon file as the turf.

I believe Magicsofa meant generating the map once, then saving it as a DMM. (Instead of generating it on each world/New)

His tip was about using the shadows as icon_states inside the same turf icon.

He mentioned something else about saving the map in its ACTUAL state (so that it does not need to be generated ever again). I understood the difference between both concepts.