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 Cooldown for melee is on mech_melee_attack also because exploits
Vars | |
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 |
attack_verbs | Melee attack verb |
brute_attack_sound | Sounds for types of melee attack |
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 |
destroy_wall_sound | Sound on wall destroying |
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 |
inertia_force_weight | Significantly heavier than humans |
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 |
safety_sound_custom | Don't play standard sound when set safety if TRUE. |
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) |
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 |
Procs | |
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 ///// |
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 | 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. |
set_safety | Toggles Weapons Safety |
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 | 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
attack_verbs
Melee attack verb
brute_attack_sound
Sounds for types of melee attack
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
destroy_wall_sound
Sound on wall destroying
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
inertia_force_weight
Significantly heavier than humans
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
safety_sound_custom
Don't play standard sound when set safety if TRUE.
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)
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
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
Upgrades any attached RCD equipment.