Difference between revisions of "Talk:MoveTo - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Elec0
(Created page with "If I try this script on an object with the reference placed in the worldspace and named. Scriptname E0HelloWorld extends ObjectReference Event onActivate(ObjectRefere...")
 
imported>Cipscis
(You need to use properties)
Line 9: Line 9:


--[[User:Elec0|Elec0]] 00:20, 8 February 2012 (EST)
--[[User:Elec0|Elec0]] 00:20, 8 February 2012 (EST)
: In Papyrus, forms can no longer be referenced directly by their editorIDs. Instead, you need to create a property, and assign the value of that property to the form you're trying to access in the Creation Kit.
: For example:
<source lang="Papyrus">ScriptName E0HelloWorld extends ObjectReference
ObjectReference property WhiterunCOCREF auto
Event onActivate(ObjectReference akActivate)
    Debug.Notification("Teleporting...")
    akActivate.MoveTo(WhiterunCOCREF)
EndEvent</source>
: -- [[User:Cipscis|Cipscis]] 03:34, 8 February 2012 (EST)

Revision as of 03:34, 8 February 2012

If I try this script on an object with the reference placed in the worldspace and named.

  Scriptname E0HelloWorld extends ObjectReference  
  Event onActivate(ObjectReference akActivate)
     Debug.Notification("Teleporting...")
     akActivate.MoveTo(WhiterunCOCREF)
  EndEvent

And it gives me the error that WhiterunCOCREF isn't defined, when I've set the name of the reference to that.

--Elec0 00:20, 8 February 2012 (EST)

In Papyrus, forms can no longer be referenced directly by their editorIDs. Instead, you need to create a property, and assign the value of that property to the form you're trying to access in the Creation Kit.
For example:
ScriptName E0HelloWorld extends ObjectReference

ObjectReference property WhiterunCOCREF auto

Event onActivate(ObjectReference akActivate)
    Debug.Notification("Teleporting...")
    akActivate.MoveTo(WhiterunCOCREF)
EndEvent
-- Cipscis 03:34, 8 February 2012 (EST)