vegae7 Posted May 29, 2016 Share Posted May 29, 2016 Hi. I want to get a Ref from a FormID. But i dont know how. Can anyone help me? Big THX :smile: Scriptname VegaTestScript extends ObjectReference Actor Property PlayerRef Auto Hidden Form Property someForm Auto Hidden Location Property PlayerLocation Auto Hidden Location Property ReflLocation Auto Hidden ObjectReference Property MyTestRef Auto Hidden Event OnClose(ObjectReference akActionRef) PlayerRef = Game.GetPlayer() if (akActionRef == PlayerRef) someForm = Game.GetForm(0x00123456) ;ReflLocation = someForm.GetCurrentLocation() ;MyTestRef = someForm.GetReference() ;MyTestRef = new someForm ;ReflLocation = MyTestRe.GetCurrentLocation() ;MyTestRef = Game.GetReference(0x00123456) PlayerLocation = PlayerRef.GetCurrentLocation() if (PlayerLocation == ReflLocation) Debug.Notification("Same location") else Debug.Notification("Not same location") endif endIf EndEvent Link to comment Share on other sites More sharing options...
DarthWayne Posted May 29, 2016 Share Posted May 29, 2016 (edited) You need the placeAtMe function of ObjectReference. Give in a form object (or anything that extends form) and you get an ObjectReference back. Example: Form property someForm auto const Event OnClose(ObjectReference akActionRef) PlayerRef = Game.GetPlayer() if (akActionRef == PlayerRef) PlayerRef.placeAtMe(someForm) endIf EndEvent Edited May 29, 2016 by DarthWayne Link to comment Share on other sites More sharing options...
Recommended Posts