-
-
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>)
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
flight
float
hads
vortex_flight
fastreturn
physlock
handbrake
enginerelease
power
repair
door
doorlock
cloak
toggle_screens
sonic_dispenser
redecorate
isomorphic
coordinates
virtualconsole
music
scanner
settings
thirdperson
destination
spin_cycle
spin_toggle
spin_switch