Skip to content
Matt Jeanes edited this page Nov 25, 2021 · 21 revisions

Control system

Instead of having to use functions like self:Demat(), self:Mat(), self:ToggleFloat() you can use TARDIS:Control(<control_name>, <activator/player>)

This interface is same for all controls, and it automates the notifications, the server/client interaction, and interior tip text presets (which you can reconfigure)

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 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):

  • Movement and other physical controls: teleport flight float hads vortexflight 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 controls: thirdperson destination