Page 4 of 5
Re: Merry Christmas!
Posted: Mon Dec 28, 2020 1:34 pm
by Zo Kath Ra
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

Re: Merry Christmas!
Posted: Mon Dec 28, 2020 2:29 pm
by petri
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...
Re: Merry Christmas!
Posted: Thu Dec 31, 2020 10:17 am
by Eleven Warrior
Happy new year to everyone.
Re: Merry Christmas!
Posted: Sat Jan 02, 2021 3:14 pm
by JohnWordsworth
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
Re: Merry Christmas!
Posted: Sat Jan 02, 2021 4:05 pm
by JohnWordsworth
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
Re: Merry Christmas!
Posted: Sat Jan 02, 2021 9:03 pm
by Skuggasveinn
This is great John. I played it for a while today, tried to crash it but couldn't

(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.
Re: Merry Christmas!
Posted: Sat Jan 02, 2021 9:41 pm
by JohnWordsworth
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!
Re: Merry Christmas!
Posted: Tue Jan 05, 2021 8:19 pm
by Zo Kath Ra
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?
Re: Merry Christmas!
Posted: Fri Jan 08, 2021 1:05 am
by 7Soul
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
Re: Merry Christmas!
Posted: Thu Jan 21, 2021 10:48 pm
by Isaac
So... when does this Beta version become the official [and final?] updated version on all platforms?