Best way to replace default items?

Post » Mon Jun 18, 2012 8:58 pm

Hi all,

I've created a mod which lets you use regular tools (shovels, etc.) as weapons. This required creating custom weapons with the graphic assets of the tools, so really they're totally different items in the game. I'd like a player to just be able to pick up any old shovel they find lying around and use it, but I wonder what the best way to do it is.

I've been using "Search & Replace" globally (i.e. all the "Selection only" etc. boxes unchecked), replacing all instances of the default item with my custom one. This seems to work just fine from my playtesting, but a couple of people are reporting problems - I'm not sure whether they're conflicts with other mods or what. It wouldn't surprise me if this was a problematic way to do what I want, but I'm not sure. Opinions?

Is there a better way to replace default items? Would a script that swaps the items when a player picks them up be possible? (I'm looking around and don't see an obvious "on player receive item" event. ObjectReference has OnActivate and OnItemAdded (relating to containers - is the player inventory a container of some sort?)).
User avatar
Catherine Harte
 
Posts: 3379
Joined: Sat Aug 26, 2006 12:58 pm

Post » Mon Jun 18, 2012 8:27 pm

Yes, the player's inventory is a container. Detecting when people pick up a shovel and swapping it for a weapon is probably the best way to go -- or at least miles better than global search & replace, which is going to cause a huge number of modified records, and thus conflicts. No two loaded mods can edit the same record -- the last one loaded wins. But... what kinds of problems are people reporting? It sounds like you've modified all the references to various tools, so any conflicts should only occur with other mods that attempt to do something with those tools... But you have to be really careful with the new CK, as it's pretty touchy, and it's easy to leave accidental fingerprints over lots of records that you didn't think you modified. In the CK, open the Data window, click on your plugin, then click the "Details..." button to see a list of records it modifies.
User avatar
Chris Duncan
 
Posts: 3471
Joined: Sun Jun 24, 2007 2:31 am

Post » Mon Jun 18, 2012 6:25 pm

The reports so far are of some crashes, and it does sound like some of the mods mentioned could be conflicting, like More Interactive Items. I've been going over it and my mod with TESVSnip, checking those details. Haven't found anything that looks like a direct conflict, but then the number of world references in both mods is huge.

I guess a swap script is the way to go then. Will have to look in to that. Maybe a background quest that checks item IDs whenever the player inventory receives an item?
User avatar
Krystina Proietti
 
Posts: 3388
Joined: Sat Dec 23, 2006 9:02 pm


Return to V - Skyrim