![]() |
The Black Wyrm's Lair Terms of Use |
![]() ![]() ![]() ![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
![]() ![]() Mod Developer Posts: 210 Joined: 3-December 05 ![]() |
Hello
![]() I want to remove all equipment from my creature when it dies. There are 2 solutions: - Set all items to undropable - Use a script The last one doesn't work : IF Die() THEN RESPONSE #100 DestroyAllEquipment() ReallyForceSpellDead(Myself,RED_HOLY_MIGHT) END Any idea? |
|
|
![]()
Post
#2
|
|
![]() Mathematical poet Retired team member Posts: 159 Joined: 9-July 04 From: Prague, Czech Republic ![]() |
As for script solution try to read my Non-lethal compat tutorial - http://www.blackwyrmlair.net/Tutorials/nonlethal.php . It contains some ideas that can be usable for your needs.
According my testing Die() is quite reliable so there should not be the problem. Have you tried run your script with True() trigger or some checking of debug global to find out whether actions in this block really work? Maybe you could try nest your actions inside ActionOverride... -------------------- |
|
|
![]()
Post
#3
|
|
![]() ![]() Mod Developer Posts: 210 Joined: 3-December 05 ![]() |
Thanks for answer
The trigger "Die" works fine, since my 2nd action is executed. But all items are droped to the ground, so nothing is destroyed. Of course, I could use undropable items, but it would be simplier with a script action. |
|
|
![]()
Post
#4
|
|
Forum Member Posts: 53 Joined: 22-March 05 ![]() |
In Baldur's Gate II, you could use DestroyAllEquipment() or the (misspelled) DestroyAllDestructableEquipment(), but I don't think they work in Baldur's Gate or TotSC (you shouldn't even be able to compile it, so I'm not sure if you're talking BG1).
Marking the items undroppable in the creature file really should be the easiest solution (assuming that Baldur's Gate respects the creature item flags). This would be tougher if you just wanted it for one instance of a generic creature, in which case you'd need to patch the items or make a new creature. Lastly, if you know the inventory, you can just try a bunch of DestroyItem() calls, one for each item. This post has been edited by devSin: Jul 11 2006, 10:22 PM |
|
|
![]()
Post
#5
|
|
Forum Member Posts: 1366 Joined: 22-August 04 From: Germany ![]() |
You could use the area script, with something like
IF Dead("creatureDV") THEN "ActionOverride("creatureDV", DestroyAllEquipment()) That could work. |
|
|
![]()
Post
#6
|
|
![]() ![]() Mod Developer Posts: 210 Joined: 3-December 05 ![]() |
It's a mod for BG2-Tutu / BGT, so it should work
Using undropable flag isn't easy, because I use a patching method for most of creatures in BG1, based on many external files. I would need to add a flag just for 6 creatures. I will test the Jastey solution and keep you informed ![]() |
|
|
![]()
Post
#7
|
|
Forum Member Posts: 59 Joined: 22-July 04 ![]() |
The creature will drop all of its equipment on death, so the script won't fire until after it's already dropped everything. Undroppable flags are pretty easy; below are examples to flag a single item or all items on a creature.
CODE // for a specific item, replace itemname with resref
COPY_EXISTING foo.cre~ ~override~ READ_LONG 0x2bc "itm_off" ELSE 0 READ_LONG 0x2c0 "itm_num" ELSE 0 FOR (index = 0; index < item_num; index = index + 1) BEGIN READ_ASCII ("%itm_off%" + (0x14 * "%index%")) "item" PATCH_IF ("%item%" STRING_COMPARE_CASE "itemname" = 0) BEGIN READ_BYTE ("%itm_off%" + 0x10 + (0x14 * "%index%")) "flags" WRITE_BYTE ("%itm_off%" + 0x10 + (0x14 * "%index%")) ("%flags%" BOR 0b00001000) // adds undroppable flag END END BUT_ONLY_IF_IT_CHANGES // for all items COPY_EXISTING foo.cre~ ~override~ READ_LONG 0x2bc "itm_off" ELSE 0 READ_LONG 0x2c0 "itm_num" ELSE 0 FOR (index = 0; index < item_num; index = index + 1) BEGIN READ_BYTE ("%itm_off%" + 0x10 + (0x14 * "%index%")) "flags" WRITE_BYTE ("%itm_off%" + 0x10 + (0x14 * "%index%")) ("%flags%" BOR 0b00001000) // adds undroppable flag END BUT_ONLY_IF_IT_CHANGES This post has been edited by CamDawg: Jul 12 2006, 11:28 AM -------------------- The Gibberlings Three - Home of IE Mods
The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release. |
|
|
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 10th May 2025 - 11:57 AM |