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

mecha

WELCOME TO MECHA.DM, ENJOY YOUR STAY

Mechs are now (finally) vehicles, this means you can make them multicrew They can also grant select ability buttons based on occupant bitflags

Movement is handled through vehicle_move() which is called by relaymove Clicking is done by way of signals registering to the entering mob NOTE: MMIS are NOT mobs but instead contain a brain that is, so you need special checks AI also has special checks becaus it gets in and out of the mech differently Always call remove_occupant(mob) when leaving the mech so the mob is removed properly

For multi-crew, you need to set how the occupants receive ability bitflags corresponding to their status on the vehicle(i.e: driver, gunner etc) Abilities can then be set to only apply for certain bitflags and are assigned as such automatically

Clicks are wither translated into mech_melee_attack (see mech_melee_attack.dm) Or are used to call action() on equipped gear Cooldown for gear is on the mech because exploits

Vars

accessesA list of all granted accesses
active_thrusters/Action vars Ref to any active thrusters we might have
allow_diagonal_movementWhether this mech is allowed to move diagonally
bumpsmashWhether or not the mech destroys walls by running into it.
cabin_airInternal air mix datum
cabin_sealed////////ATMOS Whether the cabin exchanges gases with the environment
cabin_volumeVolume of the cabin
can_use_overclockWhether it is possible to toggle overclocking from the cabin
capacitorKeeps track of the mech's capacitor
cellKeeps track of the mech's cell
chassis_cameraCamera installed into the mech
completely_disabledJust stop the mech from doing anything
component_damage_thresholddamage threshold above which we take component damage
defense_modeBool for energy shield on/off
destruction_sleep_durationTime you get slept for if you get forcible ejected by the mech exploding
dna_lockStores the DNA enzymes of a carbon so tht only they can access the mech
equip_by_categoryassoc list: key-typepathlist before init, key-equipmentlist after
equipment_disabledif we cant use our equipment(such as due to EMP)
exit_delayTIme taken to leave the mech
facing_modifiersModifiers for directional damage reduction
flat_equipmentflat equipment for iteration
internal_damageBitflags for internal damage
internal_damage_probability% chance for internal damage to occur
internal_damage_thresholddamage amount above which we can take internal damages
is_currently_ejectingCurrently ejecting, and unable to do things
lavaland_onlyBool for whether this mech can only be used on lavaland
light_power_drainPower we use to have the lights on
lights_powerHow powerful our lights are
max_equip_by_categoryassoc list: max equips for modules key-count
mech_typesingle flag for the type of this mech, determines what kind of equipment can be attached to it
mecha_flagsContains flags for the mecha
melee_cooldownCooldown duration between melee punches
melee_energy_drainHow much energy we drain each time we mechpunch someone
one_accessIf the mech should require ALL or only ONE of the listed accesses
ore_boxHandles an internal ore box for mining mechs
overclock_coeffSpeed and energy usage modifier for leg overload
overclock_modeBool for leg overload on/off
overclock_safetyWhether the overclocking turns off automatically when overheated
overclock_safety_availableWhether the mech has an option to enable safe overclocking
overclock_tempCurrent leg actuator temperature. Increases when overloaded, decreases when not.
overclock_temp_dangerTemperature threshold at which actuators may start causing internal damage
phase_stateicon_state for flick() when phazing
phasingcheck for phasing, if it is set to text (to describe how it is phasing: "flying", "phasing") it will let the mech walk through walls.
phasing_energy_drainPower we use every time we phaze through something
pivot_stepWhether this mech moves into a direct as soon as it goes to move. Basically, turn and step in the same key press.
possible_int_damagelist of possibly dealt internal damage for this mech type
scanmodKeeps track of the mech's scanning module
servoKeeps track of the mech's servo motor
silicon_icon_stateIn case theres a different iconstate for AI/MMI pilot(currently only used for ripley)
smashcooldownCooldown length between bumpsmashes
smoke_chargesRemaining smoke charges
smoke_cooldownCooldown between using smoke
spark_systemSpark effects are handled by this datum
step_energy_drainHow much energy the mech will consume each time it moves. this is the current active energy consumed
step_silentWhether our steps are silent due to no gravity
stepsoundSound played when the mech moves
strafeWether we are strafing
trackersList of installed remote tracking beacons, including AI control beacons
turnsoundSound played when the mech walks
ui_selected_module_indexModule selected by default when mech UI is opened
ui_themeTheme of the mech TGUI
ui_viewref to screen object that displays in the middle of the UI
updatingPortable camera camerachunk update
weapons_safetySafety for weapons. Won't fire if enabled, and toggled by middle click.
wreckageTypepath for the wreckage it spawns when destroyed

Procs

ai_enter_mechHack and From Card interactions share some code, so leave that here for both to use.
collect_oreCollects ore when we move, if there is an orebox and it is functional
diag_hud_set_cameraShows inbuilt camera on the mech; if the camera's view range was affected by an EMP, shows a red blip while it's affected
diag_hud_set_mechtrackingShows tracking beacons on the mech
display_speech_bubbleDisplays a special speech bubble when someone inside the mecha speaks
do_camera_updateThe actual update - also passes our unique update buffer. This makes our static update faster than stationary cameras, helping us to avoid running out of the camera's FoV. An EMPd mecha with a lowered view_range on its camera can still sometimes run out into static before updating, however.
generate_action_typeMECHA ACTIONS
get_armour_facingreturns a number for the damage multiplier for this relative angle/dir
get_int_repair_fluff_endgets the successful finish balloon alert flufftext
get_int_repair_fluff_failgets the on-fail balloon alert flufftext
get_int_repair_fluff_startgets the starting balloon alert flufftext
get_internal_tankLocate an internal tack in the utility modules
has_chargePower stuff
max_ammo// Ammo stuff /////
mmi_move_insideproc called when a new mmi mob tries to enter this mech
mmi_moved_insideproc called when a new mmi mob enters this mech
moved_insideproc called when a new non-mmi mob enters this mech
on_click_altDriver alt clicks anything while in mech
on_light_eaterSpecial light eater handling
on_middlemouseclickmiddle mouse click signal wrapper for AI users
on_mouseclickCalled when a driver clicks somewhere. Handles everything like equipment, punches, etc.
on_moveCalled when the mech moves
on_turnCalled when the driver turns with the movement lock key
play_stepsoundPlays the mech step sound effect. Split from movement procs so that other mechs (HONK) can override this one specific part.
populate_partsIf the former occupants get polymorphed, mutated, chestburstered, or otherwise replaced by another mob, that mob is no longer in .occupants and gets deleted with the mech. However, they do remain in .contents Add parts on mech spawning. Skipped in manual construction.
remove_airAtmospheric stuff
return_pressurefetches pressure of the gas mixture we are using
return_temperaturefetches temp of the gas mixture we are using
setDirSets the direction of the mecha and all of its occcupents, required for FOV. Alternatively one could make a recursive contents registration and register topmost direction changes in the fov component
set_cabin_sealmakes cabin unsealed, dumping cabin air outside or airtight filling the cabin with external air mix
set_mouse_pointerUpdates the pilot's mouse cursor override.
set_safetyToggles Weapons Safety
shockElectrocute user from power celll
toggle_lightsToggle lights on/off
toggle_overclockToggle mech overclock with a button or by hacking
try_damage_componenttries to damage mech equipment depending on damage and where is being targeted
try_deal_internal_damagetries to deal internal damaget depending on the damage amount
try_insert_partTry to insert a stock part into the mech
try_repair_int_damagetries to repair any internal damage and plays fluff for it
update_accessApply corresponding accesses
update_energy_drainUpdate the energy drain according to parts and status
upgrade_rcdlist of materials contained in the ammo box after we put it through the equation so we can stick this list into set_custom_materials() Upgrades any attached RCD equipment.

Var Details

accesses

A list of all granted accesses

active_thrusters

/Action vars Ref to any active thrusters we might have

allow_diagonal_movement

Whether this mech is allowed to move diagonally

bumpsmash

Whether or not the mech destroys walls by running into it.

cabin_air

Internal air mix datum

cabin_sealed

////////ATMOS Whether the cabin exchanges gases with the environment

cabin_volume

Volume of the cabin

can_use_overclock

Whether it is possible to toggle overclocking from the cabin

capacitor

Keeps track of the mech's capacitor

cell

Keeps track of the mech's cell

chassis_camera

Camera installed into the mech

completely_disabled

Just stop the mech from doing anything

component_damage_threshold

damage threshold above which we take component damage

defense_mode

Bool for energy shield on/off

destruction_sleep_duration

Time you get slept for if you get forcible ejected by the mech exploding

dna_lock

Stores the DNA enzymes of a carbon so tht only they can access the mech

equip_by_category

assoc list: key-typepathlist before init, key-equipmentlist after

equipment_disabled

if we cant use our equipment(such as due to EMP)

exit_delay

TIme taken to leave the mech

facing_modifiers

Modifiers for directional damage reduction

flat_equipment

flat equipment for iteration

internal_damage

Bitflags for internal damage

internal_damage_probability

% chance for internal damage to occur

internal_damage_threshold

damage amount above which we can take internal damages

is_currently_ejecting

Currently ejecting, and unable to do things

lavaland_only

Bool for whether this mech can only be used on lavaland

light_power_drain

Power we use to have the lights on

lights_power

How powerful our lights are

max_equip_by_category

assoc list: max equips for modules key-count

mech_type

single flag for the type of this mech, determines what kind of equipment can be attached to it

mecha_flags

Contains flags for the mecha

melee_cooldown

Cooldown duration between melee punches

melee_energy_drain

How much energy we drain each time we mechpunch someone

one_access

If the mech should require ALL or only ONE of the listed accesses

ore_box

Handles an internal ore box for mining mechs

overclock_coeff

Speed and energy usage modifier for leg overload

overclock_mode

Bool for leg overload on/off

overclock_safety

Whether the overclocking turns off automatically when overheated

overclock_safety_available

Whether the mech has an option to enable safe overclocking

overclock_temp

Current leg actuator temperature. Increases when overloaded, decreases when not.

overclock_temp_danger

Temperature threshold at which actuators may start causing internal damage

phase_state

icon_state for flick() when phazing

phasing

check for phasing, if it is set to text (to describe how it is phasing: "flying", "phasing") it will let the mech walk through walls.

phasing_energy_drain

Power we use every time we phaze through something

pivot_step

Whether this mech moves into a direct as soon as it goes to move. Basically, turn and step in the same key press.

possible_int_damage

list of possibly dealt internal damage for this mech type

scanmod

Keeps track of the mech's scanning module

servo

Keeps track of the mech's servo motor

silicon_icon_state

In case theres a different iconstate for AI/MMI pilot(currently only used for ripley)

smashcooldown

Cooldown length between bumpsmashes

smoke_charges

Remaining smoke charges

smoke_cooldown

Cooldown between using smoke

spark_system

Spark effects are handled by this datum

step_energy_drain

How much energy the mech will consume each time it moves. this is the current active energy consumed

step_silent

Whether our steps are silent due to no gravity

stepsound

Sound played when the mech moves

strafe

Wether we are strafing

trackers

List of installed remote tracking beacons, including AI control beacons

turnsound

Sound played when the mech walks

ui_selected_module_index

Module selected by default when mech UI is opened

ui_theme

Theme of the mech TGUI

ui_view

ref to screen object that displays in the middle of the UI

updating

Portable camera camerachunk update

weapons_safety

Safety for weapons. Won't fire if enabled, and toggled by middle click.

wreckage

Typepath for the wreckage it spawns when destroyed

Proc Details

ai_enter_mech

Hack and From Card interactions share some code, so leave that here for both to use.

collect_ore

Collects ore when we move, if there is an orebox and it is functional

diag_hud_set_camera

Shows inbuilt camera on the mech; if the camera's view range was affected by an EMP, shows a red blip while it's affected

diag_hud_set_mechtracking

Shows tracking beacons on the mech

display_speech_bubble

Displays a special speech bubble when someone inside the mecha speaks

do_camera_update

The actual update - also passes our unique update buffer. This makes our static update faster than stationary cameras, helping us to avoid running out of the camera's FoV. An EMPd mecha with a lowered view_range on its camera can still sometimes run out into static before updating, however.

generate_action_type

MECHA ACTIONS

get_armour_facing

returns a number for the damage multiplier for this relative angle/dir

get_int_repair_fluff_end

gets the successful finish balloon alert flufftext

get_int_repair_fluff_fail

gets the on-fail balloon alert flufftext

get_int_repair_fluff_start

gets the starting balloon alert flufftext

get_internal_tank

Locate an internal tack in the utility modules

has_charge

Power stuff

max_ammo

// Ammo stuff /////

Max the ammo stored in all ballistic weapons for this mech

mmi_move_inside

proc called when a new mmi mob tries to enter this mech

mmi_moved_inside

proc called when a new mmi mob enters this mech

moved_inside

proc called when a new non-mmi mob enters this mech

on_click_alt

Driver alt clicks anything while in mech

on_light_eater

Special light eater handling

on_middlemouseclick

middle mouse click signal wrapper for AI users

on_mouseclick

Called when a driver clicks somewhere. Handles everything like equipment, punches, etc.

on_move

Called when the mech moves

on_turn

Called when the driver turns with the movement lock key

play_stepsound

Plays the mech step sound effect. Split from movement procs so that other mechs (HONK) can override this one specific part.

populate_parts

If the former occupants get polymorphed, mutated, chestburstered, or otherwise replaced by another mob, that mob is no longer in .occupants and gets deleted with the mech. However, they do remain in .contents Add parts on mech spawning. Skipped in manual construction.

remove_air

Atmospheric stuff

return_pressure

fetches pressure of the gas mixture we are using

return_temperature

fetches temp of the gas mixture we are using

setDir

Sets the direction of the mecha and all of its occcupents, required for FOV. Alternatively one could make a recursive contents registration and register topmost direction changes in the fov component

set_cabin_seal

makes cabin unsealed, dumping cabin air outside or airtight filling the cabin with external air mix

set_mouse_pointer

Updates the pilot's mouse cursor override.

If the mech's weapons safety is enabled, there should be no override, and the user gets their regular mouse cursor. If safety is off but the mech's equipment is disabled (such as by EMP), the cursor should be the red disabled version. Otherwise, if safety is off and the equipment is functional, the cursor should be the regular green cursor. This proc sets the cursor. correct and then updates it for each mob in the occupants list.

set_safety

Toggles Weapons Safety

Handles enabling or disabling the safety function.

shock

Electrocute user from power celll

toggle_lights

Toggle lights on/off

toggle_overclock

Toggle mech overclock with a button or by hacking

try_damage_component

tries to damage mech equipment depending on damage and where is being targeted

try_deal_internal_damage

tries to deal internal damaget depending on the damage amount

try_insert_part

Try to insert a stock part into the mech

try_repair_int_damage

tries to repair any internal damage and plays fluff for it

update_access

Apply corresponding accesses

update_energy_drain

Update the energy drain according to parts and status

upgrade_rcd

list of materials contained in the ammo box after we put it through the equation so we can stick this list into set_custom_materials() Upgrades any attached RCD equipment.