Difference between revisions of "Lua:registerCustomTypeLua"
Jump to navigation
Jump to search
(Created page with ''''function''' registerCustomTypeLua(''typename'', ''bytecount'', ''bytestovaluefunction'', ''valuetobytesfunction'') Registers a custom variable type based on lua scripts The …') |
|||
Line 7: | Line 7: | ||
The value to bytes function should be defined as "function valuetobytes (integer)" and return the bytes it should write | The value to bytes function should be defined as "function valuetobytes (integer)" and return the bytes it should write | ||
− | |||
− | |||
− | |||
===Function Parameters=== | ===Function Parameters=== |
Revision as of 22:01, 18 May 2012
function registerCustomTypeLua(typename, bytecount, bytestovaluefunction, valuetobytesfunction)
Registers a custom variable type based on lua scripts
The bytes to value function should be defined as "function bytestovalue (b1,b2,b3,b4)" and return an integer as result
The value to bytes function should be defined as "function valuetobytes (integer)" and return the bytes it should write
Function Parameters
Parameter | Type | Description |
---|---|---|
typename | string | Name of the custom type |
bytecount | integer | The number of bytes this variable contains |
bytestovaluefunction | function | Declared as function (b1,b2,b3,b4,...). Must return an integer representing what those bytes mean |
valuetobytesfunction | function | Declared as function (integer). Must return a row of bytes representing the given integer |