-
-
Notifications
You must be signed in to change notification settings - Fork 28
Hooks
The TARDIS features it's own hook system, separate from GMods one.
It was created so that parts of the entity could easily communicate and ask questions to other parts of it.
A good example of this is the ShouldDraw
hook on the interior, which asks all the modules if it shouldn't be drawing for any reason.
This type of system is extendible and allows multiple features to work together in harmony.
Most hooks in the TARDIS work in an "override principle", meaning you shouldn't return anything unless you want to "override" default behaviour.
One example is EXTERIOR::CanTurnOnFlight. Returning false in this hook will prevent flight toggling, anything else (including nothing) will allow it.
Obviously this only works with hooks that expect a return value. (Most hooks beggining with Can
or Should
expect at least one boolean)
For viewing convenience, the hooks list has been split between Client and Server in each case
Beware some hooks may not actually pass values listed here to functions when they're called. Always check for invalid values!