Jump to content

Containers? How do they work!


JakubDaviau

Recommended Posts

Regarding teleportation, I havent done it in Skyrim (I have in Fallout), but I would suggest adding 2 XMarkerHeading(s) to the game and use scripts something like these (Note I'm using the OnActivate() event but you will probably want to use a spell related event, but I havent done any spells yet)

 

Saving the current player location

scriptName TeleportSaveLocation extends ObjectReference

ObjectReference Property myReturnMarker auto
{Set this to the XMarkerHeading that is to be used as a return point}
Float MyAngleX
Float MyAngleY
Float MyAngleZ

Event OnActivate(ObjectReference triggerRef)
;  Get the players current rotation
MyAngleX = Game.GetPlayer().GetAngleX()
MyAngleY = Game.GetPlayer().GetAngleY()
MyAngleZ = Game.GetPlayer().GetAngleZ()

;  Move the Xmarker to the players position and rotate acordingly
MyReturnMarker.MoveTo(Game.GetPlayer())
MyReturnMarker.SetAngle(MyAngleX, MyAngleY, MyAngleZ)
EndEvent

 

Teleporting back to a saved location

scriptName TeleportMoveToLocation extends ObjectReference

ObjectReference Property MyReturnMarker auto
{Set this to the XMarkerHeading that is to be used as a return point}

Event OnActivate(ObjectReference triggerRef)
;  Move the player to the previously saved location
Game.GetPlayer().moveto(MyReturnMarker)
EndEvent

 

Teleporting home

scriptName TeleportMoveToHome extends ObjectReference

ObjectReference Property MyHomeMarker auto
{Set this to the XMarkerHeading that is to be used as a return point}

Event OnActivate(ObjectReference triggerRef)
;  Move the player to the home location
Game.GetPlayer().moveto(MyHomeMarker)
EndEvent

 

I havent actually tryed these ingame, but you know what they say "A compiles as good as a test" ;)

 

it look so complicated D: I thought it would be fairly small script and easy to make since all I want is object that teleports player to specific location nothing more it doesn't even have to teleport him back ill have different one for that but thank you ill try to figure them out and perhaps they will work. I edited source script for that object I was talking about sphere port, and there was this line:

 

playAnimation("open")

wait(2)

playAnimation("close")

 

could it be added to the script so object would be animated? I would want that "open" animation to be played when player activates object then he gets teleported and animation "close" plays afterwards would that work?

Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Don't see any reason why not.

 

If you are teleporting to pre-defined places then you only need the small scripts, the first script was for if you were creating a Mark/Recall style spell set.

 

But where should I stick that line with open and close animations? To be honest I never did any scripting before and I'm a bit afraid its over my head :(

and will that script work as spell? It wont be a spell right? because I want the object that I will attach script to to act as teleporter just to be clear

Link to comment
Share on other sites

I would guess that you want to use the OnEffectStart event attached to a magic spell. But like I said earlier I haven't done any spells so maybe somebody with some experiance can help, failing that you'll have to look at some of the existing spells.

 

Well scripting is a nit over my head so i have to have a hope that someone can help me with it. If someone is reading this to spare your time: I need a script that teleport player to specified area when activated and i need it to include this line"

 

playAnimation("open")

wait(2)

playAnimation("close")

 

And after player activates object with that script object should first play "open" animation, then teleport player to specified area and then play "close" animation. I would be very happy if someone could help me with this.

Link to comment
Share on other sites

Hey im trying ot use this script:

 

scriptName TeleportMoveToLocation extends ObjectReference

 

ObjectReference Property MyReturnMarker auto

{Set this to the XMarkerHeading that is to be used as a return point}

 

Event OnActivate(ObjectReference triggerRef)

; Move the player to the previously saved location

Game.GetPlayer().moveto(MyReturnMarker)

EndEvent

 

But how do I specify where this script should teleport the player? should I put xmarkerheading in the cell and then just put his ID number in the "myreturnmarker place in script or what?

Link to comment
Share on other sites

Yes, put an xMarkerHeading in your cell. Double click your activator (the object with your script) and scroll to the scripts tab. Then, set the property for MyReturnMarker to the xMarkerHeading. You don't have to change anything to the scripts source code. Edited by Ghaunadaur
Link to comment
Share on other sites

Yes, put an xMarkerHeading in your cell. Double click your activator (the object with your script) and scroll to the scripts tab. Then, set the property for MyReturnMarker to the xMarkerHeading. You don't have to change anything to the scripts source code.

 

I don't quite get it, I click on "properties" of that mod and window shows where in the lower left corner I click on "add property" and now I'm In new smaller window but I don't know what "type" I should choice and what initial value? should I put xmarkerheading's ID number in there?

Link to comment
Share on other sites

Not add property. Select the existing property and click edit value on the right hand side. Then choose your xmarkerheading.

 

But there aren't any properties property list for that script is empty, maybe the script is wrong hmm

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...