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 recieve 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 | |
allow_diagonal_movement | Whether this mech is allowed to move diagonally |
---|---|
bumpsmash | Whether or not the mech destroys walls by running into it. |
capacitor | Keeps track of the mech's capacitor |
cell | Keeps track of the mech's cell |
completely_disabled | Just stop the mech from doing anything |
component_damage_threshold | damage threshold above which we take component damage |
connected_port | The connected air port, if we have one |
construction_state | Whether the mechs maintenance protocols are on or off |
dash_cooldown | cooldown time between dashes on greyscale mechs |
dash_power_consumption | How much energy we use per mech dash |
dash_range | dash_range |
defense_mode | /Action vars Bool for energy shield on/off |
destruction_sleep_duration | Time you get slept for if you get forcible ejected by the mech exploding |
dir_in | What direction will the mech face when entered/powered on? Defaults to South. |
dna_lock | Stores the DNA enzymes of a carbon so tht only they can access the mech |
emp_timer | holds the EMP timer |
enclosed | Whether outside viewers can see the pilot inside |
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 |
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 |
internal_tank | The internal air tank obj of the mech |
internal_tank_valve | The setting of the valve on the internal tank |
internals_req_access | required access to change internal components |
is_currently_ejecting | Currently ejecting, and unable to do things |
leg_overload_coeff | Energy use modifier for leg overload |
leg_overload_mode | Bool for leg overload on/off |
lights_power | How powerful our lights are |
max_equip_by_category | assoc list: max equips for non-arm modules key-count |
max_repairpacks | max amt of repairpacks we can store |
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 |
no_footstep_particle | determines if the mech does the footstep particles |
normal_step_energy_drain | How much energy the mech will consume each time it moves. This variable is a backup for when leg actuators affect the energy drain. |
operation_req_access | required access level for mecha operation |
overload_step_energy_drain_min | The minimum amount of energy charge consumed by leg overload |
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 |
radio | Special version of the radio, which is unsellable |
scanmod | Keeps track of the mech's scanning module |
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 |
speed_mod | stores value that we will add and remove from the mecha when toggling leg overload |
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 |
stored_repairpacks | actual amt of repairpacks we have stored |
strafe | Wether we are strafing |
turnsound | Sound played when the mech walks |
ui_view | ref to screen object that displays in the middle of the UI |
ui_x | Ui size, so you can make the UI bigger if you let it load a lot of stuff |
ui_y | Ui size, so you can make the UI bigger if you let it load a lot of stuff |
use_internal_tank | ////////ATMOS Whether we are currrently drawing from the internal tank |
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 | |
add_capacitor | Adds a capacitor, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this. |
add_cell | Adds a cell, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this. |
add_scanmod | Adds a scanning module, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this. |
disconnect_air | Disconnects air tank- air port connection on mecha move |
display_speech_bubble | Displays a special speech bubble when someone inside the mecha speaks |
generate_action_type | MECHA ACTIONS |
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 |
has_charge | Power stuff |
hud_set_mecha_battery | Updates mecha battery |
hud_set_mecha_health | Mecha health hud updates |
moved_inside | proc called when a new non-mmi/AI mob enters this mech |
on_jump_land | Stuff that happens when a mech finishes a jump |
on_jump_start | Stuff that happens when a mech finishes a jump |
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_turn | Called when the driver turns with the movement lock key |
operation_allowed | Access stuff |
play_stepsound | Plays the mech step sound effect. Split from movement procs so that other mechs (HONK) can override this one specific part. |
restore_equipment | Restores the mech after EMP |
run_over | Crushing the mob underfoot |
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_mouse_pointer | Updates the pilot's mouse cursor override. |
set_safety | Toggles Weapons Safety |
try_damage_component | tries to damage mech equipment depending on damage and where is being targetted |
try_deal_internal_damage | tries to deal internal damaget depending on the damage amount |
try_repair_int_damage | tries to repair any internal damage and plays fluff for it |
update_part_values | Updates the values given by scanning module and capacitor tier, called when a part is removed or inserted. |
Var Details
allow_diagonal_movement

Whether this mech is allowed to move diagonally
bumpsmash

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

Keeps track of the mech's capacitor
cell

Keeps track of the mech's cell
completely_disabled

Just stop the mech from doing anything
component_damage_threshold

damage threshold above which we take component damage
connected_port

The connected air port, if we have one
construction_state

Whether the mechs maintenance protocols are on or off
dash_cooldown

cooldown time between dashes on greyscale mechs
dash_power_consumption

How much energy we use per mech dash
dash_range

dash_range
defense_mode

/Action vars Bool for energy shield on/off
destruction_sleep_duration

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

What direction will the mech face when entered/powered on? Defaults to South.
dna_lock

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

holds the EMP timer
enclosed

Whether outside viewers can see the pilot inside
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
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
internal_tank

The internal air tank obj of the mech
internal_tank_valve

The setting of the valve on the internal tank
internals_req_access

required access to change internal components
is_currently_ejecting

Currently ejecting, and unable to do things
leg_overload_coeff

Energy use modifier for leg overload
leg_overload_mode

Bool for leg overload on/off
lights_power

How powerful our lights are
max_equip_by_category

assoc list: max equips for non-arm modules key-count
max_repairpacks

max amt of repairpacks we can store
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
no_footstep_particle

determines if the mech does the footstep particles
normal_step_energy_drain

How much energy the mech will consume each time it moves. This variable is a backup for when leg actuators affect the energy drain.
operation_req_access

required access level for mecha operation
overload_step_energy_drain_min

The minimum amount of energy charge consumed by leg overload
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
radio

Special version of the radio, which is unsellable
scanmod

Keeps track of the mech's scanning module
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
speed_mod

stores value that we will add and remove from the mecha when toggling leg overload
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
stored_repairpacks

actual amt of repairpacks we have stored
strafe

Wether we are strafing
turnsound

Sound played when the mech walks
ui_view

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

Ui size, so you can make the UI bigger if you let it load a lot of stuff
ui_y

Ui size, so you can make the UI bigger if you let it load a lot of stuff
use_internal_tank

////////ATMOS Whether we are currrently drawing from the internal tank
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
add_capacitor
Adds a capacitor, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this.
add_cell
Adds a cell, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this.
add_scanmod
Adds a scanning module, for use in Map-spawned mechs, Nuke Ops mechs, and admin-spawned mechs. Mechs built by hand will replace this.
disconnect_air
Disconnects air tank- air port connection on mecha move
display_speech_bubble
Displays a special speech bubble when someone inside the mecha speaks
generate_action_type
MECHA ACTIONS
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
has_charge
Power stuff
hud_set_mecha_battery
Updates mecha battery
hud_set_mecha_health
Mecha health hud updates
moved_inside
proc called when a new non-mmi/AI mob enters this mech
on_jump_land
Stuff that happens when a mech finishes a jump
on_jump_start
Stuff that happens when a mech finishes a jump
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_turn
Called when the driver turns with the movement lock key
operation_allowed
Access stuff
play_stepsound
Plays the mech step sound effect. Split from movement procs so that other mechs (HONK) can override this one specific part.
restore_equipment
Restores the mech after EMP
run_over
Crushing the mob underfoot
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_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.
try_damage_component
tries to damage mech equipment depending on damage and where is being targetted
try_deal_internal_damage
tries to deal internal damaget depending on the damage amount
try_repair_int_damage
tries to repair any internal damage and plays fluff for it
update_part_values
Updates the values given by scanning module and capacitor tier, called when a part is removed or inserted.