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

item_scaling

Element for scaling item appearances in the overworld or in inventory/storage.

This bespoke element allows for items to have varying sizes depending on their location. The overworld simply refers to items being on a turf. Inventory includes HUD item slots, and storage is anywhere a storage component is used. Scaling should affect the item's icon and all attached overlays (such as blood decals).

Vars

overworld_scalingScaling value when the attached item is in the overworld (on a turf).
storage_scalingScaling value when the attached item is in a storage component or inventory slot.

Procs

AttachAttach proc for the item_scaling element
DetachDetach proc for the item_scaling element.
scaleScales the attached item's matrix.
scale_overworldShrinks when inworld
scale_storageEnlarges when inhand or in storage.

Var Details

overworld_scaling

Scaling value when the attached item is in the overworld (on a turf).

storage_scaling

Scaling value when the attached item is in a storage component or inventory slot.

Proc Details

Attach

Attach proc for the item_scaling element

The proc checks the target's type before attaching. It then initializes the target to overworld scaling. The target should then rescale if it is placed in inventory/storage on initialization. Relevant signals are registered to listen for pickup/drop or storage events. Scaling values of 1 will result in items returning to their original size. Arguments:

Detach

Detach proc for the item_scaling element.

All registered signals are unregistered, and the attached element is removed from the target datum. Arguments:

scale

Scales the attached item's matrix.

The proc first narrows the type of the source to (datums do not have a transform matrix). It then creates an identity matrix, M, which is transformed by the scaling value. The object's transform variable (matrix) is then set to the resulting value of M. Arguments:

scale_overworld

Shrinks when inworld

Longer detailed paragraph about the proc including any relevant detail Arguments:

scale_storage

Enlarges when inhand or in storage.

Longer detailed paragraph about the proc including any relevant detail Arguments: