kxdace Posted September 2, 2019 Posted September 2, 2019 Hello friends! Hopefully this is an easy one. I remove a target NPCs armor with the following script: debug.MessageBox("Stange A Begin") Armor top = akTarget.getWornForm(0x00000004) as Armor akTarget.removeitem(top, 1) akTarget.placeatme(top,1) The armor is removed from them and placed at the NPC feet. Is there anything like akTarget.placeatme(top, 1, X, Y, Z). I am trying to make it so when the armor is removed it appears about chest height on the npc and falls to the floor but all the following attempts have yielded errors. float posx = akTarget.GetPositionX() float posy = akTarget.GetPositionY() float posz = akTarget.GetPositionZ() posz = posz + 20 top.SetPosition(posx, posy, posz) ObjectReference NewObject = akTarget.PlaceAtMe(top, 1, false, true) float posx = akTarget.GetPositionX() float posy = akTarget.GetPositionY() float posz = akTarget.GetPositionZ() posz = posz + 20 NewObject.setposition(posx, posy, posz) Im so lost...
AWP3RATOR Posted September 3, 2019 Posted September 3, 2019 5 hours ago, kxdace said: Hello friends! Hopefully this is an easy one. I remove a target NPCs armor with the following script: debug.MessageBox("Stange A Begin") Armor top = akTarget.getWornForm(0x00000004) as Armor akTarget.removeitem(top, 1) akTarget.placeatme(top,1) The armor is removed from them and placed at the NPC feet. Is there anything like akTarget.placeatme(top, 1, X, Y, Z). I am trying to make it so when the armor is removed it appears about chest height on the npc and falls to the floor but all the following attempts have yielded errors. float posx = akTarget.GetPositionX() float posy = akTarget.GetPositionY() float posz = akTarget.GetPositionZ() posz = posz + 20 top.SetPosition(posx, posy, posz) ObjectReference NewObject = akTarget.PlaceAtMe(top, 1, false, true) float posx = akTarget.GetPositionX() float posy = akTarget.GetPositionY() float posz = akTarget.GetPositionZ() posz = posz + 20 NewObject.setposition(posx, posy, posz) Im so lost... Have you tried MoveTo? Function MoveTo(ObjectReference akTarget, float afXOffset = 0.0, float afYOffset = 0.0, float afZOffset = 0.0, bool abMatchRotation = true) native With this, you might be able to do something like: Move the item to the actor, 1 unit on the Y axis, 2 units under their height akTarget.MoveTo(akActor, 0, 1, akActor.GetHeight() - 2)
AWP3RATOR Posted September 3, 2019 Posted September 3, 2019 Alternatively, you could also use DropObject() on the actor and object - this is already a base function within the engine. https://www.creationkit.com/index.php?title=DropObject_-_ObjectReference
Recommended Posts
Archived
This topic is now archived and is closed to further replies.