lift_master
coordinate and control movement across linked industrial_lift's. allows moving large single multitile platforms and many 1 tile platforms. also is capable of linking platforms across linked z levels
Vars | |
allowed_travel_directions | what directions we're allowed to move |
---|---|
controls_locked | if true, the lift cannot be manually moved. |
create_multitile_platform | taken from our lift platforms. if true we go through each z level of platforms and attempt to make the lowest left corner platform into one giant multitile object the size of all other platforms on that z level. |
ignored_smashthroughs | Typepath list of what to ignore smashing through, controls all lifts |
lift_id | lift_id taken from our base lift platform, used to put us into GLOB.active_lifts_by_type |
lift_platforms | the lift platforms we consider as part of this lift. ordered in order of lowest z level to highest z level after init. (the sorting algorithm sucks btw) |
multitile_platform | whether the lift handled by this lift_master datum is multitile as opposed to nxm platforms per z level |
specific_lift_id | overridable ID string to link control units to this specific lift_master datum. created by placing a lift id landmark object somewhere on the tram, if its anywhere on the tram we'll find it in init and set this to whatever it specifies |
z_sorted | lift platforms have already been sorted in order of z level. |
Procs | |
Check_lift_move | Check destination turfs |
MoveLift | Moves the lift UP or DOWN, this is what users invoke with their hand. This is a SAFE proc, ensuring every part of the lift moves SANELY. It also locks controls for the (miniscule) duration of the movement, so the elevator cannot be broken by spamming. Arguments: going - UP or DOWN directions, where the lift should go. Keep in mind by this point checks of whether it should go up or down have already been done. user - Whomever made the lift movement. |
MoveLiftHorizontal | Moves the lift, this is what users invoke with their hand. This is a SAFE proc, ensuring every part of the lift moves SANELY. It also locks controls for the (miniscule) duration of the movement, so the elevator cannot be broken by spamming. |
Rebuild_lift_plaform | Collect all bordered platforms via a simple floodfill algorithm. allows multiz trams because its funny |
check_for_landmarks | check for any landmarks placed inside the locs of the given lift_platform |
create_multitile_platform_for_z_level | goes through all platforms in the given list and finds the one in the lower left corner |
get_platforms_on_level | returns all industrial_lifts associated with this tram on the given z level or given atoms z level |
order_platforms_by_z_level | orders the lift platforms in order of lowest z level to highest z level. |
reset_lift_contents | resets the contents of all platforms to their original state in case someone put a bunch of shit onto the tram. intended to be called by admins. passes all arguments to reset_contents() for each of our platforms. |
return_closest_platform_to | returns the closest lift to the specified atom, prioritizing lifts on the same z level. used for comparing distance |
set_controls | Sets all lift parts's controls_locked variable. Used to prevent moving mid movement, or cooldowns. |
set_info_from_id_landmark | set vars and such given an overriding lift_id landmark |
Var Details
allowed_travel_directions
what directions we're allowed to move
controls_locked
if true, the lift cannot be manually moved.
create_multitile_platform
taken from our lift platforms. if true we go through each z level of platforms and attempt to make the lowest left corner platform into one giant multitile object the size of all other platforms on that z level.
ignored_smashthroughs
Typepath list of what to ignore smashing through, controls all lifts
lift_id
lift_id taken from our base lift platform, used to put us into GLOB.active_lifts_by_type
lift_platforms
the lift platforms we consider as part of this lift. ordered in order of lowest z level to highest z level after init. (the sorting algorithm sucks btw)
multitile_platform
whether the lift handled by this lift_master datum is multitile as opposed to nxm platforms per z level
specific_lift_id
overridable ID string to link control units to this specific lift_master datum. created by placing a lift id landmark object somewhere on the tram, if its anywhere on the tram we'll find it in init and set this to whatever it specifies
z_sorted
lift platforms have already been sorted in order of z level.
Proc Details
Check_lift_move
Check destination turfs
MoveLift
Moves the lift UP or DOWN, this is what users invoke with their hand. This is a SAFE proc, ensuring every part of the lift moves SANELY. It also locks controls for the (miniscule) duration of the movement, so the elevator cannot be broken by spamming. Arguments: going - UP or DOWN directions, where the lift should go. Keep in mind by this point checks of whether it should go up or down have already been done. user - Whomever made the lift movement.
MoveLiftHorizontal
Moves the lift, this is what users invoke with their hand. This is a SAFE proc, ensuring every part of the lift moves SANELY. It also locks controls for the (miniscule) duration of the movement, so the elevator cannot be broken by spamming.
Rebuild_lift_plaform
Collect all bordered platforms via a simple floodfill algorithm. allows multiz trams because its funny
check_for_landmarks
check for any landmarks placed inside the locs of the given lift_platform
create_multitile_platform_for_z_level
goes through all platforms in the given list and finds the one in the lower left corner
get_platforms_on_level
returns all industrial_lifts associated with this tram on the given z level or given atoms z level
order_platforms_by_z_level
orders the lift platforms in order of lowest z level to highest z level.
reset_lift_contents
resets the contents of all platforms to their original state in case someone put a bunch of shit onto the tram. intended to be called by admins. passes all arguments to reset_contents() for each of our platforms.
Arguments:
- consider_anything_past - number. if > 0 our platforms will only handle foreign contents that exceed this number in each of their locs
- foreign_objects - bool. if true our platforms will consider /atom/movable's that arent mobs as part of foreign contents
- foreign_non_player_mobs - bool. if true our platforms consider mobs that dont have a mind to be foreign
- consider_player_mobs - bool. if true our platforms consider player mobs to be foreign. only works if foreign_non_player_mobs is true as well
return_closest_platform_to
returns the closest lift to the specified atom, prioritizing lifts on the same z level. used for comparing distance
set_controls
Sets all lift parts's controls_locked variable. Used to prevent moving mid movement, or cooldowns.
set_info_from_id_landmark
set vars and such given an overriding lift_id landmark