I'm trying to send all items attached to player within EEKilled to a 'Grave cross' on death, but for some reason the client does not sync this move, I can only assume I'm going about moving the items incorrectly. On kill, a cross is created, and if you check the cross it is empty and the player corpse has all the items. However if you leave the area and return to force it to sync, the items will properly be displayed on the cross.
Heres a snippet of what I have, just using the headgear for example.
modded class PlayerBase { override void EEKilled(Object killer) { int slot_id vector CrossPOS = this.GetPosition() - "0.3 -0.3 0.3"; vector BodyPOS = this.GetPosition(); ItemBase GraveCrossItem if ( ( CrossPOS[0] > 12600 ) || ( CrossPOS[2] > 1463 && CrossPOS[2] < 3850 ) ) //probably a better way to do this. { GraveCrossItem = ItemBase.Cast( GetGame().CreateObject("DiedOnCoastCross", "0 0 0" ) ); } else { GraveCrossItem = ItemBase.Cast( GetGame().CreateObject("Gravecross", "0 0 0" ) ); } if ( this.FindAttachmentBySlotName("Headgear") != NULL ) { slot_id = InventorySlots.GetSlotIdFromString("Headgear"); InventoryLocation SelectedSlot = new InventoryLocation; ItemBase SelectedItem = ItemBase.Cast(this.FindAttachmentBySlotName("Headgear")); SelectedItem.GetInventory().GetCurrentInventoryLocation(SelectedSlot); InventoryLocation GraveSlot = new InventoryLocation; GraveSlot.SetAttachment(GraveCrossItem, SelectedItem, slot_id); GameInventory.LocationSyncMoveEntity( SelectedSlot, GraveSlot ); } GraveCrossItem.SetPosition( CrossPOS ); super.EEKilled(killer); } }
The config for the cross is very basic, heres that for reference:
class Gravecross: Container_Base { scope=2; displayName="Grave cross"; descriptionShort=""; itemSize[]={10,100}; model="DZ\structures\specific\cemeteries\cemetery_tombstone10.p3d"; forceFarBubble="true"; attachments[]= { "Head", "Shoulder", "Melee", "Headgear", "Mask", "Eyewear", "Gloves", "Armband", "Vest", "Body", "Back", "Hips", "Legs", "Feet" }; };
DiedOnCoastCross is identical, just separate so a separate lifetime value can be used.