Blue's Inventory Tools

Discussion in 'General Modification' started by Cerulean the Blue, Jul 3, 2006.

Remove all ads!
  1. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    As most of you know, Ted recently came up with a huge breakthrough in getting masterwork items to show up in Brother Smyth's shop inventory after the Giant's Head quest is completed. He couldn't get it to work with all the merchants though, because for some reason their shop inventories don't respawn. No one knows why they don't either.

    Because of this, I decided to take on a project to work around this bug via a Python script. I decided to make it even more generic though, and allow it to change or respawn any NPC's or container's inventory based on InvenSource.mes entries. This is what I have to report:

    SUCCESS!!!

    The script destroys everything in the attachee's inventory, and then reads any line (yes, any line) in InvenSource.mes and creates a new inventory for the attachee based on that line, just as the game engine would if you spawned an attachee with that inventory source. All the probabilities for each item are accounted for, as are the "randomly pick one item" lists and even the random ranges for money. The only thing it doesn't handle right now is gems and jewelry, but soon it will do that as well, once I get lists compiled of gems and jewelry and their values.

    So, Ted, if you aren't too busy with KotB, now would be a good time to look into the timer we want to use. This baby is almost ready to roll.
     
    Last edited: Jul 7, 2006
  2. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    Re: Respawning Unrespawning Inventories

    Great work Blue, I have a couple of Traders in Verbobonc I'd really like to give that script to, and a third, which I would have to actually WRITE an Invensource.mes entry for before it could benefit from your hard work.
     
  3. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Re: Respawning Unrespawning Inventories

    Excellent Mr Blue. Will contact you about this.

    So everyone appreciates the importance of this, I might add I have been trying to get the original ones to respawn, comparing everything in the ones that do and the ones that don't, and I got nowhere. I was basically out of ideas on this (including the "let Agetian fix it" idea ;) ), so what Blue has done is really essential.

    Could we get some feedback from people on what inventories respawn, and which ones don't, so we know who to apply it to first? I'll start it off.

    DO RESPAWN:

    Brother Smyth
    Calmert
    Otis
    Lodriss
    Jeweller

    DON'T RESPAWN:

    Leatherworker
    Cabinet Maker
    Ah Fong
    Skoll
    Burne

    Updated.
     
    Last edited: Jul 4, 2006
  4. krunch

    krunch moving on in life

    Joined:
    Aug 9, 2005
    Messages:
    3,280
    Likes Received:
    0
    Re: Respawning Unrespawning Inventories

    DOES NOT RESPAWN

    Burne's scrolls
     
  5. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    Re: Respawning Unrespawning Inventories

    I beleive that is how it is currently.
     
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Re: Respawning Unrespawning Inventories

    Great news!

    Sorry if I'm misunderstanding this Axl, but no one besides Brother Smyth and Calmert has any inventory refreshed? So when they're sold out, they're sold out for good? That seems kind of wacky, especially for bullshit items like gloves and boots.

    I would think the major retailers (Otis, Ah Fong, Brother Smyth, Rannos & Gremag) would get shipments in fairly regularly.
     
  7. Kalshane

    Kalshane Local Rules Geek

    Joined:
    Aug 6, 2004
    Messages:
    1,653
    Likes Received:
    4
    Re: Respawning Unrespawning Inventories

    I'm pretty sure the jeweler's inventory respawns as well. I'm not positive, but I thought Otis' inventory changed, though I could be wrong as I very rarely bother trading with him.

    Lodriss' inventory respawns. You can't sell her anything, but any stuff you buy does get replaced eventually.
     
  8. Lord_Spike

    Lord_Spike Senior Member Veteran

    Joined:
    Mar 25, 2005
    Messages:
    3,151
    Likes Received:
    1
    Re: Respawning Unrespawning Inventories

    Blue...as always...nice work! :cool:
     
  9. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Re: Respawning Unrespawning Inventories

    I think u may be right about the Jeweller, I will check.
     
  10. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    Re: Respawning Unrespawning Inventories

    Thanks everbody.:)

    The Jeweler definitely does refresh. Burne's shop inventory doesn't refresh, but his shop inventory in InvenSource.mes is his personal inventory.

    After I get the gems and jewelry bits working (which should hopefully be tonight), next on the agenda is a script that will look at an inventory in the game and write an InvenSource.mes line for it.
     
  11. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Re: Respawning Unrespawning Inventories

    That is indeed the bug we are trying to fix, Gaear ;)

    I think I will check the Nulbians en masse, stay tuned for an update.
     
  12. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Re: Respawning Unrespawning Inventories

    OK, I had a little chat with Steve Moret about this issue, he said that "I'm pretty sure the rules [for respawn] are: 1. pc character is nowhere nearby (e.g. offscreen at the highest resolution 1600x1200) and 24 hours have passed since the last time someone looked at their inventory."; "Its certainly not something hard coded. And I talked with Tim they all [NPCs] should reinvensource."

    So, what can we infer from this? First of all, we know that invensource entries don't have any hardcoded elements in the temple.dll, so technically, to quote Steve again, "they should all reinvensource" (respawn). However, we also know that many original inventories in the game itself don't respawn, so it sounds like a bug in the game, or at least a bug somewhere in the invensource or something.

    Anyway, in order to test the original inventories for whether they respawn or not, I'd suggest:

    1. Setting the flag in random_encounter.py that would allow you to rest on any map.
    2. Try getting away from the shopkeeper on the same map (even if the map is small, try teleporting outside to the non-walkable area, somewhere far) and resting there for 25 hours (more than 24 just to be safe).
    3. Teleport back to the shopkeeper and see if his inventory has respawned.
    4. If it hasn't, try going outside to another map (not teleporting, but going there), rest there for 25 hours, go back, and see if it has respawned or not.

    If it still hasn't respawned, then it means it doesn't respawn for sure.
    The important thing is: whenever possible, you should try walking away from the shopkeeper and not teleporting away from him, because the teleporting command on its own may skip some of the game checks for distances between things.

    On my side I did some experiments with the inventory source entry in the MOB just to ensure it's always located in the correct place (at its own field entry), and it turned out that it actually is, so potentially there should be no problem in the MOB. I also ToEEWB-viewed, ObjViewed, and hex-viewed the MOBs for respawnable/non-respawnable containers and MOBs and haven't found them to be any different. There are numerous weird things about some of the MOBs (such as the presence of some unused internal flags), but those are of scattered nature and hardly have anything to do with the respawns as such.

    If it doesn't respawn the way given above, then it may be a bug in the game, and who knows what sort of bug this is. Steve is still looking into it and if he finds something out, I'll let you know.

    - Agetian
     
    Last edited: Jul 4, 2006
  13. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    Re: Respawning Unrespawning Inventories

    Sorry, I thought we were proposing that no one but Brother Smyth and Calmert respawn, not reporting that no one but those two currently does respawn. :blush:
     
    Last edited: Jul 4, 2006
  14. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Re: Respawning Unrespawning Inventories

    i forgive ya. :hug:

    Ok, the Nulbists (did I miss any?)

    DO RESPAWN:
    Lodriss
    Otis (haven't tested after he returns from adventuring, but can think of no reason it should be fdifferent)

    DON'T RESPAWN:
    Skoll
    Mother Screng
     
  15. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    Re: Respawning Unrespawning Inventories

    Otis shouldn't be any different after adventuring now that my fix is in place, since the Otis that keeps shop never actually goes adventuring with you anymore.

    Oh, and you forgot Ah Fong.
     
Our Host!