Kill on Spawn, and the Loot bag

I’m able to create the corpse by applying EffectDeath on spawn, and I can prevent corpse fadeaway with SetIsDestroyable to false at On Death.
But… how do I get rid of the sparkly loot bag effect, and just have the corpse a “container” with its treasure?
I’ve tried different Body Bag settings on HeWhoShallDie, but doesn’t seem to matter.

Is there a checkbox for “Leave Lootable Corpse” on the creature template like in NWN1?

Yes NWN2 has a checkbox property “Lootable Corpse”, and in this case, it is set at true.

Should have added this on original msg:

Here’s my on spawn:
ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectDeath(), OBJECT_SELF ) ;

Here’s my on death:
SetIsDestroyable( FALSE,TRUE,TRUE ) ;

It does leave a lootable “object”, that is working. Just that I’d prefer it isn’t sparkly, and let the player decide to rummage around the corpses on the battlefield.

Also, there’s a Body Bag setting, and the bodybag.2da has a column for Appearance, but appearance.2da doesn’t offer much help for the values referenced.
No matter what Body Bag I select for the corpse, it does not seem to change anything that I can tell.

I haven’t looked at this for a long time, but this is from an old script lying around …

void ClearBagSparkles()
{
	object o = GetFirstObjectInArea();
	while (GetIsObjectValid(o))
	{
		if (GetTag(o) == "BodyBag")
			RemoveSEFFromObject(o, "fx_lootbag"); // <<---

		o = GetNextObjectInArea();
	}
}

ie. look into SEF “fx_lootbag” … perhaps on objects w/ Tag “BodyBag” ( i don’t believe the Sef is applied to a corpse, but to a bag under it… )

1 Like

KevL, that finds BodyBag.
But did not remove the SEF, assuming I had the sef named correctly.
I tried fx_lootbag and fx_lootbag.sef.
Is there a way to loop and view all sef in an area, or another loop to view all sef on each object?
I’m not clear if the sef exists as a property of the object, or as its own object.

One thing I do sometimes when I don’t want the Z key to highlight everything is use collision ball with inventory, I could do that here too if necessary.
But, I’m interested in how these sefs work.

void main()
{
	object o = GetFirstObjectInArea();
	object oPC = GetFirstPC(); 
	
	while (GetIsObjectValid(o))
	{
	//	SendMessageToPC(oPC, GetTag(o)); 
		if (GetTag(o) == "BodyBag") 
			RemoveSEFFromObject(o, "fx_lootbag.sef"); 
		o = GetNextObjectInArea();
	}
}
//RWT-OEI 06/07/05
//This function removes 1 instance of a SEF from an object. Since
//an object can only have 1 instance of a specific SEF running on it
//at once, this should effectively remove 'all' instances of the
//specified SEF from the object
void RemoveSEFFromObject( object oObject, string sSEFName );

here’s another note from my old scripts:

//	object oBody = GetNearestObjectByTag("BodyBag", oDragon); // OBJECT_TYPE_PLACEABLE hardcoded object

you might also have a look at “fx_lootbag.sef” in eg. the VisualEffectsEditor plugin

  • fx_lootbag.sef is in Data/NWN2_VFX/FX_Ambient
  • fx_lootbag.sef is in Data/NWN2_VFX_X1/FX_Ambient

( etc? )
I think you have to break them out of the Data/.zips to view them, or use uh Powerbar or smth.

if you really want to pursue this … (i recall eventually giving up and just spawning a chest and putting/copying the loot into it) … create a small area, run your routine to auto-kill one creature in it (make sure it has loot), save the game. Look in your saved games and unpack the save*. Look in the .git file for the area in a GFF editor and find the objects … discover what their gff-variables are

* saved games can be unzipped, then the “-” file will open in Nwn2packer …

 
all in all its a nasty business . . . . . . . .

1 Like