Hey guys, it's rare I post 2 threads at pretty much the same time, however they are two separate issues
It seems like GetPosition(), when called on a Misc Object, returns the values of where the object was originally dropped from the player's inventory, not where it rests now. Has anybody come up against this problem before?
Here is my code. This is attached to a Misc Object. The placed object gets positioned perfectly when the player chooses Set Up where it drops, however if you drop it, grab pick it up (hold E) and move it away, then activate it and select Set Up, the placed object gets placed in it's original position. Also simply walking into the object making it move, not just grabbing it to move it, doesn't return correct values.
Any help appreciated
* The code looks messy because of all of the different variations I have tried to solve the problem.
** I should note that the position is for where it was last dropped. So each time you add it to your inventory, the new position resets.
Activator Property HISTrapActRabbit01 AutoMessage Property HISTrapMiscRabbitMessage AutoMiscObject Property HISTrapMiscRabbit01 Auto Actor Property PlayerREF AutoEvent OnLoad() BlockActivation()EndEventEvent OnActivate(ObjectReference akActionRef) if akActionRef == PlayerREF int iButton = HISTrapMiscRabbitMessage.Show() if iButton == 0; if the player selects Set Up SetMotionType(Motion_Keyframed) SetUpTrap() elseif iButton == 1; if the player select pick up Disable() Delete() PlayerREF.AddItem(HISTrapMiscRabbit01) elseif iButton == 2; if the player select cancel ; endif endifEndEventFunction SetUpTrap() float fPX = Self.GetPositionX() float fPY = Self.GetPositionY() + 15.0 float fPZ = PlayerREF.GetPositionZ() + 27.0 Utility.Wait(0.2) ObjectReference kTrap = PlaceAtMe(HISTrapActRabbit01, 1, False) kTrap.SetMotionType(kTrap.Motion_Keyframed); kTrap.SetPosition(GetPositionX(), GetPositionY(), GetPositionZ()) kTrap.SetPosition(fPX, fPY, fPZ) kTrap.SetAngle(-125.0000, 0.00, 0.00) Disable() Utility.Wait(0.2) Delete()EndFunction