Jump to content

Help with Teleport script


Redblaze

Recommended Posts

@armadoc

The reported error

no viable alternative at input '\\r\\n'

in your specific case refers to the following

If (AkCaster.Getincell == JLV3Arcadia) && (AkCaster.Getincell == JLV3ArcadiaTemple) && (AkCaster.Getincell == JLV3ArcadiaHome)

You did not include () after GetInCell. Papyrus needs that or it will complain and not compile.

Link to comment
Share on other sites

Can't you just create a bool variable "IsHome"?
When the mod first is started you can be sure that the player is not in your target cell so you can initiate that variable as false. Then, as long as there is no other way from or to your cell you can just check "IsHome", teleport the player accordingly and change the variable.

Link to comment
Share on other sites

IsharaMeradin Posted "You did not include () after GetInCell. Papyrus needs that or it will complain and not compile."

 

 

Scriptname JLV3ArcanistTeleportHomeScript extends activemagiceffect
{Teleport Home}

ObjectReference Property JLV3ArcanistReturnMarker Auto
objectReference Property JLV3ArcanistTeleHome Auto

Worldspace Property JLV3Arcadia Auto
Worldspace Property JLV3ArcadiaHome Auto
Worldspace Property JLV3ArcadiaTemple Auto
Message Property MessageError Auto
;Message Box, Can not Teleport in the Void

Actor Property PlayerREF Auto

Event OnEffectFinish(Actor akCaster, Actor akTarget)

If (AkCaster.Getincell () == JLV3Arcadia) && (AkCaster.Getincell () == JLV3ArcadiaTemple) && (AkCaster.Getincell () == JLV3ArcadiaHome)

Elseif
JLV3ArcanistReturnMarker.MoveTo(PlayerREF, 0.0, 0.0,0.0)
AkCaster.Moveto (JLV3ArcanistTeleHome)
Endif

Endevent

-----------------------------

Starting 1 compile threads for 1 files...

Compiling "JLV3ArcanistTeleportHomeScript"...

C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\JLV3ArcanistTeleportHomeScript.psc(13,6): no viable alternative at input '\\r\\n'

No output generated for JLV3ArcanistTeleportHomeScript, compilation failed.

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

Failed on JLV3ArcanistTeleportHomeScript

 

Do not fully understand this. I must be missing something stupid.

Link to comment
Share on other sites

Scriptname JLV3ArcanistTeleportHomeScript extends activemagiceffect
ObjectReference Property returnMarker Auto
objectReference Property homeMarker Auto
Keyword Property locationKeyword Auto

event OnEffectStart(Actor akCaster, Actor akTarget)
Location curLoc = akCaster.GetCurrentLocation()
if(!curLoc.HasKeyword(locationKeyword))
returnMarker.MoveTo(akCaster)
akCaster.MoveTo(homeMarker)
else
akCaster.MoveTo(returnMarker)
endif
endevent

If you cast it outside of home it will teleport home, if you cast it in home it will teleport back.

 

locationKeyword is a new keyword you must create and add to the location of your homes.

 

 

YOU ARE A GENIUS. It worked Better than I hoped. I thought this would take hours, yet with this script and:

 

Scriptname JLV3ArcanistTeleportReturnScript extends activemagiceffect

ObjectReference Property JLV3ArcadiareturnMarker Auto

Event OnEffectStart(Actor akCaster, Actor akTarget)

AkCaster.MoveTo(JLV3ArcadiareturnMarker, 0.0, 0.0, 0.0)

EndEvent

 

It worked beautifully.

 

To all that assisted, thank you. Thank you so very much.

Link to comment
Share on other sites

IsharaMeradin Posted "You did not include () after GetInCell. Papyrus needs that or it will complain and not compile."

 

 

Scriptname JLV3ArcanistTeleportHomeScript extends activemagiceffect

{Teleport Home}

ObjectReference Property JLV3ArcanistReturnMarker Auto

objectReference Property JLV3ArcanistTeleHome Auto

Worldspace Property JLV3Arcadia Auto

Worldspace Property JLV3ArcadiaHome Auto

Worldspace Property JLV3ArcadiaTemple Auto

Message Property MessageError Auto

;Message Box, Can not Teleport in the Void

Actor Property PlayerREF Auto

Event OnEffectFinish(Actor akCaster, Actor akTarget)

If (AkCaster.Getincell () == JLV3Arcadia) && (AkCaster.Getincell () == JLV3ArcadiaTemple) && (AkCaster.Getincell () == JLV3ArcadiaHome)

Elseif

JLV3ArcanistReturnMarker.MoveTo(PlayerREF, 0.0, 0.0,0.0)

AkCaster.Moveto (JLV3ArcanistTeleHome)

Endif

Endevent

-----------------------------

Starting 1 compile threads for 1 files...

Compiling "JLV3ArcanistTeleportHomeScript"...

C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\JLV3ArcanistTeleportHomeScript.psc(13,6): no viable alternative at input '\\r\\n'

No output generated for JLV3ArcanistTeleportHomeScript, compilation failed.

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

Failed on JLV3ArcanistTeleportHomeScript

 

Do not fully understand this. I must be missing something stupid.

Still the same error. GetInCell() not GetInCell ()

Papyrus is very fickle about spacing. Somethings you can get away with a space between, but a lot of things you cannot. This is one of those that you cannot.

 

At any rate, looks like you have something working that is done in a different method than you were originally trying. At least, you've learned something in the process. Hopefully.

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

I really hate to necro a thread, but I want to ask the same thing Vega1942 asked. I can get myself teleported to the play house i'm making, but I can't teleport out. so what do we need for the returnMarker?

If it matters here's what i have:

Scriptname AAA0_Academy_Teleport_Script extends activemagiceffect  


ObjectReference Property returnMarker Auto
ObjectReference Property homeMarker Auto
Keyword Property locationAcademy Auto

Event OnEffectStart(Actor akCaster, Actor akTarget)
Location curLoc = akCaster.GetCurrentLocation()
if(!curLoc.HasKeyword(locationAcademy))
returnMarker.MoveTo(akCaster)
akCaster.MoveTo(homeMarker)
Else
akCaster.MoveTo(returnMarker, 0.0, 0.0, 0.0)
Endif
EndEvent

With this, I can teleport to the location just fine, but I can't teleport back out. The magic effect just plays and does nothing. I don't know anything about scripts at all.


Edited by Jinxxed0
Link to comment
Share on other sites

@Jinxxed0

For your script, you will be putting an xMarker in a cell somewhere (preferably one of your own cells). You then assign that placed reference to the 'returnMarker' property. What the script will do is move that xMarker to the player's current location and teleport the player. Then when you teleport out, the player will be put on the xMarker that was moved. The xMarker will stay at that point until the next time the player wants to teleport and then the xMarker will move to that position.

Link to comment
Share on other sites

@Jinxxed0

For your script, you will be putting an xMarker in a cell somewhere (preferably one of your own cells). You then assign that placed reference to the 'returnMarker' property. What the script will do is move that xMarker to the player's current location and teleport the player. Then when you teleport out, the player will be put on the xMarker that was moved. The xMarker will stay at that point until the next time the player wants to teleport and then the xMarker will move to that position.

ah ha! I see. thank you so much!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...