The Black Wyrm's Lair - Forums

Mod development resources & discussion => The Gathering Hall => Topic started by: St_Vitruvius on April 27, 2007, 09:36:26 AM

Title: Adding kits with an ingame NPC
Post by: St_Vitruvius on April 27, 2007, 09:36:26 AM
I've been trying, unsuccesfully, to figure out how to add kits to a character in BG2 via an ingame NPC, the tutor, to the PC.

The trouble is, that:


AddKit(I:Kit*KIT)


only adds the specified kit to the creature running the script. I want my tutor to add the kit to the pc during a dialogue, where he checks for different conditions. The dialogue and the conditions are allready in place and apparantly working just fine. I just need to figure out how to add the kit.

I believe I have to make him add a script to the PC, that uses the AddKit, but I can't find a way to do that either..

Can anyone help me out? Have anyone tried doing something like this?

EDIT: SConrad and jastey both helped me on SHS and G3 respectively, both pointing me at:


ActionOverride(Player1,AddKit(I:Kit*KIT))


Now the class-name and the kit description is both missing..

Sincerelly
St_Vitruvius
Title: Adding kits with an ingame NPC
Post by: St_Vitruvius on April 27, 2007, 12:08:24 PM
It might be helpfull if I deisplayed the contents of the tp2 and the d, so I've posted it on TeamBG (http://www.teambg.eu/forum/index.php?topic=983.0) where I've asked for help too.. (It's much easier to see what's going on as it doesn't wrap long lines of code..)
Title: Adding kits with an ingame NPC
Post by: St_Vitruvius on May 01, 2007, 06:09:09 PM
I solved the problem! The solution was to make the NPC set a global variable in the d-file:


IF ~~ THEN BEGIN yesAkhVelar
   SAY @22
       IF ~~ THEN DO ~SetGlobal("SRPlayer1Elf_Knight","GLOBAL",1)~ EXIT
END


And then, adding a script to the NPC doing the rest:


IF
Global("SRPlayer1Elf_Knight","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("SRPlayer1Elf_Knight","GLOBAL",2)
ActionOverride(Player1,AddKit(SRElven_Knight))
SmallWait(5)
PauseGame()
END