Jump to content

Another PoE inspired option - disable inventory in combat


Recommended Posts

I have noticed the SCS options of rest requiring provisions and resting at inns granting buffs, and this gave me the idea of another PoE style option, lock inventory during combat. Which means only being able to use the items equipped in quick slots and only switching the equipped weapons.

I have tried to edit the ui.menu myself, there is a function that disables the inventory as following:

function shouldGreyOutInventory()
    return characters[id].HP.current <= 0 or inventoryScreen:IsSpriteOrderable() == false
end

However I have not been able to identify any method of adding an additional condition to detect there is a combat. The triggers CombatCount() or ActuallyInCombat() does not seem to work there. Do you have any idea if this can be done?

Link to comment
26 minutes ago, lynx said:

Or just do it the bg1 way and ensure the game is unpaused when the inventory is open.

That has the unfortunate consequence of being punished by muscle memory, though. And, more importantly, is it any more doable than disabling the button?

Could the inventory button itself be reconfigured?

EDIT - oh dude, I never realized there is this:

Quote

#144 (0x90) Button: Disable Button Variants: BG1 IWD1 IWD2
Parameter #1: Irrelevant
Parameter #2: Button

Description:
Disabled the button specified by the Button field. The resource field acts as a matching key to the resource field of the Enable Button, allowing separate enable/disable reasons.
Known values for Button are:
  • 0 ⟶ Stealth Button
  • 1 ⟶ Thieving Skill Button
  • 2 ⟶ Spell Select Button
  • 3 ⟶ First Quick Spell Button
  • 4 ⟶ Second Quick Spell Button
  • 5 ⟶ Third Quick Spell Button
  • 6 ⟶ Turn Undead Button
  • 7 ⟶ Talk Button
  • 8 ⟶ Use Item Button
  • 9 ⟶ First Quick Item Button
  • 10 ⟶ Bard Song Button (EE only)
  • 11 ⟶ Second Quick Item Button
  • 12 ⟶ Third Quick Item Button
  • 13 ⟶ Innate Ability Button
  • 14 ⟶ Find Traps Button
  • 15 ⟶ Inventory Button (EE only)

(Emphasis mine.) Could you just script in BALDUR.BCS a spell to be cast upon entering/exiting combat, which would use op144 to disable/reenable the inventory button? EE-only of course, but that's okay.

I love this idea. If DavidW decides not to, I will take a stab at it.

Edited by subtledoctor
Link to comment
14 hours ago, lynx said:

Or just do it the bg1 way and ensure the game is unpaused when the inventory is open.

This was already done by the classic BG GUI mod. Completely disabling the inventory is more restrictive.

13 hours ago, subtledoctor said:

That has the unfortunate consequence of being punished by muscle memory, though. And, more importantly, is it any more doable than disabling the button?

 

It is not necessary to disable the button, just grey out the inventory as it happens when a character becomes uncontrollable. The code already exists in ui.menu, just the condition needs to be updated.

10 minutes ago, RoyalProtector said:

Sorry, but... PoE?

Pillars of Eternity

Link to comment
2 hours ago, gunman said:

It is not necessary to disable the button, just grey out the inventory as it happens when a character becomes uncontrollable. The code already exists in ui.menu, just the condition needs to be updated.

You are assuming that stuff in UI.menu can be responsive to detectable conditions in-game. Which... well it may or may not be the case, I have no idea. But I am not optimistic. We went 20 years with a strong wall between things that can be done via spells and things that can be done via script. Now, the UI stuff is a third category, and I am not confident it can be integrated with the first two any more than they can be integrated with each other.

But scripts can detect various aspects of the game's state, and respond with scripted events or spells. So if the combat triggers work, it would be fairly simple to add a block to BALDUR.BCS applying a spell disabling the inventory button for PLAYER1-6 whenever they are in combat. Spells can, to a lesser degree, detect game conditions. (One way to do this would be a repeating spell on all party members that disables the inventory button for six seconds, every six seconds; and have a second repeating spell that blocks the first one, but has the "non-combat only" flag. This should be effective, but applying the spell to all party members would be way more fiddly.)

The only attempt I've seen at detecting game conditions and responding with a UI effect is yours - and if failed. So unless I hear otherwise, my assumption is this is simply cannot work.

Link to comment
1 hour ago, subtledoctor said:

The only attempt I've seen at detecting game conditions and responding with a UI effect is yours - and if failed. So unless I hear otherwise, my assumption is this is simply cannot work.

I think it's doable, actually, but it's slightly fiddly (requires script->UI communications, which is doable but delicate). I might see if I can rough something up if I have a chance.

Link to comment

This could be an interesting feature. But don't forget that the problem is that bg allow only 3 quick items slots. In comparison to modern crpg, baldur would suffer a lot to get a forbidden inventory access during fightings unless there is a way to get more quick items slots. 

Link to comment

I love this idea, of either disabling inventory in combat or (imho) better yet disabling pause in inventory. I remember how tense this made combat in the old games where quickslots actually mattered. Its more than a little cheesy that in less than a second Aerie can throw the invis pot to Keldorn, who throws it to Jan, who throws it directly into my stomach to save the day. Not to mention swapping all the protection items over to the character about to eat some oh no spell. 

Link to comment
On 3/23/2024 at 10:50 PM, DrAzTiK said:

This could be an interesting feature. But don't forget that the problem is that bg allow only 3 quick items slots. In comparison to modern crpg, baldur would suffer a lot to get a forbidden inventory access during fightings unless there is a way to get more quick items slots. 

this would be my biggest issue with it and probably end up being the only SCS component I wouldn't install -- if you've installed the 4-slots in every character you wouldn't even have access to some of your weapons. that said, that's why it's optional lol

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...