Skip to content
Artiom Parygin edited this page Nov 21, 2023 · 21 revisions

New control system

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)

Currently supported controls (values of control_name):

Physical and movement-related 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)

Setting and TARDIS state controls

power
repair 
door 
doorlock 
cloak 
shields
toggle_screens 
toggle_scanners 
sonic_dispenser 
redecorate 
isomorphic
exterior_light
toggle_console

Screen-opening controls

coordinates 
virtualconsole 
music 
scanner 

Third person view controls

thirdperson 
thirdperson_careful (requires ALT+E / WALK+USE instead of E / USE)
destination

Coming in the next updates

stabilizers (?)
interior_lights (?)