Questions on behalf on my 12 year old son

Are you looking for fun Custom Dungeons that you could play or do you want to share your mod with others? Then this forum is for you!
Post Reply
jwdenzel
Posts: 15
Joined: Wed Mar 28, 2012 12:38 am

Questions on behalf on my 12 year old son

Post by jwdenzel » Sun Jul 19, 2020 9:38 pm

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?

User avatar
THOM
Posts: 1181
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Questions on behalf on my 12 year old son

Post by THOM » Sun Jul 19, 2020 10:45 pm

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...
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download

User avatar
Isaac
Posts: 3005
Joined: Fri Mar 02, 2012 10:02 pm

Re: Questions on behalf on my 12 year old son

Post by Isaac » Mon Jul 20, 2020 11:09 am

Better than arbitrarily destroying objects, is to just move them aside.

Code: Select all

beach_boulder_1:setPosition(0,0,0,-7,1)
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:

Code: Select all

for object in party.map:entitiesAt(party.x, party.y) do print(object.name,object.id) end
To iterate through all objects on the tile in front of the party, use this:

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
Accessing a numbered object requires using the findEntity() function.
  • eg. findEntity("28496"):setPosition(0,0,0,-7,1)
*This will cause an error if the object doesn't exist, so the better way is this:

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.

Pompidom
Posts: 486
Joined: Sun May 06, 2018 9:42 pm

Re: Questions on behalf on my 12 year old son

Post by Pompidom » Mon Jul 20, 2020 1:04 pm

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.

jwdenzel
Posts: 15
Joined: Wed Mar 28, 2012 12:38 am

Re: Questions on behalf on my 12 year old son

Post by jwdenzel » Sun Jul 26, 2020 8:09 pm

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

Post Reply