Merry Christmas!

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!
Zo Kath Ra
Posts: 891
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Merry Christmas!

Post by Zo Kath Ra » Mon Dec 28, 2020 1:34 pm

petri wrote:
Mon Dec 28, 2020 7:39 am
Note that config:convertEditorKeyToAction is called just before your addition, so you should be able to hook to Config.convertEditorKeyToAction instead of copying the whole update funtion.
Like this? (based on christmas2020.lua)

Code: Select all

local oldConvertEditorKeyToAction = Config.convertEditorKeyToAction

function Config:convertEditorKeyToAction(event_keyCode, event_modifiers)
	local action = oldConvertEditorKeyToAction(self, event_keyCode, event_modifiers)
	
	if event_keyCode == 89 and event_modifiers == 2 then
		sys.restart{ "launchEditor" }
	else
		return action
	end
end
Instead of hooking into Config:convertEditorKeyToAction(), could we hook into DungeonEditor:update() ?
Then we could compare event.key instead of event_keyCode.

Config:convertEditorKeyToAction() isn't defined in any of the umod files.

I know we shouldn't be greedy, because then Nuutti will punish us.
But if you want to give us Config.lua as a late Christmas present...
(we could add a key config entry for the console key, if the console is enabled in grimrock.cfg)

edit:
Now I understand the joke contained in "every character he types is doubled".
I'm slow :D

User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Merry Christmas!

Post by petri » Mon Dec 28, 2020 2:29 pm

Yep, the new version looks right to me, but I'll leave testing for you :)

Alternatively you could look into hooking into the menu bar, that way you wouldn't relaunch the editor if you hit the short cut accidentally.

You can of course hook into DungeonEditor:update, but how would you get the event? Update function does not receive any arguments...

User avatar
Eleven Warrior
Posts: 736
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Merry Christmas!

Post by Eleven Warrior » Thu Dec 31, 2020 10:17 am

Happy new year to everyone.

User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Merry Christmas!

Post by JohnWordsworth » Sat Jan 02, 2021 3:14 pm

Damn you @petri! I hadn't intended to spend the last couple of days modding, but I couldn't resist with thew new uMod support!

I've made a mod that adds "sockets" to Melee Weapons so that you can upgrade them. As I wanted something that is compatible with the main game, I made the mod add an upgrade gem to each chest in the game and added support for socketing gems to most "normal" weapons (not the uber magical ones, and not the most primitive ones) so that you can use it in the main game (and actually test it within 30 seconds of playing the game - using the bone club and the early secret chest).

I also made a few (very primitive) helper functions that allow you to unhook and re-hook the methods I hooked into from the main game so that I could reload my uMod through the console (or whenever you press "Ctrl-R" in the Dungeon Editor and reload the dungeon).

Will share the mod a bit later on, but here is a teaser for now!

Socketable Melee Weapons Preview
Last edited by JohnWordsworth on Sat Jan 02, 2021 4:48 pm, edited 1 time in total.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.

User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Merry Christmas!

Post by JohnWordsworth » Sat Jan 02, 2021 4:05 pm

Have uploaded an initial version of the mod to the "Custom Dungeons" board, as that seemed more appropriate than the "Modding" channel. Hopefully it will provide some inspiration (and possibly even fun) for anyone else who is interested in doing something similar / wants more example code!

Mod Thread
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.

User avatar
Skuggasveinn
Posts: 561
Joined: Wed Sep 26, 2012 5:28 pm

Re: Merry Christmas!

Post by Skuggasveinn » Sat Jan 02, 2021 9:03 pm

This is great John. I played it for a while today, tried to crash it but couldn't :D (socketing a weapon, then leave it in a puzzle like the statue that holds the sword, save, reload etc etc).

This opens up so many possibilities, got me thinking that this should be its own crafting path instead of using the standard crystals. New recipes only for weapon and armors runes that you can slot and so forth.

kind regards.
Skuggasveinn.
Link to all my LoG 2 assets on Nexus.
Link to all my LoG 1 assets on Nexus.

User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: Merry Christmas!

Post by JohnWordsworth » Sat Jan 02, 2021 9:41 pm

Hey @Skuggs! Heh - glad that you weren't able to crash it :p. I'm mostly just hooking into existing logic (container component) with a couple of lightweight 'controller components' on top to handle changing the weapon stats, so I felt like it was quite "safe", but I'm super glad that it didn't break immediately!

Yeah - I was considering a more fully-fledged crafting system, that would be pretty cool!
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.

Zo Kath Ra
Posts: 891
Joined: Sat Apr 21, 2012 9:57 am
Location: Germany

Re: Merry Christmas!

Post by Zo Kath Ra » Tue Jan 05, 2021 8:19 pm

I've always wondered why you can't load savegames in the Dungeon Editor.
There's probably a good reason for this.
If not, will umodding allow us to add this feature?

User avatar
7Soul
Posts: 180
Joined: Sun Oct 19, 2014 1:56 am
Location: Brazil

Re: Merry Christmas!

Post by 7Soul » Fri Jan 08, 2021 1:05 am

Has anyone figured out how to add files to a uMod? (ie textures)

Figured out: config.documentsFolder .. "/Mods" is how you access the mods folder
Last edited by 7Soul on Thu Jan 21, 2021 10:57 pm, edited 1 time in total.
Join the LoG discord server: https://discord.gg/ArgAgNN :D

My Mods

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

Re: Merry Christmas!

Post by Isaac » Thu Jan 21, 2021 10:48 pm

So... when does this Beta version become the official [and final?] updated version on all platforms?

Post Reply