Jump to content

Discussion: BG2 Kit Creation Series


Recommended Posts

Need the help of an expert with kits, please. Berelinde and I have been trying to fix this for days and we are both out of our element. I have a NPC with a custom kit and if a certain thing happens in the game...we're trying to swap the kit for another custom kit. Nothing we have tried so far works. Is there a way to make this happen? Any help would be greatly appreciated.

If the two kits are for the same class, you should be able to use the scripting command AddKit() to change the kit of the creature. An example use in a script/dialogue to make X into a kensai would be ActionOverride("X",AddKit(KENSAI)). Ideally, you'd check to make sure they're a fighter beforehand.

 

The game may have trouble detecting and changing kits in this manner if the BG2 Fixpack is not installed, because the default kit.ids file that comes with the game is messed up.

Link to comment

Thank you for the reply. I'll try it. :)

 

 

Need the help of an expert with kits, please. Berelinde and I have been trying to fix this for days and we are both out of our element. I have a NPC with a custom kit and if a certain thing happens in the game...we're trying to swap the kit for another custom kit. Nothing we have tried so far works. Is there a way to make this happen? Any help would be greatly appreciated.

If the two kits are for the same class, you should be able to use the scripting command to change the kit of the creature. An example use in a script/dialogue to make X into a kensai would be ActionOverride("X",AddKit(KENSAI)). Ideally, you'd check to make sure they're a fighter beforehand.

 

The game may have trouble detecting and changing kits in this manner if the BG2 Fixpack is not installed, because the default kit.ids file that comes with the game is messed up.

Link to comment

Hi Kitanna,

 

I was wondering whether you got your kitswitching to work out. It is not long ago that I made a small kit that does something similar. It is a bardkit that has the possibility to switch to a thief and back at will (an F12 innate). You can find my workflow in this thread.

You probably want to skip to the last pages where I have attached my results or you can check the baf and the readme.

 

 

Anyway. I would put a global change in the dialogue to set that character needs to switch class or kit. In my case I simply change the global using the innate ability. Then I use a sequence of the following to get it done.

 

IF

Global("##changekit","GLOBAL",1)

Kit("X","Custom1")

THEN

RESPONSE #100

ChangeClass("X","FIGHTER") // in my case BARD or THIEF

ActionOverride("X",AddKit("Custom2"))

SetGloblal("##changekit","GLOBAL",2)

END

 

In my case I have a daughterblock that does the reverse again (change custom2 to custom1).

 

I have to make a note that your button bar stays as the custom1 kit UNTIL you reclick your character. So for a bard just switched to a thief I still have bardsong and spellcasting, whereas for a thief just switched to a bard I still have find traps and stealth. However, as you reclick your character you will have your button bar fixed (thief is thief, bard is bard).

 

Perhaps that is the problem you have encountered?

Link to comment
Guest Guest_Justin_*

I worked through the tutorial and got fairly lost on part 4. Before I invest much more time, can some tell me:

 

Is it possible to create a custom mage kit that uses an alternate spell progression table? Or must they all default to MXSPLWIZ.2DA?

 

How do the specialist mage kits encode +1 spell/level? Is it possible to specify another set of rules (i.e. a modification rule for MXSPLWIZ.2DA) for a custom kit?

 

Thanks!

Link to comment
I worked through the tutorial and got fairly lost on part 4. Before I invest much more time, can some tell me:

 

Is it possible to create a custom mage kit that uses an alternate spell progression table? Or must they all default to MXSPLWIZ.2DA?

 

How do the specialist mage kits encode +1 spell/level? Is it possible to specify another set of rules (i.e. a modification rule for MXSPLWIZ.2DA) for a custom kit?

 

Thanks!

I think you can create custom .spl files that use opcode 42 to alter the number of spells you can cast per day, but it wouldn't be able to let you access e.g. level 3 spells before your character was level 5. You'd create the different .spl files to permanently change your kit's number of spells per day, and apply them in your kit's custom CLAB-style 2da file.

Link to comment
Guest Guest_Justin_*
I think you can create custom .spl files that use opcode 42 to alter the number of spells you can cast per day, but it wouldn't be able to let you access e.g. level 3 spells before your character was level 5. You'd create the different .spl files to permanently change your kit's number of spells per day, and apply them in your kit's custom CLAB-style 2da file.

Thanks, I'll keep at it then.

Link to comment
Guest Guest_Justin_*

Wow, I'm green at this material. I've been building a tp2 file for a mage kit, and thinking about the CLAB files, and now I see I need to make some custom SPL files. Rather than me asking questions that are tedious to answer:

 

given that I'm interested in a custom mage kit that alters the spell slots at level up (but not the levels at which spell tiers become available), can anyone link me to someone's mage kit mod - which I can dissect/learn by tweaking?

 

Thanks!

Link to comment

Hello,

 

Please move this to the most appropriate forum, if this isn't it ??? I'm writing a little (?) kit for rangers who worship Mielikki, as the result of ongoing discussion here. I've used the Stalker kit as a template, and am modifying it to agree with suggestions to use a couple spells to populate the CLAB-style 2da file. I'm currently unsure where in that file the fourth-level priest spell Call Woodland Beings (SPPR410) would most appropriately fit, and I need to create a spell "Summon Treant" to add to this file. I have yet to explore the latter.

 

If someone would kindly look over what I've worked up so far, and provide any helpful feedback, I'd greatly appreciate it! I've commented out all the kit data in my .tp2, so I can continue to refine it:

 

// Needle of Mielikki Kit
//ADD_KIT ~EP#Needl~ // internal name of the kit
// appended to CLASWEAP.2da
//~EP#Needl				1		   1		   1		   1		   1		   1		   1		   1~
// appended column-wise to WEAPPROF.2da
//~EP#Needl 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5~	
// appended to ABCLASRQ.2da
//~EP#Needl				13	   13	   14	   0	   14	   0~
// appended to ABCLSMOD.2da
//~EP#Needl				0	   0	   0	   0	   0	   0~
// appended to ABDCDSRQ.2da
//~EP#Needl				17	   17	   0	   0	   17	  0~
// appended to ABDCSCRQ.2da
//~EP#Needl				15	   15	   0	   0	   15	  0~
// appended to ALIGNMNT.2da
//~EP#Needl				1	   0	   0	   1	   0	   0	   1	   0	   0~
// appended to DUALCLAS.2da
//~EP#Needl				0	   1	   0	   0	   0	   0~
// path to your CLAB-style 2da file 
//~Hinaeari/kit/EP#Needl.2da~
// PC races and classes allowed to use this kit, from KITTABLE.2da
//~K_R_H K_R_E K_R_HE~
// usability flags, added to the end of the KITLIST.2da entry
//~0x00004000	 12~
// HLA table to use; see LUABBR.2da
//~Ra0~
// list of starting equipment for PCs starting in ToB. Appended column-wise to 25STWEAP.2da
//~LEAT14 * HELM07 BAG25 RING06 RING31 CLCK02 BOOT01 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN04,2 POTN14,5 BOW18 SW1H39 STAF08~
// Lower, mixed, and help kit names and descriptions, added to KITLIST.2da 
//SAY ~Needle of Mielikki~
//SAY ~Needle of Mielikki~
//SAY ~NEEDLE OF MIELIKKI: Needles are rangers who serve Mielikki. They are considered the most beloved of the Lady of the Forest. They sometimes serve as clergy, but most often act as the warrior arm of the faith and serve a defensive role, protecting the forests from marauders, humanoids, and the followers of the god Malar.~

 

Clearly, this is my first attempt at creating a kit. I've followed the information in the Kit Creation Series, but I currently know nothing about creating spells.

 

TIA for any and all guidance :hm:

Best wishes,

Eric

Link to comment
I'm currently unsure where in that file the fourth-level priest spell Call Woodland Beings (SPPR410) would most appropriately fit, and I need to create a spell "Summon Treant" to add to this file. I have yet to explore the latter.

Since Rangers don't normally gain the ability to cast 4th-level spells, what you probably want to do is make your own custom version of Call Woodland Beings that is changed into an innate (or a lower level priest spell). You can do this quite easily with code at install-time.

 

If someone would kindly look over what I've worked up so far, and provide any helpful feedback, I'd greatly appreciate it! I've commented out all the kit data in my .tp2, so I can continue to refine it:

First off, using // to comment out these lines makes it hard to uncomment them, because they are interspersed with actual comments. Using /* */ to surround the entire ADD_KIT block might be preferable (or even just prefixing the already-commented lines with // as well, so the whole thing can be mass-uncommented quickly). Other than that, the only thing to talk about is the format of the kit names, and it's a very minor problem:

// Lower, mixed, and help kit names and descriptions, added to KITLIST.2da

//SAY ~Needle of Mielikki~

//SAY ~Needle of Mielikki~

Lower and mixed here refer to letter case, so the first should ideally be ~needle of mielikki~. The lower case name is used in character generation, and if yours is in mixed-case, it will stand out against the other kits.

Link to comment
I'm currently unsure where in that file the fourth-level priest spell Call Woodland Beings (SPPR410) would most appropriately fit, and I need to create a spell "Summon Treant" to add to this file. I have yet to explore the latter.

Since Rangers don't normally gain the ability to cast 4th-level spells, what you probably want to do is make your own custom version of Call Woodland Beings that is changed into an innate (or a lower level priest spell). You can do this quite easily with code at install-time.

 

If someone would kindly look over what I've worked up so far, and provide any helpful feedback, I'd greatly appreciate it! I've commented out all the kit data in my .tp2, so I can continue to refine it:

First off, using // to comment out these lines makes it hard to uncomment them, because they are interspersed with actual comments. Using /* */ to surround the entire ADD_KIT block might be preferable (or even just prefixing the already-commented lines with // as well, so the whole thing can be mass-uncommented quickly). Other than that, the only thing to talk about is the format of the kit names, and it's a very minor problem:

// Lower, mixed, and help kit names and descriptions, added to KITLIST.2da

//SAY ~Needle of Mielikki~

//SAY ~Needle of Mielikki~

Lower and mixed here refer to letter case, so the first should ideally be ~needle of mielikki~. The lower case name is used in character generation, and if yours is in mixed-case, it will stand out against the other kits.

 

So, I need to create a modified version of SPPR410, then, and add it to EP#Needl.2DA? I'm looking for information on how to do an innate, but so far, I've found nothing...which probably means I need to keep looking *LOL*. I'll also need to learn how to create the "Create Treant" spell (or innate?), since no such spell currently exists. When I've got that done as a file, I suppose I'd add that to the same .2DA file.

 

Formatting changes mentioned above are done. I added another // in front of each actual comment line. For some reason, I dislike using /*...*/, so I'll stick with slashes, but I'll remember to add extras whenever commenting out a block.

 

Please advise, so I can research, code, and implement these details.

Thanks!

Eric

Link to comment
So, I need to create a modified version of SPPR410
Well you could use this:
// change regular spell to innate
DEFINE_PATCH_MACRO ~spell_to_innate~ BEGIN
 READ_LONG  0x64 "abil_off" ELSE 0
 READ_SHORT 0x68 "abil_num" ELSE 0
 READ_ASCII ("%abil_off%" + 0x04) "bam" (8) // reads the bam filename from ability
 WRITE_SHORT 0x1C 4						 // sets spell type to innate (4)
 WRITE_LONG  0x34 1						 // sets spell level to 1 to avoid scripting issues
 WRITE_EVALUATED_ASCII 0x3A "%bam%" #8	  // writes the bam filename from abilities to spell icon
 FOR ( index = 0; index < abil_num; index = index + 1 ) BEGIN
WRITE_SHORT ("%abil_off%" + 0x02 + (0x28 * "%index%")) 4 // changes ability icon location to innate (4)
READ_SHORT  ("%abil_off%" + 0x12 + (0x28 * "%index%")) "speed" // reads casting speed
PATCH_IF ("%speed%" > 3) BEGIN
  WRITE_SHORT  ("%abil_off%" + 0x12 + (0x28 * "%index%")) ("%speed%" - 2) // reduces casting speed
END ELSE BEGIN
  WRITE_SHORT  ("%abil_off%" + 0x12 + (0x28 * "%index%")) 0 // makes instant
END
 END
END

COPY_EXISTING ~sppr410.spl~ ~override/*******.spl~
 LAUNCH_PATCH_MACRO ~spell_to_innate~

It makes an innate by default from the COPY_EXISTING ~X~ to be the spell ~*******.spl~

The spell name can only have 7 letters so that's why there is only 7 *'s.

And then you put this into the EP#Needl.2DA: "GA_*******", without the quotes to the right spot in the table (so there is no .spl) .

Edited by Jarno Mikkola
Link to comment
So, I need to create a modified version of SPPR410
Well you could use this:
// change regular spell to innate
DEFINE_PATCH_MACRO ~spell_to_innate~ BEGIN
 READ_LONG  0x64 "abil_off" ELSE 0
 READ_SHORT 0x68 "abil_num" ELSE 0
 READ_ASCII ("%abil_off%" + 0x04) "bam" (8) // reads the bam filename from ability
 WRITE_SHORT 0x1C 4						 // sets spell type to innate (4)
 WRITE_LONG  0x34 1						 // sets spell level to 1 to avoid scripting issues
 WRITE_EVALUATED_ASCII 0x3A "%bam%" #8	  // writes the bam filename from abilities to spell icon
 FOR ( index = 0; index < abil_num; index = index + 1 ) BEGIN
WRITE_SHORT ("%abil_off%" + 0x02 + (0x28 * "%index%")) 4 // changes ability icon location to innate (4)
READ_SHORT  ("%abil_off%" + 0x12 + (0x28 * "%index%")) "speed" // reads casting speed
PATCH_IF ("%speed%" > 3) BEGIN
  WRITE_SHORT  ("%abil_off%" + 0x12 + (0x28 * "%index%")) ("%speed%" - 2) // reduces casting speed
END ELSE BEGIN
  WRITE_SHORT  ("%abil_off%" + 0x12 + (0x28 * "%index%")) 0 // makes instant
END
 END
END

COPY_EXISTING ~sppr410.spl~ ~override/*******.spl~
 LAUNCH_PATCH_MACRO ~spell_to_innate~

It makes an innate by default from the COPY_EXISTING ~X~ to be the spell ~*******.spl~

The spell name can only have 7 letters so that's why there is only 7 *'s.

And then you put this into the EP#Needl.2DA: "GA_*******", without the quotes to the right spot in the table (so there is no .spl) .

 

Thank you, kind sir! ??? I named the new .spl as EP#NCWB.spl. I hope this is OK. Added GA_EP#NCWB in the 4th level Ability 1 slot in EP#Needl.2DA. I think that takes care of that. Not sure about the level assignment, but we'll see how it goes.

 

The Treant thing will probably be more tricky...

 

- E

Link to comment

Eric, all innate spells have to be 1st level spells. You can allow access to them at whichever level you choose in the level-advancement table, but the spells will all be first-level spells.

 

Suppose I'm making a kit that will allow a thief to cast a fireball at 2nd level, raise dead at 4th level, and wish at 6th level. Stop laughing, this is an example. Fireball is a 3rd level mage spell, raise dead is a 5th level cleric spell, and wish is a 9th level mage spell. I would use Mike1072's method of customizing the spells to make them innates for my kit and then I would set my versions of fireball, raise dead, adn wish all as first level spells. The kit would control which spells are accessed when by the appropriate 2DA.

Link to comment
Eric, all innate spells have to be 1st level spells. You can allow access to them at whichever level you choose in the level-advancement table, but the spells will all be first-level spells.

 

Suppose I'm making a kit that will allow a thief to cast a fireball at 2nd level, raise dead at 4th level, and wish at 6th level. Stop laughing, this is an example. Fireball is a 3rd level mage spell, raise dead is a 5th level cleric spell, and wish is a 9th level mage spell. I would use Mike1072's method of customizing the spells to make them innates for my kit and then I would set my versions of fireball, raise dead, and wish all as first level spells. The kit would control which spells are accessed when by the appropriate 2DA.

 

Yes, that's what I meant about assigning the "spell": not setting the spell level, but rather the advancement level at which it comes available. You mentioned about setting spells as first level spells, and that's taken care of in the code example Jarno posted, so all is well there.

 

That should take care of the kit. I've dropped the Treant idea entirely. Also, because the scimitar is Mielikki's favored weapon, I thought it would be nice to allow for three stars in S/W/N weapon proficiency.

 

Thanks,

Eric

Link to comment

Almost forgot about this: the kit I'm making is based on the Stalker, but I don't want backstab ability. How do I make sure that's not part of my kit? I already removed everything except for the Call Woodland Beings innnate from the .2DA file. I want to make sure this kit doesn't allow access to arcane spells.

 

So, what needs changing from the Stalker kit to remove backstab and mage spells?

 

Thanks,

Eric

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