Skip to content
Artiom Parygin edited this page Dec 8, 2021 · 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>)

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
flight
float
hads
vortex_flight
fastreturn
physlock
handbrake
enginerelease

Setting and TARDIS state controls

power
repair 
door 
doorlock 
cloak 
toggle_screens 
sonic_dispenser 
redecorate 
isomorphic

Screen-opening controls

coordinates 
virtualconsole 
music 
scanner 
settings

Third person view controls

thirdperson 
destination

Coming in the next updates

spin_cycle
spin_toggle
spin_switch