Using the lua console for testing

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Repton
Archmage
Posts: 371
Joined: Wed Aug 05, 2009 2:17 am

Using the lua console for testing

#1 Post 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?

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Using the lua console for testing

#2 Post by darkgod »

A new boss you can put in the respective file in game/modules/tome/data/general/npcs/. Add a

Code: Select all

define_as="TEST"
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.
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

Repton
Archmage
Posts: 371
Joined: Wed Aug 05, 2009 2:17 am

Re: Using the lua console for testing

#3 Post 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?

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Using the lua console for testing

#4 Post by yufra »

Repton wrote: - Can I teleport straight to a zone?
Use Game:changeLevel like this:

Code: Select all

game:changeLevel(1, "trollshaws")
- 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.
<DarkGod> lets say it's intended

edge2054
Retired Ninja
Posts: 3756
Joined: Fri May 28, 2010 4:38 pm

Re: Using the lua console for testing

#5 Post 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.

Post Reply