Jump to content

ADD_SPELL not working please help tp2 code


Modman1

Recommended Posts

I can't get a custom spell to show up on a new character in BG1/TotSC (non-EE, from original discs). I used the official patches but have only 1 mod installed (the Widescreen mod). I searched the forums for ADD_SPELL but couldn't find help.

 

I copied the level 1 cleric spell 'Doom' from BG2 (SPPR113.spl) and imported it into the BG1 game, including the bam files. My TP2 setup code is below (MMSC21.itm is a Doom spell scroll so I can test it in game).

 

Does anyone know why this isn't adding the spell to a cleric's book?

 

// Doom from BG2
COPY ~modmanmod\bam\sppr113a.bam~ ~override~
COPY ~modmanmod\bam\sppr113b.bam~ ~override~
COPY ~modmanmod\bam\sppr113c.bam~ ~override~
COPY ~modmanmod\itm\MMSC21.itm~ ~override~
SAY NAME2 @97
SAY IDENTIFIED_DESC @98
COPY ~modmanmod\spl\SPPR113.spl~ ~override~
ADD_SPELL ~modmanmod\spl\SPPR113.spl~
1 // cleric
1 // level 1
CLERIC_DOOM
SAY NAME1 @97
SAY UNIDENTIFIED_DESC @98
Thank you.
Edited by Modman1
Link to comment

 

I can't get a custom spell to show up on a new character in BG1/TotSC (non-EE, from original discs). I used the official patches but have only 1 mod installed (the Widescreen mod). I searched the forums for ADD_SPELL but couldn't find help.

 

I copied the level 1 cleric spell 'Doom' from BG2 (SPPR113.spl) and imported it into the BG1 game, including the bam files. My TP2 setup code is below (MMSC21.itm is a Doom spell scroll so I can test it in game).

 

Does anyone know why this isn't adding the spell to a cleric's book?

 

// Doom from BG2
COPY ~modmanmod\bam\sppr113a.bam~ ~override~
COPY ~modmanmod\bam\sppr113b.bam~ ~override~
COPY ~modmanmod\bam\sppr113c.bam~ ~override~
COPY ~modmanmod\itm\MMSC21.itm~ ~override~
SAY NAME2 @97
SAY IDENTIFIED_DESC @98
COPY ~modmanmod\spl\SPPR113.spl~ ~override~
ADD_SPELL ~modmanmod\spl\SPPR113.spl~
1 // cleric
1 // level 1
CLERIC_DOOM
SAY NAME1 @97
SAY UNIDENTIFIED_DESC @98
Thank you.

 

You just add the spell to the game this way. You also need mechanisms to make the spell appear in spellbooks or to be learnable from scrolls or whatever you intend to do.

Is the spell for the protagonist or for an NPC, do clerics (or who?) get it on level up etc? Or you can provide it as an ability from some script triggered by an event.

You need to be more specific about who is supposed to have that spell under which condition.

Link to comment

1) Did you level up your cleric? Spells only get added at level-up.

 

2) You can't control the RES of a spell added by ADD_SPELL. You copied it as sppr113,* but the game will add it in the next available sppr slot, whatever that happens to be. So to make the scroll work, you need to run RES_NUM_OF_SPELL_NAME on CLERIC_DOOM, and obtain the resulting %spell_res% variable, and then COPY and ALTER_EFFECT on the scroll to insert that variable into the resource field.

 

* EDIT - that might be your problem: you COPY the spell in as SPPR113, then ADD_SPELL the one from your mod folder... now, since sppr113 already exists, the ADD_SPELL must find another sppr slot.

Link to comment

 

 

I can't get a custom spell to show up on a new character in BG1/TotSC (non-EE, from original discs). I used the official patches but have only 1 mod installed (the Widescreen mod). I searched the forums for ADD_SPELL but couldn't find help.

 

I copied the level 1 cleric spell 'Doom' from BG2 (SPPR113.spl) and imported it into the BG1 game, including the bam files. My TP2 setup code is below (MMSC21.itm is a Doom spell scroll so I can test it in game).

 

Does anyone know why this isn't adding the spell to a cleric's book?

 

// Doom from BG2
COPY ~modmanmod\bam\sppr113a.bam~ ~override~
COPY ~modmanmod\bam\sppr113b.bam~ ~override~
COPY ~modmanmod\bam\sppr113c.bam~ ~override~
COPY ~modmanmod\itm\MMSC21.itm~ ~override~
SAY NAME2 @97
SAY IDENTIFIED_DESC @98
COPY ~modmanmod\spl\SPPR113.spl~ ~override~
ADD_SPELL ~modmanmod\spl\SPPR113.spl~
1 // cleric
1 // level 1
CLERIC_DOOM
SAY NAME1 @97
SAY UNIDENTIFIED_DESC @98
Thank you.

 

You just add the spell to the game this way. You also need mechanisms to make the spell appear in spellbooks or to be learnable from scrolls or whatever you intend to do.

Is the spell for the protagonist or for an NPC, do clerics (or who?) get it on level up etc? Or you can provide it as an ability from some script triggered by an event.

You need to be more specific about who is supposed to have that spell under which condition.

To be clear, I want to create a new Level 1 cleric spell in Baldur's Gate. I want the spell Doom to appear on the spell selection screen during Character Creation, before getting to Candlekeep. And I want that spell to show up on the Cleric spell book in-game. Eventually I want to use that spell in scripts (referring to it as CLERIC_DOOM).

Edited by Modman1
Link to comment

1) Did you level up your cleric? Spells only get added at level-up.

 

2) You can't control the RES of a spell added by ADD_SPELL. You copied it as sppr113,* but the game will add it in the next available sppr slot, whatever that happens to be. So to make the scroll work, you need to run RES_NUM_OF_SPELL_NAME on CLERIC_DOOM, and obtain the resulting %spell_res% variable, and then COPY and ALTER_EFFECT on the scroll to insert that variable into the resource field.

 

* EDIT - that might be your problem: you COPY the spell in as SPPR113, then ADD_SPELL the one from your mod folder... now, since sppr113 already exists, the ADD_SPELL must find another sppr slot.

1) No, as indicated above, my intent is to get this on the spell selection screen before getting into Candlekeep (character creation).

 

2) When I open DLTCEP it shows SPPR112 as the last number taken, so I thought ADD_SPELL would allow the spell # SPPR113.

 

If I remove the "COPY ~modmanmod\spl\SPPR113.spl~ ~override~" line it still does not show Doom on the level 1 cleric spell selection screen during character creation, nor does it show up in game at Candlkeep.

Edited by Modman1
Link to comment

1) Did you level up your cleric? Spells only get added at level-up.

 

2) You can't control the RES of a spell added by ADD_SPELL. You copied it as sppr113,* but the game will add it in the next available sppr slot, whatever that happens to be. So to make the scroll work, you need to run RES_NUM_OF_SPELL_NAME on CLERIC_DOOM, and obtain the resulting %spell_res% variable, and then COPY and ALTER_EFFECT on the scroll to insert that variable into the resource field.

 

* EDIT - that might be your problem: you COPY the spell in as SPPR113, then ADD_SPELL the one from your mod folder... now, since sppr113 already exists, the ADD_SPELL must find another sppr slot.

 

 

 

1) Did you level up your cleric? Spells only get added at level-up.

 

2) You can't control the RES of a spell added by ADD_SPELL. You copied it as sppr113,* but the game will add it in the next available sppr slot, whatever that happens to be. So to make the scroll work, you need to run RES_NUM_OF_SPELL_NAME on CLERIC_DOOM, and obtain the resulting %spell_res% variable, and then COPY and ALTER_EFFECT on the scroll to insert that variable into the resource field.

 

* EDIT - that might be your problem: you COPY the spell in as SPPR113, then ADD_SPELL the one from your mod folder... now, since sppr113 already exists, the ADD_SPELL must find another sppr slot.

1) No, as indicated above, my intent is to get this on the spell selection screen before getting into Candlekeep (character creation).

 

2) When I open DLTCEP it shows SPPR112 as the last number taken, so I thought ADD_SPELL would allow the spell # SPPR113.

 

If I remove the "COPY ~modmanmod\spl\SPPR113.spl~ ~override~" line it still does not show Doom on the level 1 cleric spell selection screen during character creation, nor does it show up in game at Candlkeep.

 

Would not the way to do this be to

- create a unique level 1 spell e..g. MMDoom1.spl from the original.

- add GA_MMDoom1 to the level 1 column in the Clabpr01.2da ...04 files

?

Link to comment

 

1) Did you level up your cleric? Spells only get added at level-up.

 

2) You can't control the RES of a spell added by ADD_SPELL. You copied it as sppr113,* but the game will add it in the next available sppr slot, whatever that happens to be. So to make the scroll work, you need to run RES_NUM_OF_SPELL_NAME on CLERIC_DOOM, and obtain the resulting %spell_res% variable, and then COPY and ALTER_EFFECT on the scroll to insert that variable into the resource field.

 

* EDIT - that might be your problem: you COPY the spell in as SPPR113, then ADD_SPELL the one from your mod folder... now, since sppr113 already exists, the ADD_SPELL must find another sppr slot.

 

 

 

1) Did you level up your cleric? Spells only get added at level-up.

 

2) You can't control the RES of a spell added by ADD_SPELL. You copied it as sppr113,* but the game will add it in the next available sppr slot, whatever that happens to be. So to make the scroll work, you need to run RES_NUM_OF_SPELL_NAME on CLERIC_DOOM, and obtain the resulting %spell_res% variable, and then COPY and ALTER_EFFECT on the scroll to insert that variable into the resource field.

 

* EDIT - that might be your problem: you COPY the spell in as SPPR113, then ADD_SPELL the one from your mod folder... now, since sppr113 already exists, the ADD_SPELL must find another sppr slot.

1) No, as indicated above, my intent is to get this on the spell selection screen before getting into Candlekeep (character creation).

 

2) When I open DLTCEP it shows SPPR112 as the last number taken, so I thought ADD_SPELL would allow the spell # SPPR113.

 

If I remove the "COPY ~modmanmod\spl\SPPR113.spl~ ~override~" line it still does not show Doom on the level 1 cleric spell selection screen during character creation, nor does it show up in game at Candlkeep.

 

Would not the way to do this be to

- create a unique level 1 spell e..g. MMDoom1.spl from the original.

- add GA_MMDoom1 to the level 1 column in the Clabpr01.2da ...04 files

?

 

To my knowledge there are no clab... files for Baldur's Gate 1, at least I don't see them in DLTCEP or on the IESDP list for BG1. I'm not importing BG1 into the BG2 engine, this is a pure BG1 + TotSC mod.

Link to comment

The point of ADD_SPELL is to allow WeiDU to find the next open slot for you in case another mod has already added spells. Change the filename to something like doom.spl and allow WeiDU to slot it in (the COPY is also unnecessary); you'll need to dynamically patch your scroll depending on where it ends up.

 

Divine spells named in the proper format--sppr, followed by 1-7, followed by 01-50--should show up automatically at chargen and level up, contingent on the spell type and exclusion flags set in the spell itself (fields at 0x1c, 0x1e). At least, that's how it is in BG2; it's been a long time since I've worked with vanilla BG.

Link to comment

I appreciate everyone's help but these suggestions do not work. I renamed the spell from SPPR113.spl to MMDOOM.spl. When I rewrote the spell I tried it like this (commenting out COPY to override) but I used the scroll (MMSC21) in game, the scroll disappeared but no casting animation occurred (it did nothing):

 

COPY ~modmanmod\bam\sppr113a.bam~ ~override~
COPY ~modmanmod\bam\sppr113b.bam~ ~override~
COPY ~modmanmod\bam\sppr113c.bam~ ~override~
COPY ~modmanmod\itm\MMSC21.itm~ ~override~
SAY NAME2 @97
SAY IDENTIFIED_DESC @98
// COPY ~modmanmod\spl\MMDOOM.spl~ ~override~
ADD_SPELL ~modmanmod\spl\MMDOOM.spl~
1 // cleric
1 // level 1
CLERIC_DOOM
SAY NAME1 @97
SAY UNIDENTIFIED_DESC @98
When I uncommented the comment the spell works fine from a scroll. I just can't get it to appear on the chargen book or in the cleric spell book. Again, I have no other spells or mods except Widescreen mod.The bams appear fine on the scroll (I used to have them crash on me before I figured out how to import bams correctly). It casts. The spell has no exclusion flags, and is set to level 1, spell type Cleric/Paladin, all effects are BG1 versions and it works fine from scroll, usability on scroll is set to cleric. The scroll is referencing MMDOOM. I'm just stumped. I've created/modified dozens of wizard spells without issue, I just can't get custom priest spells to appear.
I did notice the ADD_SPELL is adding the spell to the DLTCEP. I created Armor of Faith at SPPR111, and when I call ADD_SPELL on MMDOOM it added it as spell in the next sequence, SPPR112, and I can see that in DLTCEP named correctly, so at least that's working right. Just can't get it on the cleric spell book.
I also tried it like this (no add_spell) but got the same result:
COPY ~modmanmod\bam\sppr113a.bam~ ~override~
COPY ~modmanmod\bam\sppr113b.bam~ ~override~
COPY ~modmanmod\bam\sppr113c.bam~ ~override~
COPY ~modmanmod\itm\MMSC21.itm~ ~override~
SAY NAME2 @97
SAY IDENTIFIED_DESC @98
COPY ~modmanmod\spl\MMDOOM.spl~ ~override~
SAY NAME1 @97
SAY UNIDENTIFIED_DESC @98
Edited by Modman1
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.

Guest
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...