Modding original game

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
minmay
Posts: 2770
Joined: Mon Sep 23, 2013 2:24 am

Re: Modding original game

Post by minmay »

Okay, since this isn't a secret anymore, I will explain in more detail. To modify the original dungeon, I extracted the dungeon.lua from grimrock2.dat and placed it a normal custom dungeon folder. After that you can simply load and save it in the editor as normal. The original dungeon.lua is compiled into LuaJIT bytecode, but the editor will save it as regular Lua source.
As you might have guessed from this, in both Grimrock 1 and 2 you can compile your mod's files with LuaJIT and they will still work. In Grimrock 1 this is more of a curiosity, but since Grimrock 2 allows script entities to execute external files you might be able to get meaningful performance improvements if you have complicated scripts.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
JKos
Posts: 464
Joined: Wed Sep 12, 2012 10:03 pm
Location: Finland
Contact:

Re: Modding original game

Post by JKos »

minmay wrote:Okay, since this isn't a secret anymore, I will explain in more detail. To modify the original dungeon, I extracted the dungeon.lua from grimrock2.dat and placed it a normal custom dungeon folder. After that you can simply load and save it in the editor as normal. The original dungeon.lua is compiled into LuaJIT bytecode, but the editor will save it as regular Lua source.
As you might have guessed from this, in both Grimrock 1 and 2 you can compile your mod's files with LuaJIT and they will still work. In Grimrock 1 this is more of a curiosity, but since Grimrock 2 allows script entities to execute external files you might be able to get meaningful performance improvements if you have complicated scripts.
So to devs: Can we release the original dungeons with our own additions? Is this ok for you?
- LoG Framework 2http://sites.google.com/site/jkoslog2 Define hooks in runtime by entity.name or entity.id + multiple hooks support.
- cloneObject viewtopic.php?f=22&t=8450
User avatar
Zo Kath Ra
Posts: 932
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Modding original game

Post by Zo Kath Ra »

Can you do this with mods?
User avatar
WaspUK1966
Posts: 135
Joined: Sat Aug 09, 2014 9:17 am

Re: Modding original game

Post by WaspUK1966 »

Just tried this. Will be able to get some good tips in layout and coding from looking at LOG2 in the editor. Really interesting.

Can you open LOG1 in its own editor as well? I've tried using the same method as for LOG2 but cannot find the path eg "assets/dungeons/grimrock" or "grimrock1" or "LOG" or "LOG1" doesn't work.

George
minmay
Posts: 2770
Joined: Mon Sep 23, 2013 2:24 am

Re: Modding original game

Post by minmay »

WaspUK1966 wrote:Can you open LOG1 in its own editor as well?
No.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Modding original game

Post by AndakRainor »

Is there a tool to decompile luaJit files ? In addition to the missing item "world_map", I found that the lindworm roof fight is totally missing from the original dungeon... I would need to see what is inside the Lindworm.lua from the grimrock2.dat file, as it is not the same as the lindworm.lua from the asset pack (So the lindworm is passive and unkillable if you simply use dungeonFolder "assets/dungeons/grimrock2").
CrEaToXx
Posts: 25
Joined: Thu Jan 19, 2017 9:58 pm

Re: Modding original game

Post by CrEaToXx »

I am very sorry for negroing this thread. But I have one or two questions...:)

1. Is base game modding allowed?
2. Are we capable of extracting the .dat file so that we could repack the org game to be modified?
3. If not, is there any other way to modifie the base game?

In particular I want to make new races playable in the base game. If this is not possible I might have to create my own realm from the scratch.
minmay
Posts: 2770
Joined: Mon Sep 23, 2013 2:24 am

Re: Modding original game

Post by minmay »

CrEaToXx wrote:1. Is base game modding allowed?
According to the modding terms, making changes to the original game files is forbidden. It's not like you could be criminally charged for it, but I expect such a mod would be likely to disappear from the forums/Nexus if you posted it.
CrEaToXx wrote:2. Are we capable of extracting the .dat file so that we could repack the org game to be modified?
Yes, but again, this is against both the modding terms and the EULA.
CrEaToXx wrote:3. If not, is there any other way to modifie the base game?
Yes, but I'm not telling how at the moment.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
CrEaToXx
Posts: 25
Joined: Thu Jan 19, 2017 9:58 pm

Re: Modding original game

Post by CrEaToXx »

*Scratches Head*

They did know we all were looking forward being capable to allow for making new races and other things like classes etc., and use them in the base game, and then they restrict the whole modding to only allow completely custom content? I don't get it. Way to hamper a thriving modding community... :roll: Now I understand why there isn't as much content for LoG2 as it was for LoG1.

This is surely disappointing. I wish they would allow for base game modding, or even better, release enough source material to simply allow for making new content for the base game. It could be easily done, you'd not need to redistribute the whole game at all. Just the dungeon.lua so we're allowed to get access to the base game.

Doesn't matter. Going to make my own world then. I just asked in case there was hope. Thanks for the clarification.
User avatar
AndakRainor
Posts: 674
Joined: Thu Nov 20, 2014 5:18 pm

Re: Modding original game

Post by AndakRainor »

I think you and minmay are not talking about the same thing. What you can do with Legend of Grimrock 2 is using the default campaign, Isle of Nex, as the base for your mod. It is exactly what I did with the mod "Magic of Grimrock".
Post Reply