Looking for someone to fix the store sellable Item lists?

Discussion in 'Negative Energy Plane' started by Nomad_Wanderer, Sep 25, 2003.

Remove all ads!
  1. Aginor37

    Aginor37 Member

    Joined:
    Sep 26, 2003
    Messages:
    37
    Likes Received:
    0
    Well, I dug up the proto tag for Brother Smyth (blacksmith merchant in homm, very convienent for new games and thus testing), and while there are quite a few fields that are unexplained, none of them seem to reference his sellables list in any way. Maybe after we get more of the variables in proto defined, more light will be shed on it.

    And the digging continues.
     
  2. Aginor37

    Aginor37 Member

    Joined:
    Sep 26, 2003
    Messages:
    37
    Likes Received:
    0
    Well, there's hope, albeit small hope. By brute forcing it, I made the blacksmith sell bullets.

    Unfortunately, in order for it to happen I had to change the proto ID# for bullets (5007) to the one for arrows (5004), and this had the unfortunate side-efect of making all regular arrows in the game become bullets.:baa:

    Hopefully, inspiration will strike soon, as I am running out of ideas. Maybe proto id# clonong and making a "fletcher" merchant? Should be doable if you can clone a NPC model to spawn in another place and do his dialog from scratch.
     
  3. Dhoom

    Dhoom BIG Troll Berserker

    Joined:
    Sep 25, 2003
    Messages:
    139
    Likes Received:
    2
    I can add an option for him to sell bullets via his Dialog...

    Bump this 131 below the existing 130, and re-number the old 131,132,133,134,135 = 132,133,134,135,136... Then just add the other text onto the bottom of his dlg file.

    I have the cost set to 10sp... don't remember the real cost

    ----------------code below-----------------------

    {131}{Do you have sling bullets for sale?}{}{1}{}{2000}{}

    {2000}{Would you like to buy some bullets for 10sp?}{}{}{}{}{}
    {2001}{Yes.}{}{1}{}{2010}{}
    {2002}{No.}{}{1}{}{130}{}
    {2010}{...Purchase Screen...}{}{}{}{}{}
    {2011}{...Buy...}{}{1}{pc.money_get() >= 100}{2020}{pc.money_adj(-100); create_item_in_inventory(<5007,pc)}
    {2012}{...Don't Buy / Not Enough Money...}{}{1}{}{130}{}
    {2020}{Anything else?}{}{}{}{}{}
    {2021}{Yes.}{}{1}{}{130}{}
    {2022}{No.}{}{1}{}{0}{}

    ------------------------end code------------------------

    Tested it, and it works :)

    EDIT::

    Sorry... messed that up, but good. :D Pasted the wrong thing.
     
    Last edited: Sep 27, 2003
  4. indio

    indio Member Veteran

    Joined:
    Sep 25, 2003
    Messages:
    18
    Likes Received:
    0
    I completely deleted a line for Calmert and inserted {unused} instead. He still had all his original equipment!
    I still think NPC equipment is being populated at startup by some other mechanism.
    I have a question . Are all objects ,NPC's, etc spawned at map startup ?
     
  5. Aginor37

    Aginor37 Member

    Joined:
    Sep 26, 2003
    Messages:
    37
    Likes Received:
    0
    Before we go any further in this, could someone please make a lits of items that should be on a merchant, but aren't?

    The reason I am asking is, the original example used (bullets) can be found on Jakk the leatherworker. So until we know what is missing, this is more of a "something cool that we should figure out for modding purposes", and less of a bug fix issue.

    Not saying it isn't a worthy goal, and blelieve me, I'm still gonna work on this (I'm going to figure out how it works if it kills me, it's driving me nuts! ;) ), but if it's not a critical issue, that gives us more leeway in terms of when we need it done.

    And on the new info front, I think that NPC's are spawned at map change. I sold some stuff to Smyth, then passed time for 45 days. He still had my stuff until i went into his house and back out, at which time he was back to his default inventory. Not sure how big, but I think this is definitely a piece of the puzzle.
     
  6. Horad

    Horad Member

    Joined:
    Sep 27, 2003
    Messages:
    4
    Likes Received:
    0
    Speaking of inventory and buying/purchasing (and apologies if this is covered elsewhere) but is there any other way to sell itmes other than dragging and dropping every single stupid little item? (other than stackable gems/potions etc). I mean if I have ten pairs of leather boots to sell I have to drag each and every one of them.
     
  7. Aginor37

    Aginor37 Member

    Joined:
    Sep 26, 2003
    Messages:
    37
    Likes Received:
    0
    Stick a fork in this biznitch, it's freaking DONE!!

    We have had the correct answer all the time, it just wasn't something we were thinking of. Here is the problem.

    Syntax:
    The descriptive name must end in a colon.
    Each list entry must be a money entry, item entry, or one-of entry
    A money entry is one of the words (copper,silver,gold,platinum,gems) followed by a comma and either a value or a range, eg. 1-5
    An item entry is described by a percentage, a comma, and a basic prototype enum (as from description.mes). Don't include a percentage sign.
    A one-of entry is a set of basic prototype numbers in parentheses separated by commas. One of these is given to the creature.
    here is a space before each item entry and none used inside an entry.
    List zero is reserved, and should not be used.

    That's the opening of invensource.mes. Basiclally it explains how the file works. We all knew this, the problem we were having is that our changes weren't being read. The reason for this problem is this; Here's what the opening should have looked like, assuming proper Q/A had been done on the game.

    // Syntax:
    // The descriptive name must end in a colon.
    // Each list entry must be a money entry, item entry, or one-of entry
    // A money entry is one of the words (copper,silver,gold,platinum,gems) followed by a comma and either a value or a range, eg. 1-5
    // An item entry is described by a percentage, a comma, and a basic prototype enum (as from description.mes). Don't include a percentage sign.
    // A one-of entry is a set of basic prototype numbers in parentheses separated by commas. One of these is given to the creature.
    // There is a space before each item entry and none used inside an entry.
    // List zero is reserved, and should not be used.

    Yep, it was that simple. The fact that the opening wasn't comment'd out was causing it not to read, and I assume as a failsafe it reverted to some hard-coded backup or somesuch.

    So if you comment out the opening to the file, all your changes will be read. Then you just either start a new game or leave that map and rest long enough to have the merchant reset to default, and your added items appear in the inventory.

    That's it folks, we now control the merchant inventory interface.
     
  8. Glamis

    Glamis Member

    Joined:
    Sep 25, 2003
    Messages:
    39
    Likes Received:
    0
    ROFL!!

    OMG, nice work Sherlock Holmes! :)
     
  9. Dhoom

    Dhoom BIG Troll Berserker

    Joined:
    Sep 25, 2003
    Messages:
    139
    Likes Received:
    2
    Damn! I feel like an idiot! :D

    I spent hours last night, for nothing, on my MW Dialogue code. heh.

    Oh well. It was a learning experience, and I can use that code for other things...

    Hmmm....

    Run an INT Check, or other PC Stat/Skill/etc check, and offer to sell them a magic weapon or something :D

    We can use my script on NPC's that don't have a Barter screen.
     
  10. Dhoom

    Dhoom BIG Troll Berserker

    Joined:
    Sep 25, 2003
    Messages:
    139
    Likes Received:
    2
    Started working on this :)
     
Our Host!