Jump to content


Photo

ADD_SPELL not working please help tp2 code

ADD_SPELL custom spell

9 replies to this topic

#1 Modman1

Modman1
  • Members
  • 9 posts

Posted 12 January 2018 - 06:06 AM

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, 12 January 2018 - 06:08 AM.

- From rivers of sorrow, to oceans deep with hope...I have traveled them.

#2 Roxanne

Roxanne

    Modder

  • Modders
  • 1813 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 12 January 2018 - 07:59 AM

 

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.


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#3 subtledoctor

subtledoctor
  • Modders
  • 2315 posts
  • Gender:Male

Posted 12 January 2018 - 09:28 AM

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.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE


#4 Modman1

Modman1
  • Members
  • 9 posts

Posted 12 January 2018 - 09:57 AM

 

 

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, 12 January 2018 - 10:02 AM.

- From rivers of sorrow, to oceans deep with hope...I have traveled them.

#5 Modman1

Modman1
  • Members
  • 9 posts

Posted 12 January 2018 - 10:00 AM

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, 12 January 2018 - 10:04 AM.

- From rivers of sorrow, to oceans deep with hope...I have traveled them.

#6 Roxanne

Roxanne

    Modder

  • Modders
  • 1813 posts
  • Gender:Female
  • Location:Auckland, NZ

Posted 12 January 2018 - 10:10 AM

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

?


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*


#7 Modman1

Modman1
  • Members
  • 9 posts

Posted 12 January 2018 - 10:30 AM

 

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.


- From rivers of sorrow, to oceans deep with hope...I have traveled them.

#8 CamDawg

CamDawg

    Just a simple country Hyper-Chicken

  • Gibberling Poobah
  • 9389 posts
  • Gender:Not Telling

Posted 12 January 2018 - 10:43 AM

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.


I came here with a simple dream: a dream of killing all humans. And this is how it must end? Who's the real seven billion ton robot monster here? Not I. Not... I.


#9 Modman1

Modman1
  • Members
  • 9 posts

Posted 12 January 2018 - 01:03 PM

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, 12 January 2018 - 01:23 PM.

- From rivers of sorrow, to oceans deep with hope...I have traveled them.

#10 subtledoctor

subtledoctor
  • Modders
  • 2315 posts
  • Gender:Male

Posted 12 January 2018 - 02:59 PM

I didn't realize this is for actual BG1, as opposed to BGT or Tutu or BGEE.

No idea how things work on that archaic engine, sorry.

Faiths & Powers: Spell spheres and kit pack for priests and paladins
Might & Guile: Tweaks and kits for warriors and rogues
Scales of Balance: Game tweaks and rule overhauls
NPC_EE: More options for NPCs in BGEE, SoD, & BG2EE




Reply to this topic



  


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users