Level Interface - Data Structures

Level Interface - Implemented by Level Designer

Level Interface - Functions Callable by Level Code (Engine API)

Framework Level

function LEVEL_ReadVoltage(pointId)
	-- This function should return the current voltage at a test point.
	return 0
end

function LEVEL_SetPulse(pointId, pulseState)
	-- This function is called every cycle, once for each test point, with the current pulse state.
end

function LEVEL_ReadDebug(pointId)
	-- This function should return a REGISTERLIST with the current debug information at a test point.
	-- This function should return nil if the test point is not debug enabled.
	return nil
end

function LEVEL_WriteDebug(pointId, registerIndex, registerValue)
	-- This function is called when the player writes a value to a register. Register index starts at 1 for the first register.
end

function LEVEL_WriteSerial(pointId, serialData)
	-- This function is called when the player sends a character over the serial interface to a test point.
end

function LEVEL_Update(timeDelta)
	-- This function is called every cycle with the time, in floating-point seconds, since LEVEL_Update was last called.
end

function LEVEL_WidgetEvent(widgetName, eventName)
	-- This function is called every time a widget event fires.
end

function LEVEL_TimerCallback(timerName)
	-- This function is called when a timer, set with API_SetTimer, fires.
end

Creating Registers

RL_KeypadChip = {{name="ERROR", value="00000000", access=REGACCESS_READ}}

RL_LockChip = { {name="KEYCODE", value="01030904", access=REGACCESS_READ},
                {name="KEYSWAP", value="0F0F0F0F", access=REGACCESS_READ},
                {name="ERROR", value="00000000", access=REGACCESS_READ} }