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_typecache | allow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence. |
---|---|
can_force_unbuckle | can anyone other than the rider unbuckle the rider? |
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 |
rider_traits | additional traits to add to anyone riding this vehicle |
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 |
Procs | |
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 |
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. |
on_entered_supermatter | When we touch a crystal, kill everything inside us |
on_movement_type_trait_gain | Called when our vehicle gains a movement trait, so we can apply it to the riders |
on_movement_type_trait_loss | Called when our vehicle loses a movement trait, so we can remove it from the riders |
on_rider_try_pull | This proc is called when the rider attempts to grab the thing they're riding, preventing them from doing so. |
post_vehicle_mob_buckle | any behavior we want to happen after buckling the mob |
ride_check | Check to see if we have all of the necessary bodyparts and not-falling-over statuses we need to stay onboard. If not and if consequences is TRUE, well, there'll be consequences. |
riding_can_z_move | Extra checks before buckled.can_z_move can be called in mob/living/can_z_move() |
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_buckle | This proc is called when a rider buckles, allowing for offsets to be set properly |
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 |
Var Details
allowed_turf_typecache
allow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence.
can_force_unbuckle
can anyone other than the rider unbuckle the rider?
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
rider_traits
additional traits to add to anyone riding this vehicle
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
on_entered_supermatter
When we touch a crystal, kill everything inside us
on_movement_type_trait_gain
Called when our vehicle gains a movement trait, so we can apply it to the riders
on_movement_type_trait_loss
Called when our vehicle loses a movement trait, so we can remove it from the riders
on_rider_try_pull
This proc is called when the rider attempts to grab the thing they're riding, preventing them from doing so.
post_vehicle_mob_buckle
any behavior we want to happen after buckling the mob
ride_check
Check to see if we have all of the necessary bodyparts and not-falling-over statuses we need to stay onboard. If not and if consequences is TRUE, well, there'll be consequences.
riding_can_z_move
Extra checks before buckled.can_z_move can be called in mob/living/can_z_move()
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_buckle
This proc is called when a rider buckles, allowing for offsets to be set properly
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