Introduction/defines-input

Input Define

Input Defines are useful when you want your custom part to do something

when a certain button is pressed.


Example:

input_define->activate = E, public, editoronly, Activate, toggle

Explanation:


  • activate - id of the input

  • E - Input Key

  • public - Can be private, if it can be modified using Edit Part Menu

  • editoronly - Can be physonly or both, in what mode the property is visible in

    Part Edit Menu

  • Activate - Name of the input in game (Display Name)

  • toggle - Can be single, if the input is a toggle or a single (that can be modified

    in Part edit Edit Menu)


Input key can be changed via Part Edit Menu if it is set to public, the same is

for toggle option.

Using Inputs

To execute something when the input is pressed, use move (::) operator.


Example:

toggle::

{

gm_stock->console_log("Pressed E")

}

Line above will print "Pressed E" every time the previously defined "activate"

input is pressed or toggled.

documentation

Outdated! Updates coming soon.