byond - Modules - TypesVar Details - Proc Details

attachment_handler

Vars

attachable_overlaysList of the attachment overlay images. This is so that we can easily swap overlays in and out.
attachables_allowedTypepath list that stores type data of allowed attachments. The attachment needs the attachment element to be able to attach regardless of what is stored here.
attachment_data_by_slotAssoc list that stores the attachment data of an attachment in the slot.
attachment_offsetsList of offsets for the parent that adjusts the attachment overlay. slot1_x = 1, slot1_y = 1, slot2_x = 3, slot2_y = 7, etc. Can be null, in that case the offsets for all the attachments default to 0.
can_attachProc the parent calls to see if its eligable for attachment.
on_attachProc the parent calls on attach.
on_detachProc the parent calls on detach.
slotsAssoc list that stores the refs of the attachments to the parent. 'slot = reference'

Procs

apply_customUpdates the mob sprite of the attachment.
attach_without_userThis is for other objects to be able to attach things without the need for a user.
can_attachChecks the current slots of the parent and if there are attachments that can be removed in those slots. Basically it makes sure theres room for the attachment.
clean_referencesDeletes the attachments when the parent deletes.
detach_checkChecks if you are actually able to detach an item or not
do_attachThe gun has another gun attached to it Theres probably a better way to do this. This is the do_after and user checks for attaching.
do_detachDoes the detach, shows the user the removable attachments and handles the do_after.
finish_detachActually detaches the attachment. This can be called directly to bypass checks.
finish_handle_attachmentFinishes setting up the attachment. This is where the attachment actually attaches. This can be called directly to bypass any checks to directly attach an object.
remove_overlayHandles the removal of attachment overlays when the item is unequipped
start_detachStarts with the detach, is called when the user Alt-Clicks the parent.
start_handle_attachmentStarts processing the attack, and whether or not the attachable can attack.
update_parent_overlayThis updates the overlays of the parent and applies the right ones.

Var Details

attachable_overlays

List of the attachment overlay images. This is so that we can easily swap overlays in and out.

attachables_allowed

Typepath list that stores type data of allowed attachments. The attachment needs the attachment element to be able to attach regardless of what is stored here.

attachment_data_by_slot

Assoc list that stores the attachment data of an attachment in the slot.

attachment_offsets

List of offsets for the parent that adjusts the attachment overlay. slot1_x = 1, slot1_y = 1, slot2_x = 3, slot2_y = 7, etc. Can be null, in that case the offsets for all the attachments default to 0.

can_attach

Proc the parent calls to see if its eligable for attachment.

on_attach

Proc the parent calls on attach.

on_detach

Proc the parent calls on detach.

slots

Assoc list that stores the refs of the attachments to the parent. 'slot = reference'

Proc Details

apply_custom

Updates the mob sprite of the attachment.

attach_without_user

This is for other objects to be able to attach things without the need for a user.

can_attach

Checks the current slots of the parent and if there are attachments that can be removed in those slots. Basically it makes sure theres room for the attachment.

clean_references

Deletes the attachments when the parent deletes.

detach_check

Checks if you are actually able to detach an item or not

do_attach

The gun has another gun attached to it Theres probably a better way to do this. This is the do_after and user checks for attaching.

do_detach

Does the detach, shows the user the removable attachments and handles the do_after.

finish_detach

Actually detaches the attachment. This can be called directly to bypass checks.

finish_handle_attachment

Finishes setting up the attachment. This is where the attachment actually attaches. This can be called directly to bypass any checks to directly attach an object.

remove_overlay

Handles the removal of attachment overlays when the item is unequipped

start_detach

Starts with the detach, is called when the user Alt-Clicks the parent.

start_handle_attachment

Starts processing the attack, and whether or not the attachable can attack.

update_parent_overlay

This updates the overlays of the parent and applies the right ones.