Merchant Inventory Restocking

Discussion in 'General Modification' started by Xma, Oct 1, 2003.

Remove all ads!
  1. Xma

    Xma Member

    Joined:
    Sep 27, 2003
    Messages:
    31
    Likes Received:
    0
    Mainly for Aginor...

    A workaround if he doesn't want to restock like he should...

    In 0059blacksmith.dlg, for example.

    What if we edited in it some dialog line:

    {21}{B:}{}{1}{}{0}{}

    in

    {21}{B:}{}{1}{}{0}

    // this is the last bracket of dlg options, "execute command"
    {

    // optionally some random test rolls if we want a probability of creating the item

    create_item_in_inventory( PROTO_ITEM_NUMBER, npc )
    create_item_in_inventory( PROTO_ITEM_NUMBER, npc )
    create_item_in_inventory( PROTO_ITEM_NUMBER, npc )
    create_item_in_inventory( PROTO_ITEM_NUMBER, npc )

    // ....

    }

    Anyone wanna test ?
     
    Last edited: Oct 1, 2003
  2. Dhoom

    Dhoom BIG Troll Berserker

    Joined:
    Sep 25, 2003
    Messages:
    139
    Likes Received:
    2
    Well, if you can find a 'random roll' function, I can modify my Blacksmith dialogue :)

    Sadly, I don't think one exists. I know how I could code it if one did exist, but remember -- the 'random' function, the blacksmith dialogue... all this is a short-term solution to something already in the game that we can't figure out yet: Getting the blacksmith to restock his items with MW items when the game starts.

    There's already a 'random' feature built into the inventory list, and we have been partially successful in modifying shopkeeper inventory, but there are still a few unknowns.
     
  3. Ares

    Ares Member

    Joined:
    Sep 26, 2003
    Messages:
    8
    Likes Received:
    0
    Try this one :
    game.random_range(x, y) where x is the lower and y is the upper boundry.

    I don't know if it works, but it's in my list ;-).

    ~Ares
     
  4. Aginor37

    Aginor37 Member

    Joined:
    Sep 26, 2003
    Messages:
    37
    Likes Received:
    0
    Good morning folks, Just woke up and found my way here.

    Dhoom is right. At this point, all we need to find is where the game calls the initial merchant inventories from. Once we have that, we have everything, since it's no real difficulty in putting whatever I want on a merchant however I want. Hell, I already have a "modded" invensource.mes with MW items all on the proper merchants, in addition to their original wares. We just need to figure out how to make the game call on it first (at new game or savegame load), because for some reason it isn't.

    However, I do have a question. I don't suppose that there is a "reset" or "respawn" CMD in the dialog options? I can see the use for one in making some quests, but I haven't really played with the dialog so I ask those of you in the know.
     
  5. Xma

    Xma Member

    Joined:
    Sep 27, 2003
    Messages:
    31
    Likes Received:
    0
    Yop Aginor, I know that, but tried to figure a workaround, since we didn't found the way to have it use the invensource.mes at spawn.
     
  6. Aginor37

    Aginor37 Member

    Joined:
    Sep 26, 2003
    Messages:
    37
    Likes Received:
    0
    Well, I gave it a try, and managed to get the syntax right (if I read the above correctly, that is). For my test, I added "create_item_in_inventory(5007, npc)" to the last part of the "let us barter" line in his dialog.

    It gave him the item allright, but not in the place we want it. I had to kill him to find the item (in this case, a pouch of bullets). If there is a way to make it give him the item, but put it in his "merchant" inventory, then we are i good shape. It would be clunky as hell, but if the above is the case then all would be good.
     
  7. strangelove

    strangelove Member

    Joined:
    Oct 2, 2003
    Messages:
    10
    Likes Received:
    0
    Any files yet available for download>?
     
  8. Phalzyr

    Phalzyr Established Member Veteran

    Joined:
    Sep 25, 2003
    Messages:
    193
    Likes Received:
    1
    The initial inventory of the merchants is probably created in worled(or whatever they are using) on the spot and not available to us to edit. that is my theory at laeast, it is probaly coded with the map level.
     
  9. Aginor37

    Aginor37 Member

    Joined:
    Sep 26, 2003
    Messages:
    37
    Likes Received:
    0
    Not really, because different people are going to want to do different things with their merchants.

    However, I will be typing up a fairly detailed tutorial so people can make the changes they want to on their own.
     
Our Host!