Complete Example Scripts: Difference between revisions

Jump to navigation Jump to search
→‎Move an Object to a Specific Location Without Fade: Mode capitalisation etc. consistent, updated to correctly use GetPosition functions, and corrected syntax of line breaks mid-function call
imported>Evernewjoy
imported>Cipscis
(→‎Move an Object to a Specific Location Without Fade: Mode capitalisation etc. consistent, updated to correctly use GetPosition functions, and corrected syntax of line breaks mid-function call)
Line 71: Line 71:


<source lang="papyrus">
<source lang="papyrus">
Scriptname MoveObjExample extends ObjectReference   
ScriptName MoveObjExample extends ObjectReference   


ObjectReference property dest auto
ObjectReference property dest auto


Event onTriggerEnter(ObjectReference ObjRef)  
Event OnTriggerEnter(ObjectReference akActionRef)


  if(ObjRef == game.getplayer())
if (akActionRef == Game.GetPlayer())
    objRef.translateTo(
akActionRef.TranslateTo(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(), \
        dest.x,dest.y,dest.z,
dest.GetAngleX(), dest.GetAngleY(), dest.GetAngleZ(), 500) ; 500 is the speed value, and it's pretty fast
        dest.getangleX(),dest.getangleY(),dest.getangleZ(),
endif
        500)
  endif


;500 is the speed value, and it's pretty fast
EndEvent
 
endEvent
</source>
</source>


Anonymous user

Navigation menu