Heroes of Hammerwatch II

Heroes of Hammerwatch II

Heroes of Hammerwatch II Workshop
Here you can find translations for Heroes of Hammerwatch II created by the community.
Learn More
1 life HC modding
I was thinking that it could be very cool to make a mod where after death the character gets deleted automatically or preventing respawns or something in that nature...
gemini says i should look in the unpacked_assets for something like this:

<int name="respawn_count">3</int>
<int name="base_lives">3</int>
<bool name="can_resurrect">true</bool>

I am kinda new to modding and have only changed a swords damage anybody knows exactly how I can achieve this 1 life only game difficulty?

I have unpacked the game files and so on but I am not sure what to change and which file to look for
< >
Showing 1-4 of 4 comments
Gonna redirect this thread to the workshop section.

There's absolutely a way of doing this, though it would require a bit of angelscript programming. In the deadmenu.as, instead of reviving and spawning the player, then transitioning back to town, I believe you could delete the character similarly to how a character can be deleted in the character selection.

I'm not home ATM for giving code examples, but I think I could whip this concept up pretty quickly
I got a concept working. In scripts/GUI/MissionEndMenu.as, I created this new function that does some lines of code that honestly is kinda whack but seemingly works..? The function is called destroyPlayer(), so in line 715 of MissionEndMenu.as I added

destroyPlayer();

and also in line 735 inside of the void OnClose() overide I added the same line.

then below OnClose() I wrote my new destroyPlayer() function.
void destroyPlayer() { auto plr = GetLocalPlayerRecord(); uint m_deletingCharKey = plr.uniqueKey; @plr = null; auto gm = cast<BaseGameMode>(g_gameMode); if (gm !is null) gm.m_windowManager.AddWindowObject(PickCharacterWindow(gm.m_guiBuilder)); if (m_deletingCharKey != 0) { PersistentSaves::SetCharacter(m_deletingCharKey, null, ""); } }

There's some weird stuff about it. You're thrown into the character selection menu and the character still exist in memory, but doesn't load. It will properly disappear when re-opening the menu.

my edited file
https://pastebin.com/vi1Uu0km
it's a concept. I've only done the functionality, but there would be more things needed. I had decided on going in the MissionEndMenu because you could add an if check for MissionManager::MissionState::Failed or aborted. There's also some jank and things to try out to clean up the visuals. Also, it's overwriting a script file which means if the game ever updates the file the mod would have to be updated.

gl
Last edited by Muffinslop; 4 Jun @ 2:14pm
Originally posted by Muffinslop:
I got a concept working. In scripts/GUI/MissionEndMenu.as, I created this new function that does some lines of code that honestly is kinda whack but seemingly works..? The function is called destroyPlayer(), so in line 715 of MissionEndMenu.as I added

destroyPlayer();

and also in line 735 inside of the void OnClose() overide I added the same line.

then below OnClose() I wrote my new destroyPlayer() function.
void destroyPlayer() { auto plr = GetLocalPlayerRecord(); uint m_deletingCharKey = plr.uniqueKey; @plr = null; auto gm = cast<BaseGameMode>(g_gameMode); if (gm !is null) gm.m_windowManager.AddWindowObject(PickCharacterWindow(gm.m_guiBuilder)); if (m_deletingCharKey != 0) { PersistentSaves::SetCharacter(m_deletingCharKey, null, ""); } }

There's some weird stuff about it. You're thrown into the character selection menu and the character still exist in memory, but doesn't load. It will properly disappear when re-opening the menu.

my edited file
https://pastebin.com/vi1Uu0km

thanks man!
< >
Showing 1-4 of 4 comments
Per page: 1530 50