-
-
Notifications
You must be signed in to change notification settings - Fork 28
Controls
Instead of having to use functions like
self:Demat()
self:Mat()
self:ToggleFloat()
you can now use:
TARDIS:Control(<control_name>, <activator/player> [, <part entity>])
This interface is same for all controls, and it automates notifications, server/client interaction and interior tip texts (which you still can change)
What is more, instead of specifying
PART:Use(ply) { ... }
function in its code, you can just type
PART.Control = <control_name>
,
and it will create the PART:Use()
function for you
You may still use the old ways to add controls (for example, if any kind of complex behaviour is required)
However, the best and recommended way to specify controls is in the interior metadata (the main interior file in lua/tardis/interiors folder)
To do that, after Parts = { ... },
, insert the list of controls like this:
Parts = {
...
},
Controls = {
<part1_name> = <control_name>,
<part2_name> = <control_name>,
...
<partN_name> = <control_name>,
},
We recommend you to change the way the controls are specified into this new (metadata) way, since it will make it easier to support new TARDIS features yet to come. Thank you!
The implementation of all controls is in a single folder lua/tardis/controls of the main addon
(https://github.com/MattJeanes/TARDIS/tree/main/lua/tardis/controls)
teleport
teleport_double -- same as teleport, but part-dependent
random_coords
flight
float
hads
vortex_flight
fastreturn
physlock
handbrake
engine_release
spin_cycle (cycles between all spinning options)
spin_toggle (turns spinning on and off)
spin_switch (switches direction)
power
repair
door
doorlock
cloak
shields
toggle_screens
toggle_scanners
sonic_dispenser
redecorate
isomorphic
exterior_light
toggle_console
coordinates
virtualconsole
music
scanner
thirdperson
thirdperson_careful (requires ALT+E / WALK+USE instead of E / USE)
destination
stabilizers (?)
interior_lights (?)