Difference between revisions of "Debugging"

From Tales of Maj'Eyal
Jump to: navigation, search
m (Typo fix in pathname)
(Debug menu: Table of the options. TODO: Check things in-game. What order are the addon/DLC options in-game?)
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Debugging: Figuring out what went wrong ==
+
Developer Mode (also known as "cheat") is a special game mode geared towards development of modules and addons for the game.
  
=== Updating your configuration ===
+
The easiest way to enable this mode is to select ''Developer Mode'' from the Options menu.
Enabling cheat/development mode will grant you access to the internal Lua console and some additional dialogs/options useful for debugging.  It will stop you from uploading characters online, though, but you can always turn this mode off.
+
  
<ul>
+
=Overview=
<li>Navigate to the corresponding configuration directory (replace HOME with your home directory).
+
Developer mode grants the user several privileges and disables others to prevent abuse.
 +
 
 +
Pros:
 +
* The ability to see hidden modules
 +
* Access to the internal Lua console
 +
* Additional debugging dialogs/options
 +
 
 +
Cons:
 +
* Disables uploading characters online
 +
* Invalidates game saves loaded while enabled, making them permanently ineligible for achievements.
 +
 
 +
=Config location=
 +
 
 +
Developer Mode is saved as a setting in <code>cheat.cfg</code> in one of the following directories based off your OS. Deleting this file will disable Developer Mode. If enabled, the value for the <code>cheat</code> key is either <code>true</code> or <code>false</code>.
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 14: Line 26:
 
| Mac OSX || HOME\Library\Application Support\T-Engine\4.0\settings ||
 
| Mac OSX || HOME\Library\Application Support\T-Engine\4.0\settings ||
 
|}
 
|}
</li>
 
<li>Create a file called ''cheat.cfg'' in that directory, and put the following text in that file.
 
<pre>
 
cheat = true
 
</pre>
 
<li>
 
To turn cheat/development mode off, just change ''true'' to ''false'' or delete the ''cheat.cfg'' file.
 
</li>
 
</ul>
 
  
=== Inside of ToME ===
+
=Game commands=
  
Enabling cheat mode gives you the following functions:
+
Enabling cheat mode gives you the following commands:
  
 
{| class="wikitable"
 
{| class="wikitable"
 
! Key Shortcut !! Result
 
! Key Shortcut !! Result
 
|-
 
|-
| Ctrl+L || Lua console  
+
| <kbd><kbd>Ctrl</kbd>+<kbd>L</kbd></kbd> || Lua console. Click on the console title bar or outside the window to exit.
 
|-
 
|-
| (not assigned by default) || Debug menu
+
| <kbd><kbd>Ctrl</kbd>+<kbd>A</kbd></kbd> || Debug menu
 
|-
 
|-
| Ctrl+S || Save the game  
+
| <kbd><kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>R</kbd></kbd> || Reboot the game and reload the last save
 
|-
 
|-
| Ctrl+Alt+Shift+R || Reload the last save
+
| <kbd><kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>N</kbd></kbd> || Reboot the game, delete the previous character, and start a new character with the same name{{verify}}
 
|-
 
|-
| Ctrl+G || Hit yourself for ~100 damage
+
| <kbd><kbd>Ctrl</kbd>+<kbd>P</kbd></kbd> || Display talent scaling chart, if pressed when mouse hovered over talent.
 +
|-
 +
| <kbd><kbd>Ctrl</kbd>+<kbd>D</kbd></kbd> || Prints information about the tile the player is standing on to the log?{{Verify}}
 +
|-
 +
| <kbd><kbd>Ctrl</kbd>+<kbd>G</kbd></kbd> || There are many dummied-out experiments here. The currently active one is:
 +
 
 +
Reloads the chat system, then tries to start a chat with an Imperium courrier. It appears the chat test is part of the upcoming expansion [[The Lost Land]].
 +
|-
 +
| <kbd><kbd>Ctrl</kbd>+<kbd>F</kbd></kbd> || There are some dummied-out experiments here. The currently active one is:
 +
 
 +
Summons a [[Krog]] NPC near the player.
 
|-
 
|-
 
! Mouse !! Result
 
! Mouse !! Result
 
|-
 
|-
| Ctrl-Left click || Teleport to the targeted square
+
| <kbd><kbd>Ctrl</kbd>+Left click</kbd> || Teleport to the targeted square
 +
|-
 +
| <kbd>Right click</kbd> || Right-clicking a tile offers several debug functions: if there's an actor on that tile, you can make it target the player, or you can look at its inventory. You can also open the Lua console to inspect the actor, terrain, trap, or projectile layers at that tile.
 +
 
 +
Right-clicking any effect icon allows you to cancel it. (Normally you could only cancel beneficial effects, minus a few exceptions.)
 +
|-
 +
| <kbd><kbd>Shift</kbd>+Left click</kbd> || Click on any effect icon to increase the effect's duration by 1 turn. (Minimalist UI only.)
 +
|-
 +
| <kbd><kbd>Shift</kbd>+Right click</kbd> || Click on any effect icon to decrease the effect's duration by 1 turn. (Minimalist UI only.)
 +
|-
 +
| <kbd><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+Right click</kbd> || Instantly kill the targeted creature. This does work on yourself.
 +
|-
 +
| <kbd><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Alt</kbd>+Right click</kbd> || Use once to target a creature, then use again to move it to the targeted location.
 
|-
 
|-
| Right click || Right-clicking a monster offers several debug functions, such as the ability to inspect inventory.
+
!Menu!! Result
 
|-
 
|-
| Shift-Ctrl-Right click || Instantly kill the targeted creature.  This does work on yourself.
+
| Reboot || Reboots the game, starting at the main menu.{{Verify}}
 
|}
 
|}
  
=== Debug menu ===
+
Of these commands, only the "Show Lua console" and "Debug Mode" (debug menu) key bindings can be rebound, and they can only be rebound while Developer Mode is enabled.
 +
 
 +
You can also, when using an item in the inventory, open the Lua console to inspect it.
 +
 
 +
=Debug menu=
  
 
Debug menu (aka debug mode) offers a menu with various options like changing zones, creating items, altering quests, etc.  All of this can also be done via the Lua console, but the debug menu is much easier to use.
 
Debug menu (aka debug mode) offers a menu with various options like changing zones, creating items, altering quests, etc.  All of this can also be done via the Lua console, but the debug menu is much easier to use.
  
The keybinding for debug mode may not be assigned by default. Press Esc and go under Key Bindings to assign it.
+
The keybinding for debug mode is assigned to <kbd><kbd>Ctrl</kbd>+<kbd>A</kbd></kbd> by default. You can press Esc and go under Key Bindings if you want to reassign it.
  
=== Lua console ===
+
{| class="wikitable"
 +
! Option !! Description and Notes
 +
|-
 +
| Change Zone || Lets you choose any zone in the game from a list and move to there.
 +
|-
 +
| Change Level || Lets you move to any level in the current zone (by number).
 +
|-
 +
| Reveal all map || Lights the whole map and marks it as has-been-seen. Reveals and identifies all traps on the map.
 +
 
 +
Grants the player 200-range ''Sensing Everything'' for 100 turns, which is like {{t|Track}} but shows objects and traps as well as actors, and ignores things that block Track (e.g. [[vault]]s).
 +
|-
 +
| Toggle Demi-Godmode || Demi-Godmode gives you 10000 additional life and 2000 life regen per turn. You deal +500% damage, and have full ESP. You can ignore special requirements for [[prodigies]].
 +
|-
 +
| Toggle Godmode || Godmode makes you invulnerable to damage and immune to bad status effects. You deal +10000% damage (100% penetration), do not need to breathe, and have full ESP. You can ignore special requirements for [[prodigies]].
 +
|-
 +
| Alter Faction || Lets you choose any [[faction]] in the game from a list, and make it friendly, neutral, or hostile to the player's faction.
 +
|-
 +
| Summon a Creature || Lets you choose an actor from a list and summon it. This can be aimed like a talent.{{verify}}
 +
 
 +
The list includes Test Dummy and Random Actor choices. Below those choices, all the NPCs loaded in the current zone are available.
 +
 
 +
The Random Actor choice will open a further dialog, which has many options that can be used for filtering, etc.
 +
|-
 +
| Create Items || Has many options for creating items, and can put them in various places.
 +
 
 +
It has the option to load items from other zones.
 +
|-
 +
| Create a Trap || Lets you choose a trap from a list and place it. This can be aimed like a talent.{{verify}}
 +
 
 +
All traps loaded in the current zone are available.
 +
|-
 +
| Grant/Alter Quests || Lets you choose any quest in the game from a list. Removes the chosen quest and then grants it again.
 +
 
 +
Despite the name, does not seem to provide any other way to alter quests.{{verify}}
 +
|-
 +
| Advance Player || Gives various options to level up the player, increase stats, learn talents, gain points, etc.
 +
|-
 +
| Remove or Kill all creatures || This affects all entities on the map, except actors in the player's party.
 +
 
 +
Choose either to remove them all from the map, or kill them all. If killed, they count as killed by the player, and grant experience and drop loot.
 +
 
 +
You can click out of the window, or press <kbd>Esc</kbd>, to cancel.{{verify}}
 +
|-
 +
| Give Sher'tul fortress energy || Start the quest [[Sher'Tul Fortress]] if you haven't already. Gain 1000 fortress energy.
 +
|-
 +
| Give all ingredients || Gives the player 100 of each ingredient (for the [[Brotherhood of Alchemists]] quest and [[Tinker]] crafting), and 1 of each randomly-generated non-unique [[gem]].
 +
|-
 +
| Weakdamage || Toggles a permanent effect that cancels out all your "+X% all damage" and gives you "-90% all damage".
 +
|-
 +
| Spawn Event || Lets you choose any event in the game and spawn it on the current level.
 +
 
 +
(These are events such as a whistling vortex or a Naga invasion portal, not [[Online Event]]s.)
 +
|-
 +
| Endgamify || Prepares your character for the endgame:
 +
 
 +
* Gives you 2 generic points (as if you did [[The agent of the arena]])
 +
* Teaches you {{t|Relentless Pursuit}}
 +
* Levels you up to level 50
 +
* Gives you 999999 gold
 +
* Gives you a number of Tier 5 rare and randart items, of types that should be useful for your class (or all the types if your class is unrecognized)
 +
* Gives you a bunch of fixed artifacts that players usually get
 +
* Sets you as having gone to the East
 +
* Sets you as having saved the merchant in the [[Trapped!]] quest
 +
* Starts and immediately completes 5 random [[escort]] quests
 +
 
 +
Can only be used once per character.
 +
|-
 +
| Reload/regenerate Zone and level || '''Warning:''' If used on an [[Online Event]] zone, destroys the zone but has an error when trying to recreate it, leaving you in a void. (You can leave using the Change Zone option.)
 +
|-
 +
| Automatically Clear Zones || A tool for simulating the results of clearing zones.
 +
 
 +
Lets you enter a comma delimited list of zones or zone tiers to clear.
 +
 
 +
In the zones being cleared, on each level, it kills all the enemies, then picks up all the items. (You get all the experience and items.)
 +
 
 +
At the end, it shows a breakdown of where all the experience came from, it completes escort quests equal to the number from the cleared levels, and it drops unimportant items on the ground below you.
 +
|-
 +
| Addon Developer || Added by the official addon [[ToME Addon's Development Tools]].
 +
|-
 +
| Translation Tool || Added by the official addon [[ToME Addon's Development Tools]].
 +
|-
 +
| Remote Designer (EXPERIMENTAL) || Added by the official addon [[ToME Remote Designer]].
 +
|-
 +
| Learn all [[Tinkers | schematics]] || Added by the [[Embers of Rage]] expansion.
 +
|}
 +
 
 +
There is also code for an unused option that would spawn one of every trap in the game on the tiles around the player (revealed), and print their names and rarity to the log.
 +
 
 +
=Lua console =
  
 
Summary of features:
 
Summary of features:
Line 64: Line 181:
 
* Copy and paste with system clipboard
 
* Copy and paste with system clipboard
  
The Lua console drops you into the global namespace and gives you access to [[t4modules engine structure|the engine]].  If you want to inspect values, start the line with an equal sign.  For example, say you want to inspect the player:
+
The Lua console drops you into the global namespace and gives you access to [[T4_Modules_Howto_Guide/Engine_Structure|the engine]].  If you want to inspect values, start the line with an equal sign.  For example, say you want to inspect the player:
  
<code>
+
<code>=game.player</code>
=game.player
+
</code>
+
  
The console has cursor positioning so you can use the Left and Right arrows, as well as Home and End to move to the beginning and end of the current line, respectively.  You can paste the clipboard's contents to the cursor position with Ctrl+V (note, not Apple+V on Mac).  The current line can be copied to the clipboard with Ctrl+C (again, not Apple+C).
+
The console has cursor positioning so you can use the Left and Right arrows, as well as Home and End to move to the beginning and end of the current line, respectively.  You can paste the clipboard's contents to the cursor position with <kbd>Ctrl</kbd>+<kbd>V</kbd> (note, not <kbd>CMD</kbd>+<kbd>V</kbd> on Mac).  The current line can be copied to the clipboard with <kbd>Ctrl</kbd>+<kbd>C</kbd> (again, not <kbd>CMD</kbd>+<kbd>C</kbd> on Mac).
  
 
Here are some useful commands to know.
 
Here are some useful commands to know.
Line 197: Line 312:
  
  
 +
;Change another actor's physical resistance to 50
 +
<ol>
 +
<li>Right-click then Lua inspect [Actor] to get their actor ID</li>
 +
<li><code>
 +
__uids[ActorID here].resists.PHYSICAL=50
 +
</code></li>
 +
</ol>
  
=== Lua code ===
+
 
 +
=Lua code=
  
 
To output values into the log file you can use 2 different functions:
 
To output values into the log file you can use 2 different functions:
  
 
;Print any text
 
;Print any text
<code>
+
<code>print("your message")</code>
print("yourmessage")
+
</code>
+
  
  
 
;Display the content of an object. This lists all variables contained in the object foo.
 
;Display the content of an object. This lists all variables contained in the object foo.
<code>
+
<code>table.print(foo)</code>
table.print(foo)
+
</code>
+
  
== Output log text to file immediately (only needed on Windows) ==
+
=Output log text to file immediately (only needed on Windows)=
  
 
Without this, you have to close the game for the log file to be updated!
 
Without this, you have to close the game for the log file to be updated!
  
 
Instructions:
 
Instructions:
 +
* Create a shortcut to t-engine.exe.
 +
* Right-click the shortcut and select Properties.
 +
* Add the command to the end of the "Target" line: <code>--flush-stdout</code>
  
<ol>
+
The end of the Target line should look like this then: <code>\t-engine.exe --flush-stdout</code>
<li>Create a shortcut to t-engine.exe.</li>
+
<li>Right-click the shortcut and select Properties.</li>
+
<li>Add the command to the end of the "Target" line:
+
<code>
+
--flush-stdout
+
</code>
+
</li>
+
</ol>
+
 
+
The end of the Target line should look like this then: <pre>\t-engine.exe --flush-stdout</pre>
+
  
 
This can be used in combination with a [http://en.wikipedia.org/wiki/Tail_(Unix) tail] program that shows the content of the log file in realtime.
 
This can be used in combination with a [http://en.wikipedia.org/wiki/Tail_(Unix) tail] program that shows the content of the log file in realtime.
  
== Load module and create character on startup ==
+
=Load module and create character on startup=
  
 
You can create a character once then use the premade from the command line:
 
You can create a character once then use the premade from the command line:
  
<pre>
+
<code>t-engine -Mtome -n -E"auto_quickbirth='player'"</code>
t-engine -Mtome -n -E"auto_quickbirth='player'"
+
</pre>
+
  
if your premade was named "player."  (Or create a shortcut in Windows, similarly to the instructions above for outputting log text to a file.)
+
If your premade was named "player."  (Or create a shortcut in Windows, similarly to the instructions above for outputting log text to a file.)

Latest revision as of 18:22, 10 May 2022

Developer Mode (also known as "cheat") is a special game mode geared towards development of modules and addons for the game.

The easiest way to enable this mode is to select Developer Mode from the Options menu.

Overview

Developer mode grants the user several privileges and disables others to prevent abuse.

Pros:

  • The ability to see hidden modules
  • Access to the internal Lua console
  • Additional debugging dialogs/options

Cons:

  • Disables uploading characters online
  • Invalidates game saves loaded while enabled, making them permanently ineligible for achievements.

Config location

Developer Mode is saved as a setting in cheat.cfg in one of the following directories based off your OS. Deleting this file will disable Developer Mode. If enabled, the value for the cheat key is either true or false.

Windows HOME\T-Engine\4.0\settings For example C:\Users\USERNAME\T-Engine\4.0\settings
Linux HOME/.t-engine/4.0/settings
Mac OSX HOME\Library\Application Support\T-Engine\4.0\settings

Game commands

Enabling cheat mode gives you the following commands:

Key Shortcut Result
Ctrl+L Lua console. Click on the console title bar or outside the window to exit.
Ctrl+A Debug menu
Ctrl+Alt+Shift+R Reboot the game and reload the last save
Ctrl+Alt+Shift+N Reboot the game, delete the previous character, and start a new character with the same name

Needs verification

Ctrl+P Display talent scaling chart, if pressed when mouse hovered over talent.
Ctrl+D Prints information about the tile the player is standing on to the log?

Needs verification

Ctrl+G There are many dummied-out experiments here. The currently active one is:

Reloads the chat system, then tries to start a chat with an Imperium courrier. It appears the chat test is part of the upcoming expansion The Lost Land.

Ctrl+F There are some dummied-out experiments here. The currently active one is:

Summons a Krog NPC near the player.

Mouse Result
Ctrl+Left click Teleport to the targeted square
Right click Right-clicking a tile offers several debug functions: if there's an actor on that tile, you can make it target the player, or you can look at its inventory. You can also open the Lua console to inspect the actor, terrain, trap, or projectile layers at that tile.

Right-clicking any effect icon allows you to cancel it. (Normally you could only cancel beneficial effects, minus a few exceptions.)

Shift+Left click Click on any effect icon to increase the effect's duration by 1 turn. (Minimalist UI only.)
Shift+Right click Click on any effect icon to decrease the effect's duration by 1 turn. (Minimalist UI only.)
Ctrl+Shift+Right click Instantly kill the targeted creature. This does work on yourself.
Ctrl+Shift+Alt+Right click Use once to target a creature, then use again to move it to the targeted location.
Menu Result
Reboot Reboots the game, starting at the main menu.

Needs verification

Of these commands, only the "Show Lua console" and "Debug Mode" (debug menu) key bindings can be rebound, and they can only be rebound while Developer Mode is enabled.

You can also, when using an item in the inventory, open the Lua console to inspect it.

Debug menu

Debug menu (aka debug mode) offers a menu with various options like changing zones, creating items, altering quests, etc. All of this can also be done via the Lua console, but the debug menu is much easier to use.

The keybinding for debug mode is assigned to Ctrl+A by default. You can press Esc and go under Key Bindings if you want to reassign it.

Option Description and Notes
Change Zone Lets you choose any zone in the game from a list and move to there.
Change Level Lets you move to any level in the current zone (by number).
Reveal all map Lights the whole map and marks it as has-been-seen. Reveals and identifies all traps on the map.

Grants the player 200-range Sensing Everything for 100 turns, which is like Track but shows objects and traps as well as actors, and ignores things that block Track (e.g. vaults).

Toggle Demi-Godmode Demi-Godmode gives you 10000 additional life and 2000 life regen per turn. You deal +500% damage, and have full ESP. You can ignore special requirements for prodigies.
Toggle Godmode Godmode makes you invulnerable to damage and immune to bad status effects. You deal +10000% damage (100% penetration), do not need to breathe, and have full ESP. You can ignore special requirements for prodigies.
Alter Faction Lets you choose any faction in the game from a list, and make it friendly, neutral, or hostile to the player's faction.
Summon a Creature Lets you choose an actor from a list and summon it. This can be aimed like a talent.

Needs verification

The list includes Test Dummy and Random Actor choices. Below those choices, all the NPCs loaded in the current zone are available.

The Random Actor choice will open a further dialog, which has many options that can be used for filtering, etc.

Create Items Has many options for creating items, and can put them in various places.

It has the option to load items from other zones.

Create a Trap Lets you choose a trap from a list and place it. This can be aimed like a talent.

Needs verification

All traps loaded in the current zone are available.

Grant/Alter Quests Lets you choose any quest in the game from a list. Removes the chosen quest and then grants it again.

Despite the name, does not seem to provide any other way to alter quests. Needs verification

Advance Player Gives various options to level up the player, increase stats, learn talents, gain points, etc.
Remove or Kill all creatures This affects all entities on the map, except actors in the player's party.

Choose either to remove them all from the map, or kill them all. If killed, they count as killed by the player, and grant experience and drop loot.

You can click out of the window, or press Esc, to cancel. Needs verification

Give Sher'tul fortress energy Start the quest Sher'Tul Fortress if you haven't already. Gain 1000 fortress energy.
Give all ingredients Gives the player 100 of each ingredient (for the Brotherhood of Alchemists quest and Tinker crafting), and 1 of each randomly-generated non-unique gem.
Weakdamage Toggles a permanent effect that cancels out all your "+X% all damage" and gives you "-90% all damage".
Spawn Event Lets you choose any event in the game and spawn it on the current level.

(These are events such as a whistling vortex or a Naga invasion portal, not Online Events.)

Endgamify Prepares your character for the endgame:
  • Gives you 2 generic points (as if you did The agent of the arena)
  • Teaches you Relentless Pursuit
  • Levels you up to level 50
  • Gives you 999999 gold
  • Gives you a number of Tier 5 rare and randart items, of types that should be useful for your class (or all the types if your class is unrecognized)
  • Gives you a bunch of fixed artifacts that players usually get
  • Sets you as having gone to the East
  • Sets you as having saved the merchant in the Trapped! quest
  • Starts and immediately completes 5 random escort quests

Can only be used once per character.

Reload/regenerate Zone and level Warning: If used on an Online Event zone, destroys the zone but has an error when trying to recreate it, leaving you in a void. (You can leave using the Change Zone option.)
Automatically Clear Zones A tool for simulating the results of clearing zones.

Lets you enter a comma delimited list of zones or zone tiers to clear.

In the zones being cleared, on each level, it kills all the enemies, then picks up all the items. (You get all the experience and items.)

At the end, it shows a breakdown of where all the experience came from, it completes escort quests equal to the number from the cleared levels, and it drops unimportant items on the ground below you.

Addon Developer Added by the official addon ToME Addon's Development Tools.
Translation Tool Added by the official addon ToME Addon's Development Tools.
Remote Designer (EXPERIMENTAL) Added by the official addon ToME Remote Designer.
Learn all schematics Added by the Embers of Rage expansion.

There is also code for an unused option that would spawn one of every trap in the game on the tiles around the player (revealed), and print their names and rarity to the log.

Lua console

Summary of features:

  • Inspect values and execute code
  • Cursor positioning
  • Tab auto-completion
  • Copy and paste with system clipboard

The Lua console drops you into the global namespace and gives you access to the engine. If you want to inspect values, start the line with an equal sign. For example, say you want to inspect the player:

=game.player

The console has cursor positioning so you can use the Left and Right arrows, as well as Home and End to move to the beginning and end of the current line, respectively. You can paste the clipboard's contents to the cursor position with Ctrl+V (note, not CMD+V on Mac). The current line can be copied to the clipboard with Ctrl+C (again, not CMD+C on Mac).

Here are some useful commands to know.


Level up to level 50

game.player:forceLevelup(50)


Remove godmode invulnerability

game.player.invulnerable=0


Change your damage bonus

game.player.inc_damage.all=


Change your resistance

game.player.resists.all=


Learn a new talent (1 level in Slash in the example)

game.player:learnTalent(game.player.T_SLASH, true, 1)


Learn a new talent type (wild-gift/harmony in the example)

game.player:learnTalentType("wild-gift/harmony", true)


Change category mastery

game.player:setTalentTypeMastery("cunning/survival", 1.5)


Change base stat - up to 100 max (reduce strength by 20 in the example)

game.player:incStat("str", -20)


Change stat bonus (set Cunning bonus to 50 in the example)

game.player.inc_stats[game.player.STAT_CUN] = 50


Apply an effect on the player (frozen for 10 turns)

game.player:setEffect(game.player.EFF_FROZEN, 10, {})


Change your max HP

game.player.max_life=1 game.player:resetToFull()


Teleport (to the Assassin Lord)

game:changeLevel(2,"thieves-tunnels")


Add 5000 gold

game.player:incMoney(5000)


Give yourself 10 unassigned class skills

game.player.unused_talents=10


Give yourself 10 unused stat points

game.player.unused_stats=10


Give yourself an extra stat point each level (default=3)

game.player.stats_per_level=4


Give yourself 10 unused generic points

game.player.unused_generics=10


Give yourself 10 unused prodigies points

game.player.unused_prodigies=10


Give yourself 10 unused category points

game.player.unused_talents_types=10


Give yourself 10 lives

game.player.easy_mode_lifes=10


Change another actor's physical resistance to 50
  1. Right-click then Lua inspect [Actor] to get their actor ID
  2. __uids[ActorID here].resists.PHYSICAL=50


Lua code

To output values into the log file you can use 2 different functions:

Print any text

print("your message")


Display the content of an object. This lists all variables contained in the object foo.

table.print(foo)

Output log text to file immediately (only needed on Windows)

Without this, you have to close the game for the log file to be updated!

Instructions:

  • Create a shortcut to t-engine.exe.
  • Right-click the shortcut and select Properties.
  • Add the command to the end of the "Target" line: --flush-stdout

The end of the Target line should look like this then: \t-engine.exe --flush-stdout

This can be used in combination with a tail program that shows the content of the log file in realtime.

Load module and create character on startup

You can create a character once then use the premade from the command line:

t-engine -Mtome -n -E"auto_quickbirth='player'"

If your premade was named "player." (Or create a shortcut in Windows, similarly to the instructions above for outputting log text to a file.)