replace compile.bat with instructions in readme, remove third-party lualibs, add string type, fix luacall args
This commit is contained in:
16
readme.md
16
readme.md
@@ -7,7 +7,6 @@ Lua scripting for Blockland
|
||||
- Install RedBlocklandLoader
|
||||
- Copy `lua5.1.dll` into your Blockland install folder, next to `Blockland.exe`
|
||||
- Copy `BlockLua.dll` into the `modules` folder within the Blockland folder
|
||||
- Optional: Copy the `lualib` folder into `modules`
|
||||
|
||||
|
||||
## Quick Reference
|
||||
@@ -96,7 +95,7 @@ When reading from outside ZIPs, binary files are fully supported.
|
||||
`bl.datablock('datablockClassName datablockName:parentDatablockName', fields?)` - Create a new datablock with inheritance
|
||||
|
||||
### Classes and Types
|
||||
`bl.type('varName', 'type')` - Register the type of a Torque global variable, for conversion when accessing from Lua. Valid types are 'boolean', 'object', and nil (default is nil, which applies automatic conversion).
|
||||
`bl.type('varName', 'type')` - Register the type of a Torque global variable, for conversion when accessing from Lua. Valid types are 'boolean', 'object', 'string' (prevents automatic conversion), and nil (default, applies automatic conversion).
|
||||
`bl.type('funcName', 'type')` - Register the return type of a Torque function, for conversion when calling from Lua. Valid types are 'bool', 'object', and nil - all other conversion is automatic. Already done for all default functions.
|
||||
`bl.type('className::funcName', 'type')` - Register the return type of a Torque object method.
|
||||
`bl.class('className')` - Register an existing Torque class to be used from Lua. Already done for all built-in classes.
|
||||
@@ -179,14 +178,12 @@ TorqueScript stores no type information; all values in TorqueScript are strings.
|
||||
- Tables cannot be passed and will throw an error
|
||||
|
||||
## I/O and Safety
|
||||
All Lua code is sandboxed, and file access is confied to the default directories in the same way TorqueScript is.
|
||||
All Lua code is sandboxed, and file access is confined to the default directories in the same way TorqueScript is.
|
||||
BlockLua also has access to any C libraries installed in the `modules/lualib` folder, so be careful throwing things in there.
|
||||
### Unsafe Mode
|
||||
BlockLua-Unsafe.dll can be built and used in place of BlockLua.dll (see compile.bat), to remove the sandboxing of Lua code. This allows Lua code to access any file and use any library, including ffi.
|
||||
Please do not publish add-ons that require unsafe mode.
|
||||
|
||||
## Other Reference
|
||||
|
||||
### List of Object Types
|
||||
`'all'` - Any object
|
||||
`'player'` - Players or bots
|
||||
@@ -195,4 +192,11 @@ Please do not publish add-ons that require unsafe mode.
|
||||
`'projectile'` - Projectiles
|
||||
`'brick'` - Bricks with raycasting enabled
|
||||
`'brickalways'` - All bricks including those with raycasting disabled
|
||||
Other types: `'static'`, `'environment'`, `'terrain'`, `'water'`, `'trigger'`, `'marker'`, `'gamebase'`, `'shapebase'`, `'camera'`, `'staticshape'`, `'vehicleblocker'`, `'explosion'`, `'corpse'`, `'debris'`, `'physicalzone'`, `'staticts'`, `'staticrendered'`, `'damagableitem'`
|
||||
Other types: `'static'`, `'environment'`, `'terrain'`, `'water'`, `'trigger'`, `'marker'`, `'gamebase'`, `'shapebase'`, `'camera'`, `'staticshape'`, `'vehicleblocker'`, `'explosion'`, `'corpse'`, `'debris'`, `'physicalzone'`, `'staticts'`, `'staticrendered'`, `'damagableitem'`
|
||||
|
||||
## Compiling
|
||||
|
||||
With any *32-bit* variant of GCC installed (such as MinGW or MSYS2), run the following command in the repo directory:
|
||||
`g++ src/bllua4.cpp -o BlockLua.dll -m32 -shared -static-libgcc -Isrc -Iinc/tsfuncs -Iinc/lua -lpsapi -L. -llua5.1 src/bllua`
|
||||
|
||||
LuaJIT (lua5.1.dll) can be obtained from https://luajit.org/
|
||||
|
||||
Reference in New Issue
Block a user