Ahem. This assumes you know a little BIT about Verge and Lua, but after this you should be ready to go.
The Super Quick Guide to Using LuaVerge
First things first,
to enable Lua scripting, you need to add the line "lua 1" to your verge.cfg. This replaces VergeC with Lua as the scripting language.
So okay, great, now we're using Lua! What do you want to do next? Well, you'll want to
make a system.lua. Basically the rule is: Anything you'd name with a .vc extension before, you now name with a .lua extension.
Okay, so make a file named system.lua and then put something like the following in there:
-- "autoexec" needs to be lowercase here or it'll whine!
function autoexec()
while not v3.key[v3.SCAN_ENTER] do
v3.ShowPage()
end
v3.Exit("You pressed enter!")
end
Okay, that should be enough to get you going. Next, here's the next rule to using code in Lua. A lot of stuff in VC is accessible in Lua, but not everything. Well, trial and error should figure this out.
Basically you just put "v3.whatever" instead of "whatever", and save for a few adjustments everything works the same.
Note there ARE a few noticeable changes though:
v3.entity[0].x -- Used instead of VC's entity.x[0], similar for other builtin array-of-struct things.
v3.b1 -- ERROR! The "button" variables don't exist. Whatever, make your own.
v3.key[v3.SCAN_LEFT] -- This returns a BOOLEAN, not an int.
Note that a lot of places that use ints to represent "truth" values in VC are now booleans. But there are sometimes a few stray ones that still take ints, so you need to use the following knowledge:
local n = VALUE and 1 or 0 -- Convert boolean into number
local b = VALUE ~= 0 -- Convert number into a boolean
Note that a lot of oddities like these were what further drove me into making the
vx library. It makes things fairly different from the way they're in VC.
That should be enough to get you going.
Please add any helpful info about Lua and LuaVerge here. Questions relating to LuaVerge problems should go in the Verge Help boards.