How do you allocate custom items to NPCs?
#1
Posted 17 May 2007 - 04:25 AM
Basically, I am trying to have the NPC joing the party with a non-removable custom helm. I could have sworn the answer was in a tutorial I read once, but I am darned if I can find it, so I would welcome any suggestions or advice.
Thanks in advance
Chrysta... could helping her to uncover her past threaten your own future?
"Pity the land in need of Heroes."- Bertolt Brecht
"A little madness, now and then, is relished by the wisest men." - Willy Wonka
#2
Posted 17 May 2007 - 04:52 AM
"She was a fire, and I had no doubt that she had already done her share of burning." - Lord Firael Algathrin
"Most assume that all the followers of Lathander are great morning people. They're very wrong." - Tanek of Cloakwood
we are all adults playing a fantasy together, - cmorgan
#3
Posted 17 May 2007 - 05:01 AM
COPY_EXISTING ~test.cre~ ~override~ ADD_CRE_ITEM ~helm01~ #0 #0 #0 ~NONE~ ~HELMET~ ADD_CRE_ITEM ~xbow07~ #0 #0 #0 ~NONE~ ~WEAPON1~ ADD_CRE_ITEM ~sw2h11~ #0 #0 #0 ~NONE~ ~WEAPON1~ EQUIP TWOHANDED
for example
weidu docs: http://www.weidu.org...iDU.html#htoc31
Edited by ronin, 17 May 2007 - 05:02 AM.
#4
Posted 17 May 2007 - 05:39 AM
#5
Posted 17 May 2007 - 05:42 AM
"She was a fire, and I had no doubt that she had already done her share of burning." - Lord Firael Algathrin
"Most assume that all the followers of Lathander are great morning people. They're very wrong." - Tanek of Cloakwood
we are all adults playing a fantasy together, - cmorgan
#6
Posted 17 May 2007 - 05:47 AM
COPY_EXISTING ~test.cre~ ~override~ ADD_CRE_ITEM ~helm01~ #0 #0 #0 ~NONE~ ~HELMET~ ADD_CRE_ITEM ~xbow07~ #0 #0 #0 ~NONE~ ~WEAPON1~ ADD_CRE_ITEM ~sw2h11~ #0 #0 #0 ~NONE~ ~WEAPON1~ EQUIP TWOHANDED
for example
weidu docs: http://www.weidu.org...iDU.html#htoc31
Thanks ronin - I was looking through tutorials and forgot to check the WeiDU documentation! Dumbass...
If I could just trouble you further to check the following - if I want to add an undroppable helm "Ka#helm.itm", a suit of identified magical armour "Ka#arm.itm" and a plain spear (equipped) and wanted to add them during the installation of NPC "Butthed.cre" (as opposed to an already-existing NPC), would the following work:
COPY ~Butthed.cre~ ~override~ ADD_CRE_ITEM ~Ka#helm~ #0 #0 #0 ~IDENTIFIED&UNSTEALABLE&UNDROPPABLE~ ~HELMET~ ADD_CRE_ITEM ~Ka#armr~ #0 #0 #0 ~IDENTIFIED~ ~ARMOR~ ADD_CRE_ITEM ~sper01~ #0 #0 #0 ~NONE~ ~WEAPON1~ EQUIP TWOHANDED
Thanks in advance
Edited to to posting too soon by accident! Never had these problems with premature interjection before... must be my age...
Edited by Sir Kalthorine, 17 May 2007 - 05:50 AM.
Chrysta... could helping her to uncover her past threaten your own future?
"Pity the land in need of Heroes."- Bertolt Brecht
"A little madness, now and then, is relished by the wisest men." - Willy Wonka
#7
Posted 17 May 2007 - 05:48 AM
By using
ADD_CRE_ITEM ~sw2h11~ #0 #0 #0 ~NONE~ ~WEAPON1~ EQUIP TWOHANDED
for example, the creature will spawn with the weapon already equipped and ready to go. If it's just in an item inventory slot during the CRE generation process, it won't be unless you script it. For the helm, this won't matter, but for weapons, that's significant.
Also, should you decide to change the item at a later time, you don't need to come up with a new CRE. You can just edit or delete the lines in the tp2.
Edit: nevermind, question answered.
Edited by berelinde, 17 May 2007 - 05:49 AM.
"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde
berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum
#9
Posted 17 May 2007 - 06:02 AM
#10
Posted 17 May 2007 - 06:09 AM
Good question - but in my case it is because I am constantly changing ideas about what the NPC is going to have equipment-wise, what custom items I am going to include, where and how they are going to be equipped, etc. So it is actually easier to make the necessary changes via changing a few characters in the TP2 file than it is to fire up NI, load a CRE file, manually change the items round and then save it again.Why make a task harder than what it should be?
Chrysta... could helping her to uncover her past threaten your own future?
"Pity the land in need of Heroes."- Bertolt Brecht
"A little madness, now and then, is relished by the wisest men." - Willy Wonka
#11
Posted 17 May 2007 - 06:13 AM
Why not just assign it to that slot when you make the cre file? Much easier to do it that way.
There are two different approaches, that's all. I think editing .cre file in NI is more reliable than .tp2 patching(when looking at NPC mods which attempt these approaches and the number of item-related bugs in them), but that's just my experience.
IWD NPC, Xan, The Sellswords, Back to Brynnlaw, Assassinations, Dungeon Crawl, Reunion, Branwen, Coran, Tiax, Xan BG1 Friendship
BG1 NPC, Romantic Encounters
#12
Posted 17 May 2007 - 06:27 AM
The only time I've run into trouble with this is when I tried to do it *both* ways, on the same CRE. Through endless NI CRE editing while deciding on equipment, I wound up with a whole folder full of corrupted CREs, and I'm still cleaning up after that mess in v1.2. For v1.3, I'm starting with a bare CRE, adding any items with the tp2, and it's working just fine.Why not just assign it to that slot when you make the cre file? Much easier to do it that way.
There are two different approaches, that's all. I think editing .cre file in NI is more reliable than .tp2 patching(when looking at NPC mods which attempt these approaches and the number of item-related bugs in them), but that's just my experience.
As long as you stick to one system, whichever you decide, you'll be fine.
Edited by berelinde, 17 May 2007 - 06:29 AM.
"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde
berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum
#14
Posted 17 May 2007 - 12:32 PM
I think doing it in the TP2 (well, I like doing *it* anywhere....but that's a different story, I geuss) I just find it's easier.
DS
I'm so good that, if I didn't already exist, someone would invent me!
#15
Posted 17 May 2007 - 01:00 PM
Hence the ermphasis on "trying"Thanks Kellen, but I was trying to be a coding ninja and do it via the TP2, like ronin suggested.
A coding ninja would write their own patching code, rather than relying on a WeiDU function. And the patching code would contain at last one while loop.
Chrysta... could helping her to uncover her past threaten your own future?
"Pity the land in need of Heroes."- Bertolt Brecht
"A little madness, now and then, is relished by the wisest men." - Willy Wonka
#16
Posted 17 May 2007 - 01:27 PM
IF Global("NPCGear","LOCALS",1) //Whatever my other conditions will be THEN RESPONSE #100 SetGlobal("NPCGear","LOCALS",1) GiveItemCreate("NPCArmor",Myself,0,0,0) // Armor FillSlot(SLOT_ARMOR) GiveItemCreate("NPCShiny",Myself,0,0,0) // Amulet FillSlot(SLOT_AMULET) GiveItemCreate("NPCSword",Myself,0,0,0) // sword FillSlot(SLOT_WEAPON1) GiveItemCreate("NPCBow",Myself,0,0,0) // bow FillSlot(SLOT_WEAPON2) GiveItemCreate("POTN55",Myself,5,1,1) // Potion of Superior Healing FillSlot(SLOT_MISC1) END
Hope this helps give you ideas
Cuv
#17
Posted 17 May 2007 - 02:14 PM
Global("NPCGear","LOCALS",0)
"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde
berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum
#18
Posted 17 May 2007 - 03:57 PM
If you're going to go that route, your first trigger had better be
Global("NPCGear","LOCALS",0)
LOL... of course, me bad. Just trying to give sir K some other options.
You can also CreateItemSlot
Cuv
#20
Posted 18 May 2007 - 10:46 AM
if you are looking for things to work across different platform installs, the tp2 way allows the most flexibility and the quickest fix (no need to open anything other than a text editor, edit a line, and save - RTG). It takes care of Tutu's dynamic sttref problem, and leaves you with a single code "snapshot" of your .cre, including sound references, items, proficiencies, etc., etc. . I am kind of leaning towards just creating all creatures from existing resources and patching them, instead of distributing .cres, but that's because I am crazy.
The 2k file for a .cre put through NI or DLTCEP is the simplest to do graphically. I don't know whether a separate file or 30 lines in a tp2 is more space saving or not.
The caveat for both is make sure the associated BAMs are available in non-ToB installs - you could either distribute the custom item BAMs directly, or just make sure you use stock ones from SoA (those will work across Tutu, BGT, BG2 SoA and ToB). That saves you corrupted or missing icons bug reports when your ToB based item is installed on a SoA or Tutu install...
(so if Chrysta has BG1 content of any type, and you wanted to go for Tutu and BGT, tp2 is the way to go. Assign soundset, items, animations, you name it - and you are all done!)
Edited by cmorgan, 18 May 2007 - 10:46 AM.