Jump to content

Patching items to CREs and STOs


Guest Shard (Moongaze)

Recommended Posts

Guest Shard (Moongaze)

Hey there. For my item pack, I'm planning to patch the items to .CRE and .STO files, which I assume would work. My question is, how is this done? Also, if I want to give an existing CRE a new helmet and have him/her *equip* it, how would that be done? More importantly, if the CRE already has a helmet, how to remove the old one, or doesn't that matter?

 

Are there any main files I need to register the new items with? (such as pdialog.2da, kits.ids and things like that?)

Link to comment

If you haven't done so already, download the latest WeiDU zip from WeiDU.org, and open up the file README-WEIDU.HTML inside the zip. If you search for ADD_STORE_ITEM and ADD_CRE_ITEM, you should come across two comprehensive and relatively easy to understand tutorials :).

 

EDIT: oh, and if you want to add items to a container, that's slightly more complicated. There are two ways to do it, but easier method is to use EXTEND_BOTTOM on an area script (e.g. EXTEND_BOTTOM ~AR0082.bcs~ ~MyMod/AR0082.baf~) and then have the .baf file contain something along the lines of this:

 

IF
 Global("AddMyItem","LOCALS",0)
THEN
 RESPONSE #100
   ActionOverride("Container 1",CreateItem("MYITEM",1,0,0))
       SetGlobal("AddMyItem","LOCALS",1)
END

 

The other method involves directly manipulating the .are file (reading, adding and writing bytes, checking hex offsets, etc), which isn't exactly recommended for someone new to WeiDU modding ;).

Link to comment

If the creature already has an item and you want to replace it, it is actually easier.

You just have to overwrite the resref (the item's filename). If you have to insert a new item to the inventory you must go with the add_cre_item thingie.

I'm not sure if you can use it if there is already an item in the slot, though.

Link to comment
If the creature already has an item and you want to replace it, it is actually easier.

You just have to overwrite the resref (the item's filename). If you have to insert a new item to the inventory you must go with the add_cre_item thingie.

I'm not sure if you can use it if there is already an item in the slot, though.

 

IIRC an item already in the slot gets bumped into the inventory with ADD_CRE_ITEM.

Link to comment
Of course you can also open the CRE file with NI, DLTCEP, SK and such and just add the item directly to the slot you want to use. I personally prefer that method above add_cre_item. :)

 

Yeah but that doesn't work to things already in game, unless you intend to copy your new version over the original (A Bad Idea). And personally, I find it easier to do this kind of stuff 'on the fly'.

Link to comment
Of course you can also open the CRE file with NI, DLTCEP, SK and such and just add the item directly to the slot you want to use. I personally prefer that method above add_cre_item. :)

 

But what if that .cre has f.ex been given a new item which is critical to the plot of another mod which the player has installed? ADD_CRE_ITEM preserves that item and thus retains compatability with the other mod, but simply overwriting the creature would prevent it from working properly

Link to comment

You’re both quite right. :) I meant that I use that method with my own characters, so without overriding anything else from anyone else. ;) If I wish to add items to someone in game, then I’ll just use a scripting code. I don’t really bother with installing (so to speak) an already existing character. ;)

 

BTW: Although I’m not sure why adding an item through the CRE would cause problems with items already in the inventory. After all, you can decide in which slot it’s placed so you can just take an empty slot. So why would that cause problems?

 

I’m just curious really, cause as I said: I only add things to my own characters. ;)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...