/tg/ Station 13 - Modules - TypesVar Details - Proc Details

bodypart_overlay

Bodypart ovarlay datum. These can be added to any limb to give them a proper overlay, that'll even stay if the limb gets removed This is the abstract parent, don't use it!!

Vars

all_layersList of all possible layers. Used for looping through in drawing
blocks_emissiveWhether the overlay blocks emissive light
cache_keyKey of the icon states of all the sprite_datums for easy caching
layersSometimes we need multiple layers, for like the back, middle and front of the person (EXTERNAL_FRONT, EXTERNAL_ADJACENT, EXTERNAL_BEHIND)

Procs

added_to_limbCalled on being added to a limb
bitflag_to_layerConverts a bitflag to the right layer. I'd love to make this a static index list, but byond made an attempt on my life when i did
can_draw_on_bodypartCheck whether we can draw the overlays. You generally don't want lizard snouts to draw over an EVA suit
color_imageColor the image
generate_icon_cacheGenerate a unique identifier to cache with. If you change something about the image, but the icon cache stays the same, it'll simply pull the unchanged image out of the cache
get_imageGenerate the image. Needs to be overridden
get_overlayWrapper for getting the proper image, colored and everything
modify_bodypart_appearanceAdditionally color or texture the limb
mutant_bodyparts_layertextThis exists so sprite accessories can still be per-layer without having to include that layer's number in their sprite name, which causes issues when those numbers change.
override_colorColorizes the limb it's inserted to, if required.
removed_from_limbCalled on being removed from a limb
set_appearanceUse this to change the appearance (and yes you must overwrite hahahahahah) (or don't use this, I just don't want people directly changing the image)

Var Details

all_layers

List of all possible layers. Used for looping through in drawing

blocks_emissive

Whether the overlay blocks emissive light

cache_key

Key of the icon states of all the sprite_datums for easy caching

layers

Sometimes we need multiple layers, for like the back, middle and front of the person (EXTERNAL_FRONT, EXTERNAL_ADJACENT, EXTERNAL_BEHIND)

Proc Details

added_to_limb

Called on being added to a limb

bitflag_to_layer

Converts a bitflag to the right layer. I'd love to make this a static index list, but byond made an attempt on my life when i did

can_draw_on_bodypart

Check whether we can draw the overlays. You generally don't want lizard snouts to draw over an EVA suit

color_image

Color the image

generate_icon_cache

Generate a unique identifier to cache with. If you change something about the image, but the icon cache stays the same, it'll simply pull the unchanged image out of the cache

get_image

Generate the image. Needs to be overridden

get_overlay

Wrapper for getting the proper image, colored and everything

modify_bodypart_appearance

Additionally color or texture the limb

mutant_bodyparts_layertext

This exists so sprite accessories can still be per-layer without having to include that layer's number in their sprite name, which causes issues when those numbers change.

override_color

Colorizes the limb it's inserted to, if required.

removed_from_limb

Called on being removed from a limb

set_appearance

Use this to change the appearance (and yes you must overwrite hahahahahah) (or don't use this, I just don't want people directly changing the image)