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

riding

This is the riding component, which is applied to a movable atom by the ridable element when a mob is successfully buckled to said movable.

This component lives for as long as at least one mob is buckled to the parent. Once all mobs are unbuckled, the component is deleted, until another mob is buckled in and we make a new riding component, so on and so forth until the sun explodes.

Vars

allowed_turf_typecacheallow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence.
directional_vehicle_layers["[DIRECTION]"] = layer. Don't set it for a direction for default, set a direction to null for no change.
directional_vehicle_offsetssame as above but instead of layer you have a list(px, py)
forbid_turf_typecacheallow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence.
keytypeIf the driver needs a certain item in hand (or inserted, for vehicles) to drive this. For vehicles, this must be duplicated on the actual vehicle object in their /obj/vehicle/var/key_type variable because the vehicle objects still have a few special checks/functions of their own I'm not porting over to the riding component quite yet. Make sure if you define it on the vehicle, you define it here too.
message_cooldownFor telling someone they can't drive
override_allow_spacemoveWe don't need roads where we're going if this is TRUE, allow normal movement in space tiles
ride_check_flagsRide check flags defined for the specific riding component types, so we know if we need arms, legs, or whatever. Takes additional flags from the ridable element and the buckle proc (buckle_mob_flags) for riding cyborgs/humans in case we need to reserve arms
riding_offsetsposition_of_user = list(dir = list(px, py)), or RIDING_OFFSET_ALL for a generic one.
vehicle_move_cooldownFor telling someone they can't drive
vehicle_move_delaytick delay between movements, lower = faster, higher = slower

Procs

driver_moveEvery time the driver tries to move, this is called to see if they can actually drive and move the vehicle (via relaymove)
handle_specialsThis proc handles all of the proc calls to things like set_vehicle_dir_layer() that a type of riding datum needs to call on creation
handle_vehicle_layerSome ridable atoms may want to only show on top of the rider in certain directions, like wheelchairs
keycheckThis proc is used to see if we have the appropriate key to drive this atom, if such a key is needed. Returns FALSE if we don't have what we need to drive.
ride_checkCheck to see if we have all of the necessary bodyparts and not-falling-over statuses we need to stay onboard
unequip_buckle_inhandscurrently replicated from ridable because we need this behavior here too, see if we can deal with that
vehicle_bumpSo we can check all occupants when we bump a door to see if anyone has access
vehicle_mob_unbuckleThis proc is called when a rider unbuckles, whether they chose to or not. If there's no more riders, this will be the riding component's death knell.
vehicle_movedThis is called after the ridden atom is successfully moved and is used to handle icon stuff
vehicle_turnedTurning is like moving

Var Details

allowed_turf_typecache

allow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence.

directional_vehicle_layers

["[DIRECTION]"] = layer. Don't set it for a direction for default, set a direction to null for no change.

directional_vehicle_offsets

same as above but instead of layer you have a list(px, py)

forbid_turf_typecache

allow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence.

keytype

If the driver needs a certain item in hand (or inserted, for vehicles) to drive this. For vehicles, this must be duplicated on the actual vehicle object in their /obj/vehicle/var/key_type variable because the vehicle objects still have a few special checks/functions of their own I'm not porting over to the riding component quite yet. Make sure if you define it on the vehicle, you define it here too.

message_cooldown

For telling someone they can't drive

override_allow_spacemove

We don't need roads where we're going if this is TRUE, allow normal movement in space tiles

ride_check_flags

Ride check flags defined for the specific riding component types, so we know if we need arms, legs, or whatever. Takes additional flags from the ridable element and the buckle proc (buckle_mob_flags) for riding cyborgs/humans in case we need to reserve arms

riding_offsets

position_of_user = list(dir = list(px, py)), or RIDING_OFFSET_ALL for a generic one.

vehicle_move_cooldown

For telling someone they can't drive

vehicle_move_delay

tick delay between movements, lower = faster, higher = slower

Proc Details

driver_move

Every time the driver tries to move, this is called to see if they can actually drive and move the vehicle (via relaymove)

handle_specials

This proc handles all of the proc calls to things like set_vehicle_dir_layer() that a type of riding datum needs to call on creation

The original riding component had these procs all called from the ridden object itself through the use of GetComponent() and LoadComponent() This was obviously problematic for componentization, but while lots of the variables being set were able to be moved to component variables, the proc calls couldn't be. Thus, anything that has to do an initial proc call should be handled here.

handle_vehicle_layer

Some ridable atoms may want to only show on top of the rider in certain directions, like wheelchairs

keycheck

This proc is used to see if we have the appropriate key to drive this atom, if such a key is needed. Returns FALSE if we don't have what we need to drive.

Still needs to be neatened up and spruced up with proper OOP, as a result of vehicles having their own key handling from other ridable atoms

ride_check

Check to see if we have all of the necessary bodyparts and not-falling-over statuses we need to stay onboard

unequip_buckle_inhands

currently replicated from ridable because we need this behavior here too, see if we can deal with that

vehicle_bump

So we can check all occupants when we bump a door to see if anyone has access

vehicle_mob_unbuckle

This proc is called when a rider unbuckles, whether they chose to or not. If there's no more riders, this will be the riding component's death knell.

vehicle_moved

This is called after the ridden atom is successfully moved and is used to handle icon stuff

vehicle_turned

Turning is like moving