Preprocessor directives

List of preprocessor directives

List

--@include path Mark a file to be included in the upload.
--@inputs variable Pre-define the wire inputs for a starfall chip.
Inputs are created for you prior to chip execution.
Multiple variables can be defined on a single line, separated by commas.
Caution: E2 Variables have an uppercase first character, so must your 'variable' name.
Caution: The 'type' of your variable must match E2 naming convention.
--@model model Set the model of the processor entity.
--@name name Set the name of the script.
--@outputs variable Pre-define the wire outputs for a starfall chip.
Outputs are created for you prior to chip execution.
Multiple variables can be defined on a single line, separated by commas.
Caution: E2 Variables have an uppercase first character, so must your 'variable' name.
Caution: The 'type' of your variable must match E2 naming convention.
--@sharedscreen  For screens, make the script run on the server, as well.


--@include path
Mark a file to be included in the upload. This is required to use the file in require() and dofile()

Parameters:

  • path: Path to the file

Usage:

    --@include lib/someLibrary.txt 
     
    require( "lib/someLibrary.txt" ) 
    -- CODE
--@inputs variable
Pre-define the wire inputs for a starfall chip.
Inputs are created for you prior to chip execution.
Multiple variables can be defined on a single line, separated by commas.
Caution: E2 Variables have an uppercase first character, so must your 'variable' name.
Caution: The 'type' of your variable must match E2 naming convention. 'normal', 'string', 'vector', etc.

Parameters:

  • variable: Name of the input, along with type, joined with a ':' ( colon ).

Usage:

    --@inputs SomeString:String 
    -- CODE
--@model model
Set the model of the processor entity. This does not set the model of the screen entity

Parameters:

  • model: String of the model

Usage:

    --@model models/props_junk/watermelon01.mdl 
    -- CODE
--@name name
Set the name of the script. This will become the name of the tab and will show on the overlay of the processor

Parameters:

  • name: Name of the script

Usage:

    --@name Awesome script 
    -- CODE
--@outputs variable
Pre-define the wire outputs for a starfall chip.
Outputs are created for you prior to chip execution.
Multiple variables can be defined on a single line, separated by commas.
Caution: E2 Variables have an uppercase first character, so must your 'variable' name.
Caution: The 'type' of your variable must match E2 naming convention. 'normal', 'string', 'vector', etc.

Parameters:

  • variable: Name of the output, along with type, joined with a ':' ( colon ).

Usage:

    --@outputs SomeString:String 
    -- CODE
--@sharedscreen 
For screens, make the script run on the server, as well. You can use "if SERVER" and "if CLIENT" to determine if the script is currently being run on the server or the client, respectively.

Usage:

    --@sharedscreen 
     
    if SERVER then 
    	-- Do important calculations 
    	-- Send net message 
    else 
    	-- Display result of important calculations 
    end

Valid XHTML 1.0!