Merchants: respawing inventory empty

Discussion in 'General Modification' started by 0rion79, Sep 29, 2005.

Remove all ads!
  1. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    Hello all. I know I've been a bit silent but I'm next to come up with a tastly (I hope) surprice. I've almost ended, but there is one thing that I really can't fix: when I edit merchants, after 24 hours their inventory is empty and I don't understand what I do wrong. Here is my step-by-step procedure: I...
    -create a new chest
    -put insitde whatever I want
    -mark it as see through, shoot through, don'tdraw, invisibile, no block, dynamic, provides cover.
    -assign an ID to the Inventory Source ID that is not used by other merchants (IE 320), and save.
    -Then,create a merchant near the chest, then I define the substitue inventory container and save the merchant
    -then I open the file invensource.mes, create a new line and write inside the name of the merchant and the respawning inventory.
    For example, like this list:

    Code:
    {Blacksmith: buy_list_num,7 100,4214 100,4034 100,4215 100,4215 100,6018 100,6019 100,6020 100,6021 100,6027 100,6028 100,6032 100,6033 100,6047 100,6060 100,6074 100,6093 100,6153 100,4015 100,4207 100,4201 100,5004 100,5004 100,4209 100,4021 100,4036 100,4045 100,4049 100,4060 100,4059 100,4067 100,4068 100,4070 100,4071 100,4068 100,4072 100,4073 100,4076 100,4077 100,4026 100,6059 100,4009 100,4009 100,4066 100,4205 100,5007 100,12584 100,1258 100,12586 100,12587 100,6141 100,4605 100,4216 100,4132 100,4607 100,4183 100,4212 100,4603 100,4613 100,6228 100,4157 100,4181 100,6226 100,6231 100,6223 100,6225 100,4343 100,4304 100,4305 100,4306 100,4307 100,4308 100,4189 100,4155 100,4188 100,4163 100,4158 100,6230 100,4185 100,4173 100,4065 100,4204 100,4012 100,4180 100,6229 100,4165 100,4178 100,4208 100,4166 100,4167 100,6224 100,4187 100,4035 100,6221 100,6301 100,4177 100,4174 100,4169 100,4176 100,4196 100,4206 100,6079 100,4168 100,6220 100,6303 100,4179 100,4186 100,4156 100,6154 100,4048 100,4170 100,4202 100,4159 100,4171 100,4182 100,4184 100,4210 100,6227 100,6222 100,4160 100,4341 100,4175 100,6075 100,6232 100,4704}
    After all this and cleaning the redundant files in the maps folder, the problem is that, if I modify, for example, the existing blacksmith in homelet assigning to his chest a new line in the invensource.mes file, he sells the items that I want but, after 24 h, his inventory is empty. Instead, if I replace, his existing items list in the invensource.mes at string 7, the game don't load and quits to desktop. Do you know what's wrong?

    A thing that I thought is that, with so many items, I may have missed some so that the invensource.mes list does not match esactly with the files contained in the mob files, but this should not be a problem since he should only reload the ones in the list, right?
     
  2. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    I don't really know what your problem is (don't have time to read in much detail), but there's one thing that I noticed that you are doing wrong: do *NOT* set the OF_DYNAMIC flag for merchants with respawning inventories, that will cause them to crash (yeah, I know it's incorrectly said in the tutorial that you should set that, but in fact you shouldn't if you want a respawnable inventory. If you're making a static inventory then feel free to set OF_DYNAMIC).

    I hope someone else (Ted? Allyx?) will be able to answer your question in more detail as to why your merchant doesn't respawn its stuff.

    - Agetian
     
  3. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    Dunno... actually, it made no change and, if it may be of any help, it QTD while loading sector data at startup.
     
  4. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Right.

    Not sure what the problem is looking at that - didn't change anything else? If it is a CTD at startup then it is a problem in the file, like a spelling error, not in the mob itself.

    Edit: If you wanna see a working user-mdae one, just have a look at Ah Fong in my mod, but keep in mind he needs to have that OF_DYNAMIC flag fixed in the last version (that has been taken care of for Co8 4.0.0).
     
    Last edited: Sep 29, 2005
  5. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    Sorry, what do you mean with "flag fixed"? If you mean that I have to unmark it, I already did it. And, what is the map where Ah Fong is?
     
  6. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    "...flag fixed": Yes, it just means OF_DYNAMIC has to be unmarked.
    Map where Ah Fong is: unless I'm seriously mistaken, it's Map-9-Nulb-Interior-Generic-Nulb-4th-fl (map ID #5088)

    - Agetian
     
  7. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    ok, I'll make a check. But, would you make me a small favor? Please, try to modify Brother Smith's inventory adding one single item of your choiche, modifying the InvenSource.mes file too. I want to see if I'm the only one experimenting such problems! :(
     
  8. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Sorry pal, don't have much time to test stuff right now :(
    Please, someone else who has some time (don't want to point someone specific out here), do this favor and test it for me, OK? ;)

    In the past I used to work a lot with merchants, and experienced no problems whatsoever. Also, Allyx made the shop map (which is an excellent example of merchants with non-respawnable inventories), and Shiningted made Ah Fong and probably other merchants (not sure about the latter). Ah Fong is an excellent example of a merchant with respawnable inventory. Adding just one item to invensource.mes shouldn't cause anything weird for sure... Not sure why you are experiencing problems here.

    - Agetian
     
    Last edited: Sep 30, 2005
  9. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    I was thinking... may it be some kind of wrong text formatwhen I add new items to the InvenSource.mes? I mean, if I add 100,XXXX where XXXX is the ID of the item to sell, it means that there are 100% of chanches to respawn that item when refreshing the inventory, right? Then one hit on the space bar to separate the previous item from the next one.
     
  10. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    Or maybe the editor that I'm using, that corrupts the file.... guys, what do you use? Notepad or Phalzyr's protos editor or something else?
     
  11. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Personally I use plain Notepad when dealing with InvenSource.mes - it's the best way to ensure that the external program is not adding any mistakes to your text :)

    Phalzyr's ProtoEd can do the thing as well, but it's known to add some stuff sometimes that may corrupt the data in a mes file (very rarely though). Anyway, I'd suggest you to try it in Notepad and see if it helps.

    - Agetian
     
  12. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    If I may, I use Notepad then view in ProtoEd if bug-hunting - ProtoEd shows up simple things like bad bracketing - ( instead of { etc - pretty quickly.
     
  13. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    Yes, that one was the real matter. I discovered it by myself and now that I'm writing I've edited almost everything that I wished. Only one last question: what I have to do to have merchants with fixed inventory, that does not respawn items that the player buy after sleeping 24 h, like Burne's?

    Ah, for the records, there was some value in Brother Smith's inventory (100,XXXXX) that screwed up the file when I changed it. it was enough to remove some of the final values to have it run fine without any missing entry (I wonder why :s)
     
    Last edited: Oct 3, 2005
  14. 0rion79

    0rion79 Established Member

    Joined:
    Apr 9, 2005
    Messages:
    573
    Likes Received:
    0
    If somebody will ever have my same doubt, it is enough to unmark the line in the ToEE wolrd editor that links the chest to an item list in the InvenSource mes.
     
  15. Agetian

    Agetian Attorney General Administrator

    Joined:
    Aug 14, 2004
    Messages:
    2,526
    Likes Received:
    0
    Exactly, you just have to remove the "Inventory Source" flag for the container.
    - Agetian
     
Our Host!