Welcome to our guide on the console commands for Legend of Grimrock 2. The console can be a useful tool in the game, but finding information on how to use it can be difficult. In this article, we will provide straightforward instructions on how to access and utilize the console commands in order to enhance your gaming experience.
Intro
To start out, you need to actually enable the console. Go into Documents, Almost Human, Legend of Grimrock 2, and open “grimrock.cfg” with a text editor. In that file, find the line “console = false” and change false to true. Then, ingame, you can open the console by pressing ~. If your keyboard doesn’t have that, change the number of the “consolekey” line in that file to something else. Look up “key numbers” for an explanation of them.
You can scroll the cursor back and forth with left and right, and go between previous commands with up and down. The console accepts pasted commands, so you can just copy them into it. Keep in mind, having the console open doesn’t pause the game.
Basic commands
spawn(“”,#,#,#,#,#,””)
Creates an item, object, or enemy. Fill the first quotes with the entity’s internal name, all else is optional. In order: Level, X and Y positions, facing, elevation, and custom ID. You can check internal names in the dungeon editor; they’re what’s in that list on the bottom left.
spawn(“”).item:setStackSize(#)
Create an item and set how many are in the stack of it. Use with unstackable items at your own risk.
setMouseItem(“”)
Spawn something by making it be held by the mouse. Have the brackets be empty to instead delete what’s being held with the mouse.
print(getMouseItem().go.name)
This’ll get you the internal name of whatever you’re holding with the mouse. Pretty handy for spawning modded items!
party:setPosition(#,#,#,#,#)
Sets your position. The numbers, in turn, reference desired X and Y position (1-32), facing direction (0-3), height (0+), and level (1-However many levels the dungeon has).
Values that don’t fit in those ranges will crash the game. And yes, the arguments are in a different order from the spawn command for some reason.
print(X:getPosition())
Gets the position of something. Items are almost always “item_name_#”, where item_name is the item’s internal name and # is a number. Use “party” to get your own coordinates. Don’t use “” here!
The coordinates given are in the same order as setPosition, though it skips one and I’m not sure which.
GameMode.setTimeOfDay(#)
Set the time of day, between 0 and 1.9999999999999. 0 is day, 1 is night.
Party commands
party.party:heal()
Fully restores all characters, as if you used a healing crystal
party.party:setMovementSpeed(#)
Sets movement speed. 1 is normal. Mods that include “Toorum mode” set this to 1.5
party.party:getChampion(#):
Used for commands relating to specific characters, replace # with the desired character’s inventory button.
party.party:getChampion(#):setName(“”)
Changes the corresponding character’s name
party.party:getChampion(#):setSex(“”)
Changes the corresponding character’s gender (male/female). Neither this nor the previous command have any built in effect, but mods may add functions to them.
party.party:getChampion(#):setRace(“”)
Changes the corresponding character’s race (human/minotaur/lizardman/ratling/insectoid)
party.party:getChampion(#):setPortrait(“”)
Changes the corresponding character’s portrait. Replace the blank with a filepath, though I’m not sure where it starts from.
party.party:getChampion(#):trainSkill(“”,#,bool)
Raises one of the corresponding character’s skill levels by X (Replace the blank with a skill’s name, maybe don’t raise any past 5). Bool can be true or false, and is whether it affects skill points, defaulting to true. This won’t bring points below 0, but it’ll still work without them.
party.party:getChampion(#):addTrait(“”)
Adds the specified trait to the character. Trait internal names are kinda hard to find, but are generally what you’d expect. Look up “grimrock 2 asset pack” to get the vanilla assets to look through for the weird ones.
party.party:getChampion(#):addSkillPoints(#)
Adds or removes skill points. This can bring them below 0.
party.party:getChampion(#):levelUp()
Selected character gains a level.
party.party:getChampion(#):setBaseStat(“”,#)
Changes one of the corresponding character’s stats to #. Replace the blank with the desired stat, the list of which will be detailed below the next command.
party.party:getChampion(#):upgradeBaseStat(“”,#)
Same as previous, but adds # to their current value instead of replacing it.
Stats that can be changed: health, max_health, energy, max_energy, strength, dexterity, vitality, willpower, protection, evasion, resist_X (X being the element), max_load, exp_rate, food_rate, health/energy_regeneration_rate, cooldown_rate
Simple scripts
[Universal pseudo-Toorum]
party.party:getChampion(1):upgradeBaseStat(“cooldown_rate”,100)
party.party:setMovementSpeed(1.5)
party.party:getChampion(1):setPortrait(“assets/textures/portraits/toorum.tga”)
For the proper experience, make only 1 character.
Changing the portrait is optional.
[Skill point to attributes]
party.party:getChampion(#):addSkillPoints(-1)
party.party:getChampion(#):upgradeBaseStat(“strength”,1)
party.party:getChampion(#):upgradeBaseStat(“dexterity”,1)
party.party:getChampion(#):upgradeBaseStat(“vitality”,1)
party.party:getChampion(#):upgradeBaseStat(“willpower”,1)
You may want to copy this into notepad and change the character number there.
[Teleport one tile forward]
local dx,dy = getForward(party.facing)
party:setPosition(party.x + dx, party.y + dy, party.facing, party.elevation, party.level)
And that wraps up our share on Legend of Grimrock 2: Console commands. If you have any additional insights or tips to contribute, don’t hesitate to drop a comment below. For a more in-depth read, you can refer to the original article here by lolboy4, who deserves all the credit. Happy gaming!