Jump to content

How to add "vanilla" items to "vanilla" creatures in BG2?

Recommended Posts

Voilà, the title tells allI wish to add dragon scales to existing dragons in BG2ToB for a mod and I don’t find the exact lines of codes until now in order to do this. I wish to add:

- black bragon scales - SCALEB.ITM - to Nizi-machin  - DRACBLAC.CRE -

- red dragon scales - SCALER.ITM - to Saladrex - GORSAL.CRE - 

and in a near future green dragon scales

So is it possible to give me the exact lines of code please ? And by the way, how to add "vanilla" items to "vanilla" creatures for BG2ToB ? Thank you by advance.

Link to comment
BACKUP ~modname/backup~
AUTHOR ~Prof Errata~


COPY_EXISTING_REGEXP ~gorsal.cre~ ~override~
ADD_CRE_ITEM ~scaler~ #0 #0 #0 ~NONE~

COPY_EXISTING_REGEXP ~dracblac.cre~ ~override~
ADD_CRE_ITEM ~scaleb~ #0 #0 #0 ~NONE~


Link to comment

Voila…thank you for your help.


    //    Mod Artemus Jansen pour BG2ToB par Prof Errata     //

BACKUP ~Artemus\backup~
AUTHOR ~Prof Errata~

LANGUAGE ~Francais~


// Creature Stuff

COPY ~Artemus/creatureArtemusS.bmp/~ ~override~
COPY ~Artemus/creature/ARTEMUS.CRE~ ~override/ARTEMUS.CRE~
  SAY NAME1 @11

// Stores

COPY ~Artemus/store/Artemus.STO~ ~override/Artemus.STO~
  SAY NAME2 @12

// Dialogues



// Dragon Scales


COPY_EXISTING ~gorsal.cre~ ~override~
ADD_CRE_ITEM ~scaler~ #0 #0 #0 ~NONE~

COPY_EXISTING ~dracblac.cre~ ~override~
ADD_CRE_ITEM ~scaleb~ #0 #0 #0 ~NONE~


COPY ~Artemus/Items/PEARMCAM.ITM~ ~override/PEARMCAM.itm~
SAY NAME1 @200
SAY NAME2 @201

COPY ~Artemus/Items/PEEPEDOG.ITM~ ~override\PEEPEDOG.itm~
SAY NAME1 @210
SAY NAME2 @211

COPY ~Artemus/Items/PEFLEALC.ITM~ ~override\PEFLEALC.itm~
SAY NAME1 @220
SAY NAME2 @221

COPY ~Artemus/Items/PEMASCUT.ITM~ ~override\PEMASCUT.itm~
SAY NAME1 @230
SAY NAME2 @231

COPY ~Artemus/Items/PEROBMAG.ITM~ ~override\PEROBMAG.itm~
SAY NAME1 @240
SAY NAME2 @241

COPY ~Artemus/Items/PESTAFLA.ITM~ ~override\PESTAFLA.itm~
SAY NAME1 @250
SAY NAME2 @251

// Scripts Extensions

EXTEND_BOTTOM ~ar0702.bcs~ ~Artemus/baf/Artemus.baf~

AT_INTERACTIVE_EXIT ~VIEW Artemus/Artemus.txt~
Edited by Mike1072
added code and spoiler tags
Link to comment
19 minutes ago, Prof Errata said:


AT_INTERACTIVE_EXIT ~VIEW Artemus/Artemus.txt~

Rather than this, use:

README ~Artemus/Artemus.txt~

...at the begining, after say the LANGUAGE line.



Yeah, my bad... copy pastings a wizard.

Edited by Jarno Mikkola
Link to comment
1 hour ago, Prof Errata said:

Can you be more precise, Jarno, for this REGEXP line ?

The REGEXP is used to search the in-game files with variable * ... so all the .spl files can be "searched" for example with:

COPY_EXISTING_REGEXP ~*.spl$~ ~override~

And then those can be further refined with ACTION/PATCH_IF patherns, for example correct file size, like:

    PATCH_IF (SOURCE_SIZE > 0xc9) THEN BEGIN 						// protects against invalid files

And then the BEGIN action can have other search restrictions or actual actions ... so you can use these tool for example add effects etc. and do all the things you want to, to multiple files in one go... well, the files will be individually modified, but the function does the same thing to all.

Edited by Jarno Mikkola
Link to comment
3 hours ago, Prof Errata said:

COPY_EXISTING ~gorsal.cre~ ~override~
ADD_CRE_ITEM ~scaler~ #0 #0 #0 ~NONE~

COPY_EXISTING ~dracblac.cre~ ~override~
ADD_CRE_ITEM ~scaleb~ #0 #0 #0 ~NONE~

You need to specify an argument for the slot parameter in ADD_CRE_ITEM.  Here's the full explanation of the command.  WeiDU also includes a tutorial for it.


 ADD_CRE_ITEM itmName charge1 charge2 charge3 flags slot [ EQUIP ] [ TWOHANDED ] [ NOMOVE ]

Add the item itmName to the current CRE file, with the number of charges determined by charge1, charge2 and charge3, respectively. Each charge should be an integer, either in the form of #integer or ( value ). The argument flags must be a string consisting of one of none, identified, unstealable, stolen, undroppable, identified&stolen, identified&unstealable, identified&undroppable, unstealable&undroppable, stolen&undroppable, identified&stolen&undroppable, identified&unstealable&undroppable. The argument slot should be a whitespace-separated list of entries chosen from helmet, armor, shield, gloves, lring, rring, amulet, belt, boots, weapon1, weapon2, weapon3, weapon4, quiver1, quiver2, quiver3, quiver4, cloak, qitem1, qitem2, qitem3, inv1, inv2, inv3, inv4, inv5, inv6, inv7, inv8, inv9, inv10, inv11, inv12, inv13, inv14, inv15, inv16. On PST, there are the additional slots tattoo1, tattoo2, tattoo3, earring1, earring2, inv17, inv18, inv19 and inv20. On IWD2, there are the additional slots shield1, shield2, shield3, shield4, inv17, inv18, inv19, inv20, inv21, inv22, inv23 and inv24. ADD_CRE_ITEM will add the item to the first empty slot in the list. If no slot is empty, the item will be placed in the first slot in the list and the item that previously occupied the slot will be moved to the general inventory. If the general inventory is full, the moved item will be discarded. Additionally, slot may contain one or more entries chosen from inv, qitem, quiver, weapon, ring. These entries unfold to the full range of corresponding slots. For example, qitem unfolds to qitem1, qitem2 and qitem3. On PST, you may additionally use tattoo and earring. On IWD2, you may additionally use shield. The optional argument EQUIP only applies to the weapon slots only and will make the creature have the weapon selected. The optional argument TWOHANDED also only applies to weapon slots and will cause items in the shield slot to be unequipped. The optional argument NOMOVE will cause the new item to be added to the specified slot(s) only if there is an empty slot, otherwise the new item is placed in the inventory. See the ADD_CRE_ITEM tutorial.

The short version is you probably want something like this:

COPY_EXISTING ~gorsal.cre~ ~override~
ADD_CRE_ITEM ~scaler~ #0 #0 #0 ~NONE~ ~INV~

COPY_EXISTING ~dracblac.cre~ ~override~
ADD_CRE_ITEM ~scaleb~ #0 #0 #0 ~NONE~ ~INV~


Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...