Files

15 lines
20 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/component/riding - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="datum/component/riding.html#var">Var Details</a> - <a href="datum/component/riding.html#proc">Proc Details</a></header><main><h1>riding <aside>/<a href="datum.html">datum</a>/<a href="datum/component.html">component</a>/<a href="datum/component/riding.html">riding</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L8"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 8"></a></h1><p>This is the riding component, which is applied to a movable atom by the <a href="datum/element/ridable.html" title="/datum/element/ridable">ridable element</a> when a mob is successfully buckled to said movable.</p>
<p>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.</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/component/riding.html#var/allowed_turf_typecache">allowed_turf_typecache</a></th><td>allow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence.</td></tr><tr><th><a href="datum/component/riding.html#var/can_force_unbuckle">can_force_unbuckle</a></th><td>can anyone other than the rider unbuckle the rider?</td></tr><tr><th><a href="datum/component/riding.html#var/directional_vehicle_layers">directional_vehicle_layers</a></th><td>[&quot;[DIRECTION]&quot;] = layer. Don't set it for a direction for default, set a direction to null for no change.</td></tr><tr><th><a href="datum/component/riding.html#var/directional_vehicle_offsets">directional_vehicle_offsets</a></th><td>same as above but instead of layer you have a list(px, py)</td></tr><tr><th><a href="datum/component/riding.html#var/forbid_turf_typecache">forbid_turf_typecache</a></th><td>allow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence.</td></tr><tr><th><a href="datum/component/riding.html#var/keytype">keytype</a></th><td>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.</td></tr><tr><th><a href="datum/component/riding.html#var/message_cooldown">message_cooldown</a></th><td>For telling someone they can't drive</td></tr><tr><th><a href="datum/component/riding.html#var/override_allow_spacemove">override_allow_spacemove</a></th><td>We don't need roads where we're going if this is TRUE, allow normal movement in space tiles</td></tr><tr><th><a href="datum/component/riding.html#var/ride_check_flags">ride_check_flags</a></th><td>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</td></tr><tr><th><a href="datum/component/riding.html#var/riding_offsets">riding_offsets</a></th><td>position_of_user = list(dir = list(px, py)), or RIDING_OFFSET_ALL for a generic one.</td></tr><tr><th><a href="datum/component/riding.html#var/vehicle_move_cooldown">vehicle_move_cooldown</a></th><td>For telling someone they can't drive</td></tr><tr><th><a href="datum/component/riding.html#var/vehicle_move_delay">vehicle_move_delay</a></th><td>Tick delay between movements, lower = faster, higher = slower</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/component/riding.html#proc/driver_move">driver_move</a></th><td>Every time the driver tries to move, this is called to see if they can actually drive and move the vehicle (via relaymove)</td></tr><tr><th><a href="datum/component/riding.html#proc/handle_specials">handle_specials</a></th><td>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</td></tr><tr><th><a href="datum/component/riding.html#proc/handle_vehicle_layer">handle_vehicle_layer</a></th><td>Some ridable atoms may want to only show on top of the rider in certain directions, like wheelchairs</td></tr><tr><th><a href="datum/component/riding.html#proc/keycheck">keycheck</a></th><td>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.</td></tr><tr><th><a href="datum/component/riding.html#proc/on_rider_try_pull">on_rider_try_pull</a></th><td>This proc is called when the rider attempts to grab something, preventing them from doing so.</td></tr><tr><th><a href="datum/component/riding.html#proc/ride_check">ride_check</a></th><td>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.</td></tr><tr><th><a href="datum/component/riding.html#proc/unequip_buckle_inhands">unequip_buckle_inhands</a></th><td>currently replicated from ridable because we need this behavior here too, see if we can deal with that</td></tr><tr><th><a href="datum/component/riding.html#proc/vehicle_bump">vehicle_bump</a></th><td>So we can check all occupants when we bump a door to see if anyone has access</td></tr><tr><th><a href="datum/component/riding.html#proc/vehicle_mob_buckle">vehicle_mob_buckle</a></th><td>This proc is called when a rider buckles, allowing for offsets to be set properly</td></tr><tr><th><a href="datum/component/riding.html#proc/vehicle_mob_unbuckle">vehicle_mob_unbuckle</a></th><td>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.</td></tr><tr><th><a href="datum/component/riding.html#proc/vehicle_moved">vehicle_moved</a></th><td>This is called after the ridden atom is successfully moved and is used to handle icon stuff</td></tr><tr><th><a href="datum/component/riding.html#proc/vehicle_turned">vehicle_turned</a></th><td>Turning is like moving</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/allowed_turf_typecache"><aside class="declaration">var </aside>allowed_turf_typecache <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L29"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 29"></a></h3><p>allow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence.</p><h3 id="var/can_force_unbuckle"><aside class="declaration">var </aside>can_force_unbuckle <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L35"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 35"></a></h3><p>can anyone other than the rider unbuckle the rider?</p><h3 id="var/directional_vehicle_layers"><aside class="declaration">var </aside>directional_vehicle_layers <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L25"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 25"></a></h3><p>[&quot;[DIRECTION]&quot;] = layer. Don't set it for a direction for default, set a direction to null for no change.</p><h3 id="var/directional_vehicle_offsets"><aside class="declaration">var </aside>directional_vehicle_offsets <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L27"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 27"></a></h3><p>same as above but instead of layer you have a list(px, py)</p><h3 id="var/forbid_turf_typecache"><aside class="declaration">var </aside>forbid_turf_typecache <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L31"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 31"></a></h3><p>allow typecache for only certain turfs, forbid to allow all but those. allow only certain turfs will take precedence.</p><h3 id="var/keytype"><aside class="declaration">var </aside>keytype <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L20"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 20"></a></h3><p>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.</p><h3 id="var/message_cooldown"><aside class="declaration">var </aside>message_cooldown <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L43"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 43"></a></h3><p>For telling someone they can't drive</p><h3 id="var/override_allow_spacemove"><aside class="declaration">var </aside>override_allow_spacemove <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L33"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 33"></a></h3><p>We don't need roads where we're going if this is TRUE, allow normal movement in space tiles</p><h3 id="var/ride_check_flags"><aside class="declaration">var </aside>ride_check_flags <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L41"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 41"></a></h3><p>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</p><h3 id="var/riding_offsets"><aside class="declaration">var </aside>riding_offsets <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L23"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 23"></a></h3><p>position_of_user = list(dir = list(px, py)), or RIDING_OFFSET_ALL for a generic one.</p><h3 id="var/vehicle_move_cooldown"><aside class="declaration">var </aside>vehicle_move_cooldown <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L45"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 45"></a></h3><p>For telling someone they can't drive</p><h3 id="var/vehicle_move_delay"><aside class="declaration">var </aside>vehicle_move_delay <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L13"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 13"></a></h3><p>Tick delay between movements, lower = faster, higher = slower</p><h2 id="proc">Proc Details</h2><h3 id="proc/driver_move"><aside class="declaration">proc </aside>driver_move<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/movable_parent, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/user, direction) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L237"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 237"></a></aside></h3><p>Every time the driver tries to move, this is called to see if they can actually drive and move the vehicle (via relaymove)</p><h3 id="proc/handle_specials"><aside class="declaration">proc </aside>handle_specials<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L74"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 74"></a></aside></h3><p>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</p>
<p>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.</p><h3 id="proc/handle_vehicle_layer"><aside class="declaration">proc </aside>handle_vehicle_layer<aside>(dir) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L110"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 110"></a></aside></h3><p>Some ridable atoms may want to only show on top of the rider in certain directions, like wheelchairs</p><h3 id="proc/keycheck"><aside class="declaration">proc </aside>keycheck<aside>(/<a href="mob.html">mob</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L210"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 210"></a></aside></h3><p>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.</p>
<p>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</p><h3 id="proc/on_rider_try_pull"><aside class="declaration">proc </aside>on_rider_try_pull<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/rider_pulling, /<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/target, force) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L104"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 104"></a></aside></h3><p>This proc is called when the rider attempts to grab something, preventing them from doing so.</p><h3 id="proc/ride_check"><aside class="declaration">proc </aside>ride_check<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/rider, consequences) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L147"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 147"></a></aside></h3><p>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.</p><h3 id="proc/unequip_buckle_inhands"><aside class="declaration">proc </aside>unequip_buckle_inhands<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/user) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L258"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 258"></a></aside></h3><p>currently replicated from ridable because we need this behavior here too, see if we can deal with that</p><h3 id="proc/vehicle_bump"><aside class="declaration">proc </aside>vehicle_bump<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/movable_parent, /<a href="obj.html">obj</a>/<a href="obj/machinery.html">machinery</a>/<a href="obj/machinery/door.html">door</a>/possible_bumped_door) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L243"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 243"></a></aside></h3><p>So we can check all occupants when we bump a door to see if anyone has access</p><h3 id="proc/vehicle_mob_buckle"><aside class="declaration">proc </aside>vehicle_mob_buckle<aside>(/<a href="datum.html">datum</a>/source, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/rider, force) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L92"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 92"></a></aside></h3><p>This proc is called when a rider buckles, allowing for offsets to be set properly</p><h3 id="proc/vehicle_mob_unbuckle"><aside class="declaration">proc </aside>vehicle_mob_unbuckle<aside>(/<a href="datum.html">datum</a>/source, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/rider, force) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L78"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 78"></a></aside></h3><p>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.</p><h3 id="proc/vehicle_moved"><aside class="declaration">proc </aside>vehicle_moved<aside>(/<a href="datum.html">datum</a>/source, oldloc, dir, forced) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L124"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 124"></a></aside></h3><p>This is called after the ridden atom is successfully moved and is used to handle icon stuff</p><h3 id="proc/vehicle_turned"><aside class="declaration">proc </aside>vehicle_turned<aside>(/<a href="datum.html">datum</a>/source, _old_dir, new_dir) <a href="https://github.com/ParadiseSS13/Paradise/blob/edee60476d21ee840643bd1abe7f6003a8c65773/code/datums/components/riding/riding.dm#L138"><img src="git.png" width="16" height="16" title="code/datums/components/riding/riding.dm 138"></a></aside></h3><p>Turning is like moving</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/edee60476d21ee840643bd1abe7f6003a8c65773">edee604</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html>