SCRIPTING: Teleporting Player

Post » Tue Jun 19, 2012 9:56 am

Hey Guys,

Not sure if this is fully a scripting fail on my part but heres what i have.

I have my "XMarkerHeading" and my "Trigger Box" and trying to have it so when I enter the Trigger box it teleports me instantly to the XMarkerHeading.

My Trigger box has my script attached with the dest property from my script set to XMarkerHeading. Now when I save the script it gets a error when compiling but I can choose to Save anyway.

Heres the error:
Spoiler

Starting 1 compile threads for 1 files...

Compiling "FenTeleScript"...

d:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FenTeleScript.psc(8,26): missing RPAREN at '\\r\\n'

d:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FenTeleScript.psc(9,42): required (...)+ loop did not match anything at input ','

d:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FenTeleScript.psc(10,42): required (...)+ loop did not match anything at input ','

d:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FenTeleScript.psc(11,42): required (...)+ loop did not match anything at input ','

d:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FenTeleScript.psc(12,39): required (...)+ loop did not match anything at input ','

d:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FenTeleScript.psc(13,39): required (...)+ loop did not match anything at input ','

d:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FenTeleScript.psc(14,39): required (...)+ loop did not match anything at input ','

d:\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\FenTeleScript.psc(15,26): required (...)+ loop did not match anything at input ')'

No output generated for FenTeleScript, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on FenTeleScript

Code:
Scriptname FenTeleScript extends ObjectReferenceObjectReference Property dest  AutoEvent OnTriggerEnter (ObjectReference akActionRef)if (akActionRef == Game.GetPlayer())  akActionRef.TranslateTo(					   dest.GetPositionX(),					   dest.GetPositionY(),					   dest.GetPositionZ(),					   dest.GetAngleX(),					   dest.GetAngleY(),					   dest.GetAngleZ(),					   500)endifendEvent
User avatar
OTTO
 
Posts: 3367
Joined: Thu May 17, 2007 6:22 pm

Post » Mon Jun 18, 2012 8:48 pm

This should work:
Spoiler

Scriptname aaa_trira_BookRead extends ObjectReferenceObjectReference Property dest  AutoEvent OnTriggerEnter (ObjectReference akActionRef)  if (akActionRef == Game.GetPlayer())	akActionRef.TranslateTo( \	  dest.GetPositionX(), \	  dest.GetPositionY(), \	  dest.GetPositionZ(), \	  dest.GetAngleX(), \	  dest.GetAngleY(), \	  dest.GetAngleZ(), \	  500)  endifendEvent

Edit: You need the \ to tell the Papyrus compiler you're continuing the statement on the next line, since Papyrus uses new lines to separate statements, unlike C-style languages which use semicolons.

Edit2: Have you looked into http://www.creationkit.com/MoveTo_-_ObjectReference?
User avatar
LADONA
 
Posts: 3290
Joined: Wed Aug 15, 2007 3:52 am

Post » Mon Jun 18, 2012 7:40 pm

This should work:
Spoiler

Scriptname aaa_trira_BookRead extends ObjectReferenceObjectReference Property dest  AutoEvent OnTriggerEnter (ObjectReference akActionRef)  if (akActionRef == Game.GetPlayer())	akActionRef.TranslateTo( \	  dest.GetPositionX(), \	  dest.GetPositionY(), \	  dest.GetPositionZ(), \	  dest.GetAngleX(), \	  dest.GetAngleY(), \	  dest.GetAngleZ(), \	  500)  endifendEvent

Edit: You need the \ to tell the Papyrus compiler you're continuing the statement on the next line, since Papyrus uses new lines to separate statements, unlike C-style languages which use semicolons.

Edit2: Have you looked into MoveTo?


You Absolute Legend!!!

Im still far off from being a expert at this language but im getting there.

Just adding the "\" to the end of my code made my charcter drift back to the XMarkerHeading which wasnt suitable for my plan but when I rewrote the code with "MoveTo" made it perfect!

This is my New Code:

Scriptname FenTeleScript extends ObjectReference ObjectReference Property dest  AutoEvent OnTriggerEnter (ObjectReference akActionRef)if (akActionRef == Game.GetPlayer())  akActionRef.MoveTo(dest)endifendEvent
User avatar
jasminε
 
Posts: 3511
Joined: Mon Jan 29, 2007 4:12 am

Post » Tue Jun 19, 2012 9:31 am

This should work:
Spoiler

Scriptname aaa_trira_BookRead extends ObjectReferenceObjectReference Property dest  AutoEvent OnTriggerEnter (ObjectReference akActionRef)  if (akActionRef == Game.GetPlayer())	akActionRef.TranslateTo( \	  dest.GetPositionX(), \	  dest.GetPositionY(), \	  dest.GetPositionZ(), \	  dest.GetAngleX(), \	  dest.GetAngleY(), \	  dest.GetAngleZ(), \	  500)  endifendEvent

Edit: You need the \ to tell the Papyrus compiler you're continuing the statement on the next line, since Papyrus uses new lines to separate statements, unlike C-style languages which use semicolons.

Edit2: Have you looked into MoveTo?


Do you know of a way to remove the Fade in and out from the MoveTo Command?
User avatar
Roberto Gaeta
 
Posts: 3451
Joined: Tue Nov 06, 2007 2:23 am

Post » Tue Jun 19, 2012 6:13 am

Nope, no idea.
User avatar
Phillip Hamilton
 
Posts: 3457
Joined: Wed Oct 10, 2007 3:07 pm

Post » Tue Jun 19, 2012 3:23 am

Do you know of a way to remove the Fade in and out from the MoveTo Command?

Have you tried http://www.creationkit.com/SetAlpha_-_Actor 0 before Move, 1 After Move
User avatar
My blood
 
Posts: 3455
Joined: Fri Jun 16, 2006 8:09 am


Return to V - Skyrim