Skip to content

(BG1) Game crashes when paperdoll-equipping unsupported item type

BhryaenBhryaen Member Posts: 2,874
edited August 2012 in Fixed
This thread derives from @Avenger_teambg's former public Bugs thread which read:

Item types could be externalized (this would be a feature request of its own merit), but until that, they shouldn't at least crash.

Problem: when you auto equip (drop the item on the paper doll) an item with unsupported item type, there will be a crash.

(Minimal) Solution: proper bounds check (or just remove the assertion, i forgot which), so it won't break the game.

(Preferred) Solution: externalize the item type/inventory slot relation with a simple 2da (further info on what I mean: http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=blob;f=gemrb/docs/en/Tables/itemtype.txt;h=d13e75a6bd1429a9acc51eaa4a4a074291ee6f50;hb=HEAD)

And an example: http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=blob;f=gemrb/override/bg2/itemtype.2da;h=21114ce9cd166898960de7db8484934956076ad2;hb=HEAD

Note, that inventory slots got a separate descriptor, but unhardcoding THAT is not so important.
Post edited by Bhryaen on
AndreaColombo

Comments

  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited July 2012
    Item types could be externalized (this would be a feature request of its own merit), but until that, they shouldn't at least crash.

    Problem: when you auto equip (drop the item on the paper doll) an item with unsupported item type, there will be a crash.

    (Minimal) Solution: proper bounds check (or just remove the assertion, i forgot which), so it won't break the game.

    (Preferred) Solution: externalize the item type/inventory slot relation with a simple 2da (further info on what I mean: http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=blob;f=gemrb/docs/en/Tables/itemtype.txt;h=d13e75a6bd1429a9acc51eaa4a4a074291ee6f50;hb=HEAD)

    And an example: http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=blob;f=gemrb/override/bg2/itemtype.2da;h=21114ce9cd166898960de7db8484934956076ad2;hb=HEAD

    Note, that inventory slots got a separate descriptor, but unhardcoding THAT is not so important.
  • AndreaColomboAndreaColombo Member Posts: 5,524
    Well, if the were to unhardcode the item types/inventory slot relation, why wouldn't they also unhardcode the descriptor? I mean, while you're at it, it's well worth going full-fledged about it ;)

    I'll add this to the externalization requests, btw.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Customizing the inventory means changing the number of entries, which would bring up file incompatibilities. We needed it only to support multiple inventory formats throughout IE games. Allowing modders to change the .cre file structure is probably more trouble than benefit.
    Bhryaenlolien
  • SethDavisSethDavis Member Posts: 1,812
    @Avenger_teambg - is there currently an item that causes this crash so I can find where it's happening?
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    edited July 2012
    SethDavis said:

    @Avenger_teambg - is there currently an item that causes this crash so I can find where it's happening?

    No, this is a modder-only problem. But i can always upload one... I'm just not a weidu guy, so it would be an .itm

    It is happening when you try to find where to auto equip the item.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Here is it:
    Bhryaenlolien
  • SethDavisSethDavis Member Posts: 1,812
    edited July 2012
    Checking this one now

    [EDIT] Potentially fixed - The game no longer crashes when equipping an item of unsupported type. However, you are also unable to equip the item at all, the item is returned to the inventory. This was achieved by removing the BIOASSERTS that were complaining.

    Not entirely sure why someone would want to create an item that doesn't match any supported type, so I don't know if it is acceptable to not equip it.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    SethDavis said:

    Checking this one now

    [EDIT] Potentially fixed - The game no longer crashes when equipping an item of unsupported type. However, you are also unable to equip the item at all, the item is returned to the inventory. This was achieved by removing the BIOASSERTS that were complaining.

    Not entirely sure why someone would want to create an item that doesn't match any supported type, so I don't know if it is acceptable to not equip it.

    This would work if itemtypes are externalized, as per my feature request.
    Why would you want new itemtypes if they are not equippable?
    One word answer: shops.
    But really, this would work much better with the custom itemtypes :D
    AndreaColomboBhryaenlolien
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    Otherwise, confirmed not to crash.
  • Avenger_teambgAvenger_teambg Member, Developer Posts: 5,862
    @Sethdavis, i already found a good application. Change bandit scalps for a new itemtype, so Officer Vai won't behave like a fur/book/pawnshop trader.
  • SethDavisSethDavis Member Posts: 1,812
    @Avenger_teambg - Ah, that makes so much more sense now lol. All I got from youre "One word: shops" was a guy carrying around one of those pdas from the mercenaries game to buy things with
Sign In or Register to comment.