Cheat Pages Navigator
1. Introduction 2. Adding Skills 3. Adding Creatures 4. Adding War Machines 5. Adding Spells 6. Adding Artifacts to Heroes 7. Hero Names Chart 8. Miscellaneous Modifications

Heroes and Might and Magic V: Cheat Commands

Since the game was released without traditional cheat codes, the following is achieved by manipulating the game's script. To my knowledge and fair amount of testing, the commands covered should work as intended.

It goes without saying that these are intended to be used by individuals in a single player environment as a means to explore the game's mechanics, fool around, have some fun, and help players that may be stuck or frustrated. They should not be used to gain an advantage in multiplayer environments, competitive or casual, unless all players are made aware and are in agreement. For the sake of fair play and in consideration of fellow players, please act honorably.

Note: for the reason of multiplayer honesty, version 1.2 of the game (and presumably beyond) has disabled all the codes that are NOT @ Commands (the @ Commands never worked in multiplayer, but always did for single player). As a result, unless your game version is pre-1.2, many of the cheats will no longer function. However, there is an @ equivalent for every code that no longer works.

Patching or upgrading the game usually rewrites the config files that enables cheating. You will have to reedit these files manually, as explained below.

Acknowledgements

Wrongusername for likely being the first to share some of this info.
Metathron for pointing out the error with the command add_army in my original document.

And of course Age of Heroes for hosting this!

Contents

  1. Introduction
    • Activating Ability to Cheat
    • The @ Commands
  2. Adding Skills
    • The simple way (disabled in 1.2)
    • The @ Variant: @GiveHeroSkill()
    • Skill Names / Numbers Chart
  3. Adding Creatures
    • Adding a complete army (disabled in 1.2)
    • The @ Variant: Adding Specific Creatures, Variable Amounts
    • Removing Specific Creatures
    • Creature Names / Numbers Chart
  4. Adding War Machines
    • Adding a specific War Machine
    • Removing War Machines
    • War Machines Names / Numbers Chart
  5. Adding Spells
    • Adding all spells at once (disabled in 1.2)
    • Adding Individual Spells to Heroes
    • Spell Names / Numbers Chart
  6. Adding Artifacts to Heroes
    • Adding a specific Artifact
    • Artifact Names / Numbers Chart
  7. Hero Names Chart
  8. Miscellaneous Modifications
    • Adding Experience (disabled in 1.2)
    • Changing Hero Stats
    • Clearing Resources (disabled in 1.2)
    • Adding Gold Only (disabled in 1.2)
    • Adding Gold and Resources (disabled in 1.2)
    • Adding Specific Gold and Resources
    • Seeing Movement Points
    • Revealing the Map
    • Instant Win and Lose

Activating Ability to Cheat

To enable the console in-game, you'll first have to edit 2 text files (open them with Notepad or some better text editor - not Word!). H5, HoF and ToE each have their own files, so make sure you edit the correct ones. Applying patches will most likely reset the input.cfg file, and you'll have to make sure the hotkey is still assigned.

Unlocking the console

The console requires a specific password to be unlocked. The file in which to add it depends on your game version (GAME_FOLDER is the game's installation folder):

Paste this as the last line, after the line mainmenu:

setvar dev_console_password = schwinge-des-todes

Assigning the console's hotkey

Now, you need to bind a specific key to open the console. Here, we suggest the upper left key (above Tab, left to 1, below Escape). It has the tilde ( ` ) symbol on english keyboards. It bears another symbol in other languages, but it doesn't matter: it is the key. Alternatively, you might prefer to use another (less confusing) key, like 'F12'. Just check that it isn't used for something else.

The file to edit this time is in My Documents/My Games:

Add this line in the "Common section" (in the beginning of the file):

bind show_console '`'

Again, this binds your upper left key to the console, whatever symbol it has on it.

Important: A common error when the console does not open is to edit the wrong input.cfg file: you should edit the one in your profile in "My Documents/...", NOT the one in "GAME_FOLDER/profiles/".

Note: While you're editing your input.cfg file, you may want to add this binding as well:

bind hide_interface 'CTRL' + 'I'

It allows to completely hide the interface by pressing Ctrl+I (press again to show it back). Useful to take beautiful screenshots (with the PrintScreen key).

The Commands

Until version 1.2 of the game, there used to be two types of commands:

The first, simple type of commands has been disabled in version 1.2 of the game to prevent multiplayer cheating. We kept them here for reference, if you're playing with an earlier version.

The second type of commands is the one used in the game lua scripts. They do not work in multiplayer, even in hotseat. They only work in single player mode, campaigns included.

Note that the commands have to be entered with the correct syntax, respecting lowercase and uppercase letters, parenthesis, quotes ('simple' ou "double" indifferently)... The semicolon (;) at the end of the line can be omitted, though.

When explaining each command, we will provide examples besides the generic code, and you may find it easier to understand the mechanics on examples. Note that the generic code will be written in italics, but of course, you don't have to input it in italics in Heroes 5 console...


Thanks to Curio for creating these pages!