Page 386 of 400
Re: Ask a simple question, get a simple answer
Posted: Wed Sep 14, 2022 5:36 am
by minmay
Instead of an obstacle, return false from the PartyComponent.onMove hook, this will immediately set the party to the idle state. The same trick works with PartyComponent:turn() and the onTurn hook.
Re: Ask a simple question, get a simple answer
Posted: Wed Sep 14, 2022 8:30 am
by Adrageron
minmay wrote: ↑Wed Sep 14, 2022 5:36 am
Instead of an obstacle, return false from the PartyComponent.onMove hook, this will immediately set the party to the idle state. The same trick works with PartyComponent:turn() and the onTurn hook.
Thank you, I will try this!
Re: Ask a simple question, get a simple answer
Posted: Wed Oct 19, 2022 5:03 pm
by Adrageron
Is there any
(not too complicated
) way to change health bar color for custom conditions?
Re: Ask a simple question, get a simple answer
Posted: Sun Oct 23, 2022 4:05 am
by minmay
That's indeed a complicated thing to do without umods. You'd need to draw the health bar with your own code, which would be easy enough to copy from the vanilla source code for it, but there are a few problems:
1. You can't draw it at the proper time: the blood splash when a champion gets hit should appear in front of the health bar, but onDrawAttackPanel (and any other onDraw hook) will draw things in front of the blood splash. There are probably other depth sorting issues too.
2. Accounting for the visual effect of healing potions will be a huge pain.
Would an overlay like the one used for the shield conditions (fire shield, shock shield, etc.) be appropriate for your condition? The code for that is a lot easier.
Re: Ask a simple question, get a simple answer
Posted: Sun Oct 23, 2022 7:43 am
by Adrageron
Thank you for reply, minmay! I had a faint hope that there was some hidden parameter in the condition declaration responsible for this. If we are talking about manual redrawing of the interface, I will not undertake it. I have a huge bunch of other tasks in "to do list"

Re: Ask a simple question, get a simple answer
Posted: Mon Oct 31, 2022 9:12 am
by Adrageron
Hi! Just encountered a new problem: the game crashes when you try to import a party with custom classes (to the same mod where the save file was created).
Code: Select all
[string "Champion.lua"]:0: invalid class: sharpshooter
stack traceback:
[C]: in function 'assert'
[string "Champion.lua"]: in function 'setClass'
[string "Champion.lua"]: in function 'loadState'
[string "GameMode.lua"]: in function 'loadChampions'
[string "NewGameMenu.lua"]: in function 'importChampions'
[string "SaveGameMenu.lua"]: in function 'select'
[string "SaveGameMenu.lua"]: in function 'update'
[string "GameMode.lua"]: in function 'update'
[string "Grimrock.lua"]: in function 'display'
[string "Grimrock.lua"]: in main chunk
I've checked this issue with Falagar mod (created a party there and tried to import it to the new Falagar run). And got the same crash, but for a custom race.
Is there a way to fix this?
Re: Ask a simple question, get a simple answer
Posted: Mon Oct 31, 2022 10:06 am
by minmay
There's nothing you can do in your custom dungeon to allow importing non-standard class/race names into it; that crash happens before your custom dungeon is even loaded, so you have no opportunity to run any code at all, not even your init.lua.
You can of course prevent your dungeon from creating new save files that have this issue, by only using the standard race and class names (they're never displayed to the player, only the uiName, so you don't need to change the names the player sees), but that only works if your dungeon uses 8 or fewer classes and 5 or fewer races.
Re: Ask a simple question, get a simple answer
Posted: Mon Oct 31, 2022 10:32 am
by Adrageron
Thank you for advice, minmay. I've used all standard names that I can, but there are 2 classes with undesired hardcoded mechanics - alcemist and farmer. Are there any means to disable their unique properties?
Re: Ask a simple question, get a simple answer
Posted: Tue Nov 01, 2022 10:06 am
by minmay
Not remotely conveniently; Alchemist's herb reproduction is tied to the defined names of the 6 standard herbs, but CraftPotionComponent also relies on those names, so just changing them won't work. And while you can kill Farmer's xp-from-food with onUseItem hooks on food, getting it to gain xp from monster kills is much harder.
It's probably not worth worrying about this bug at all. I'd imagine it's very rare for someone to want to import a party with custom classes in the first place, and if someone does want to, they can always just use the console to give a new party with the stats they want instead.
Re: Ask a simple question, get a simple answer
Posted: Tue Nov 01, 2022 10:42 am
by Adrageron
Thank you for the info, minmay! Less work for me then

Just to write a warning in the mod's description
