Page 1 of 1
Using the lua console for testing
Posted: Tue Nov 09, 2010 4:19 am
by Repton
Let's say I come up with a
new vault or
new boss. Can I use the lua console to conveniently test it?
Re: Using the lua console for testing
Posted: Tue Nov 09, 2010 1:22 pm
by darkgod
A new boss you can put in the respective file in game/modules/tome/data/general/npcs/. Add a
field to it
and then in game/modules/tome/class/Game.lua look for the binding of ctrl+g and change it to:
Code: Select all
[{"_g","ctrl"}] = function()
local m = game.zone:makeEntityByName(game.level, "actor", "TEST")
game.zone:addEntity(game.level, m, "actor", game.player.x, game.player.y+1)
end,
Now pressing ctrl+g ingame will summon it beneath you.
As for vaults, it's kinda harder, you must change a zone definition to niclude the vault.
Then go to that zone, in the console you can type:
game.player:magicMap(100) to light up the level, vaults will be obvious since they do not map.
Re: Using the lua console for testing
Posted: Tue Nov 09, 2010 9:33 pm
by Repton
Thanks; I'll play around with that. Two more questions:
- Can I teleport straight to a zone?
- Is there a god mode, or else can I use the console to level myself up?
Re: Using the lua console for testing
Posted: Tue Nov 09, 2010 10:00 pm
by yufra
Repton wrote:
- Can I teleport straight to a zone?
Use Game:changeLevel like this:
- Is there a god mode, or else can I use the console to level myself up?
Look at the [{"_d","ctrl"}] code in Game.lua for something closely resembling god mode.
Re: Using the lua console for testing
Posted: Tue Nov 09, 2010 10:46 pm
by edge2054
Also...
game.player:forceLevelup(20)
That'll make you level 20.
Change the number and you get whatever level you need. cntrl+d portals you to the east, levels you to 50, makes you invincible, and ups your damage by 10,000%. Good for some sorts of testing, not so great for others.