1) Dealers inventory - I get that you must rest and not just pass time, and it must be for 24 hours, but the description below (mostly the underlined part) from the ToEEWB confuses me a bit: Remember: For a merchant to respawn his inventory, you must rest (not wait!) 24 hours, presumably on the same map where the merchant is set, outside the 800x600 area where the merchant is! Otherwise you won't see the merchant respawn. So if the merchant is in Nulb, and I rest in Hommlet he won't respawn? I have to be IN Nulb, yet outside of the 800/600 area? 2) Personal inventory - If a non-dealer like Elmo has an entry in InvenSource.mes, when exactly does that trigger during the game? If anyone could clarify this, it would be appreciated. Thank you.
1) I don't really remember the specifics (you can try testing it e.g. with Brother Smith in Hommlet), but the main issue has always been with indoor vendors. Their respawning had to be effected by scripting, otherwise it didn't work. For example, see Gremag's script file. 2) For personal inventory, the Invensource entry determines the gear that the NPC spawns with if it's spawned by script (via the game.obj_create command). You can also use it in WB as a template (to add items via the Load Invensource button). Otherwise, IIRC they just start off naked if you don't directly add equipment.
Respawning an inventory only requires a time delay if you script that, otherwise the vanilla method just required a map change iirc. Most Co8 scripts now add a time delay for realism though, and the modern day modded method actually doesn't even require a map change. (I think the info you're consulting is dated.) So basically if you persist with the vanilla methodology, it won't work reliably anyway and you'll be 'old school.' Like Sitra said, look at some modern vendor scripts to see how to do it properly. No, he will respawn if you leave his map (technically, though indoor vendors won't because the the original method is bugged). I don't really know what this 800x600 area is about ... maybe a reference to old screen dimensions or sector sizes. Shouldn't matter either way. In addition to what Sitra says, you can populate a critter's inventory via an invensource.mes entry in WorldBuilder, which would of course happen before the game. Bear in mind though that vanilla critters have pre-defined inventories that their mobs are already equipped with. If you want to change that, change the critter's invensource entry accordingly, and then re-equip him/her via WorldBuilder again through the invensource method.
I just somewhat verified that, although with a small samplesize . I set up 2 vendors outside and two inside, and the outside ones respawned and the inside did not. An interesting effect was that the vendors themselves also respawned their personal inventories too. I set original robe to white, and the Invensource.mes with a blue robe, and they changed colors when they restocked. Go figure. Also, no matter how long you stay in the same town (even resting), they will never restock from what I've seen. I guess the logic is that in order to get more equipment you have to at least leave town and experience the danger of a random encounter before rewarding you with more stock. But that was just from my example, maybe that isn't the general rule. Once I'm more comfortable with scripting I'll check out the Gremag script, thats for pointing that out. For now I'll cheese out and put my vendors outside hehe. Yes, that's a very nice feature, I keep about 25 standard issue equipment packages in there to quick load random equipment on an NPC (it even auto equips). The randomization factor is the best part, so if you want a fighter to be given random armor based on say 10% chance of plate, 30% chance of chain, and 60% chance of leather, you can just put the line (6039,6019,6019,6019,6013,6013,6013,6013,6013,6013) in the template. Hmm, now I'm thinking, I wonder if you could give every creature and chest randomized treasure by destroying it on first appearing, and then recreating it, thereby drawing its treasure from a randomized InvenSource.mes line. I love randomized treasure.
Thank you both very much for the insight. The gremag script looks easy enough to copy/paste, though the underlying stuff like parsing the InvenSource.mes file looked like a chore to write. One question though, I notice that a few global variables are used like: game.global_vars[] game.global_flags[] game.quest[] Is there a list somewhere telling what each element in each of those arrays are reserved for? I'm assuming you can't just grab game.global_vars[350] or whatever without trampling on another script that uses it. EDIT: Found the sticky. Please ignore.
Just to confirm this, this is precisely the respawn bug: NPCs on WorldMap-accessible maps (Hommlet main map, Nulb main map, Moathouse outdoors etc) respawn their shop inventories correctly, 'indoor' vendors only respawn their personal inventories not their shop inventories. I like the idea of setting all the (indoor) NPCs to respawn their stuff periodically, if only so they change clothes: even if its just 'brown peasant dress / grey peasant dress / green peasant dress'. Characters who don't wear the same thing every day, like a cartoon character, seems more realistic somehow. Sunom: Moneir, you've changed into your Sunday best! It's for that hussy, isn't it!!?!
I have a 24 hour timer for each NPC with a random colored cloak or garb drawn from InvenSource.mes. It really does add lot of character to the NPC's. One little hickup though is that if you Pass Time for 24 hours while in the room with those guys, there is a brief flash where the NPC is naked before he redresses, hehe. I guess you could set the rooms to SLEEP_IMPOSSIBLE, but then that red splotch in the rest box makes it look like you're in some kind of dangerous war zone at a church shop. Another thing I did was take the drawn weapon out of the hand of most villagers and shopkeepers. ("Hi, I'm the meekly tailor, ignore this crossbow I have pointed at your face, would you like to see some cloaks?"). I used somthing like this: def san_start_combat( attachee, triggerer ): create_item_in_inventory( 4010, attachee ) attachee.item_wield_best_all() return RUN_DEFAULT The only trouble I've run across with it so far is sometimes I'll loot the body afterwards and there are 12 greatswords in his inventory, hmmm. (edit: just realized I needed to make the call in san_enter_combat, NOT san_start_combate. I guess san_start_combat is called before each npc's combat turn, so it was creating on each attack)