I'm working on a mod which adds new weapons and I really want to add a harpoon gun which is available from the start of the game and shoots sharpened poles and spears. The problem is that they're very scarce in the original game. It will become obsolete slightly after the Den, so I only need to solve the problem until then.
One of the goals of the mod is to leave all the existing game maps unchanged if at all possible. This achieves compatibility with other mods and also simplicity.
I could use Mr. Fixit to make them craftable, but then the player would need to find the materials, and I can't think of anything available in the early game which is a reasonable material for either a spear or a sharpened pole.
I would love it if there was a way to add it to the list of restocked items to ALL auto-restocking vendors as long as the player's level is 1-6, but I don't think SSL has the necessary metaprogramming utilities - vendors restock using check_restock_item, but I'm not aware of a way to add a hook which gets called whenever that gets called. I definitely don't want my mod to look at individual vendors or their boxes - I strongly prefer to automatically recognize them. Maybe someone more advanced knows of a way to do this? Edit: Maybe I can do something with the generic storage box?
I could add a new location next to Arroyo with a pole/spear vendor, but I would hate to do this because it's such a clunky and forced solution just for a single weapon - I would rather not have the harpoon gun at all.
Any better ideas on how to do this?
Edit: Now that I thought I can't solve it without help and wrote up my problem, I came up with a solution which might work...
Here's my idea: add a global procedure which triggers on HOOK_REMOVEINVENOBJ, and when someone is moving their inventory to generic_temp_box, then they're recognized as a vendor so we say that they'll restock sharpened poles and spears once every 5 days, and we add some to their inventory right now. Problems:
1. This is not in sync with how often they restock their other items, but I think that's ok.
Also the restock starts ticking down whenever they first swap their inventory, not whenever you enter the map, but I think that's ok too.
2. I'm assuming that every vendor swaps their inventory with generic_temp_box, is that true? Is that true even in most mods which aren't wild total conversions?
Edit2: Nope, the above won't work because point 2 is false - most vendors in the game don't use the temp box and use only one box instead.
One of the goals of the mod is to leave all the existing game maps unchanged if at all possible. This achieves compatibility with other mods and also simplicity.
I could use Mr. Fixit to make them craftable, but then the player would need to find the materials, and I can't think of anything available in the early game which is a reasonable material for either a spear or a sharpened pole.
I would love it if there was a way to add it to the list of restocked items to ALL auto-restocking vendors as long as the player's level is 1-6, but I don't think SSL has the necessary metaprogramming utilities - vendors restock using check_restock_item, but I'm not aware of a way to add a hook which gets called whenever that gets called. I definitely don't want my mod to look at individual vendors or their boxes - I strongly prefer to automatically recognize them. Maybe someone more advanced knows of a way to do this? Edit: Maybe I can do something with the generic storage box?
I could add a new location next to Arroyo with a pole/spear vendor, but I would hate to do this because it's such a clunky and forced solution just for a single weapon - I would rather not have the harpoon gun at all.
Any better ideas on how to do this?
Edit: Now that I thought I can't solve it without help and wrote up my problem, I came up with a solution which might work...

Here's my idea: add a global procedure which triggers on HOOK_REMOVEINVENOBJ, and when someone is moving their inventory to generic_temp_box, then they're recognized as a vendor so we say that they'll restock sharpened poles and spears once every 5 days, and we add some to their inventory right now. Problems:
1. This is not in sync with how often they restock their other items, but I think that's ok.
Also the restock starts ticking down whenever they first swap their inventory, not whenever you enter the map, but I think that's ok too.
2. I'm assuming that every vendor swaps their inventory with generic_temp_box, is that true? Is that true even in most mods which aren't wild total conversions?
Edit2: Nope, the above won't work because point 2 is false - most vendors in the game don't use the temp box and use only one box instead.
Last edited: