Hi everyone, I’m a longtime fan, going back to the original LoG1 release. I recently got my son hooked on the games, esp LOG2. He‘s 12 years old. He has a real passion for experimenting with the creative toolkits. One thing he especially loves is using the console to spawn things like ladders and magic bridges to access remote areas of the game. For example he figured out how to get to the barren dessert within minutes by spawning essences and keys and “hacking“ his way there.
He’s spending g HOURS during quarantine playing the game in unique ways (including many of your custom dungeons!) It’s pretty fun to watch a clever kid at work.
Anyway, he has some questions I can’t figure out the answers to. Help an eager mind out?
1. How can you use the console commands to delete objects in the game? Like remove a tree or a wall, etc. Is there a delete command?
2. Is there a list of other console commands he can run besides spawning items?
Questions on behalf on my 12 year old son
Re: Questions on behalf on my 12 year old son
You can use ever command of the Scripting Reverence in the console.
If you like, you can create a whole map via the console (I wouldn't recommend that).
If your son wants to delete an existing object of a map, he can use the :destroy() command. But to do that he has of course to know the unique ID of that object (not the name of that kind of object!). To know that is a bit more tricky.
BTW I wouldn't recommend to destoy objects of a game. You can never know if not this exact object is mentioned in a script and if it doesn't exist anymore the whole game crashes...
If you like, you can create a whole map via the console (I wouldn't recommend that).
If your son wants to delete an existing object of a map, he can use the :destroy() command. But to do that he has of course to know the unique ID of that object (not the name of that kind of object!). To know that is a bit more tricky.
BTW I wouldn't recommend to destoy objects of a game. You can never know if not this exact object is mentioned in a script and if it doesn't exist anymore the whole game crashes...
Re: Questions on behalf on my 12 year old son
Better than arbitrarily destroying objects, is to just move them aside.
Finding out the object's unique id usually requires iterating through all of the objects on the tile, or often an adjacent tile. Also, the id will be a number if it was spawned without an id string; such id's cannot be addressed directly.
To iterate through all objects on a tile, use this:
To iterate through all objects on the tile in front of the party, use this:
Accessing a numbered object requires using the findEntity() function.
Code: Select all
beach_boulder_1:setPosition(0,0,0,-7,1)
To iterate through all objects on a tile, use this:
Code: Select all
for object in party.map:entitiesAt(party.x, party.y) do print(object.name,object.id) end
Code: Select all
dX, dY = getForward(party.facing) for object in party.map:entitiesAt(dX+party.x, dY+party.y) do print(object.name, object.id) end
- eg. findEntity("28496"):setPosition(0,0,0,-7,1)
Code: Select all
object = findEntity("28496") if object then object:setPosition(0,0,0,-7,1) end object = nil
Last edited by Isaac on Mon Jul 20, 2020 10:51 pm, edited 4 times in total.
Re: Questions on behalf on my 12 year old son
You can always give him the editor file of the main campaign.
No need for console commands anymore, just add/remove stuff on the fly in the editor and press play / stop.
Who knows he will actually like it and make a mod of his own.
As for the campaign file, the game installs the files; you have them already. Make a new editor project. Call it what you like; or name it Grimrock2. Then open the project file in a text editor, and change the contents to this:
-- This file has been generated by Dungeon Editor 2.2.4
dungeonName "Grimrock 2"
author "Almost Human"
description "The official campaign"
dungeonFolder "assets/dungeons/grimrock2"
Then reload the project. You cannot save any changes to this project; it won't work.
No need for console commands anymore, just add/remove stuff on the fly in the editor and press play / stop.
Who knows he will actually like it and make a mod of his own.
As for the campaign file, the game installs the files; you have them already. Make a new editor project. Call it what you like; or name it Grimrock2. Then open the project file in a text editor, and change the contents to this:
-- This file has been generated by Dungeon Editor 2.2.4
dungeonName "Grimrock 2"
author "Almost Human"
description "The official campaign"
dungeonFolder "assets/dungeons/grimrock2"
Then reload the project. You cannot save any changes to this project; it won't work.
Re: Questions on behalf on my 12 year old son
Wow, thank you ALL for this very helpful information. My kid is overjoyed. "I love hacking games!" he said.
He is just starting to play with the maingame via the editor. What a unique way to learn.
Thank you everyone
He is just starting to play with the maingame via the editor. What a unique way to learn.
Thank you everyone