A quick way to call in NIL script from Lua - jpbubble/NIL-isn-t-Lua GitHub Wiki
NIL is not specifically bound to an engine. It's been tested on a simple CLI Lua interpreter, but technically it should work on any engine using Lua 5.1 or later.
The only file you should need to include in your own Lua project to get NIL on the run is NIL.lua If you take a look at my test projects you can already see how stuff works a little.
Let's set up a very simple NIL project, in which Lua serves to activate it, but only that.
A simple Hello World
hello.nil
global void Hello()
print("Hello World")
end
hello.lua
NIL = require "NIL"
NIL.LoadFile("hello.nil")()
Hello()
Class style "Hello World"
You can also do this in class style, which can even force Lua to do things a bit more restrictively
class HelloClass
void Hello()
print("Hello World")
end
end
return HelloClass.NEW()
NIL = require "NIL"
hello = NIL.LoadFile("hello.nil")()
hello.Hello()
If you want your entire game to be written in NIL well, you just write all the code in NIL, and technically you only need three lines in your main script to get stuff on the roll. ;)