Jump to content

(Solved) Positioning Armor In a Room


kxdace

Recommended Posts

Posted

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...

 

 

 

 

 

 

 

 

 

 

Posted
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)

 

 

  • 5 weeks later...

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...