Jump to content

Help needed for a bit of Code.


LooseEnds

Recommended Posts

hi All

 

I've created a Skyrim map which has little activators where the location of major cities are, around skyrim. when activated they will teleport the player to that stones particular destination. Works fine but now I need a bit of coding to test if the player has discovered the destination they are going to teleport too, if they haven't a little message will come up saying something like "Undiscovered Not available" or if the test is true then the player will complete the Action.

 

Its a simple Fast travel script that I use just needs that little bit of code to make the player still have to do all the walking, running and riding stuff to fine all these locations but once that's done its a matter of clicking the map and Walla your there.

 

I've tried linking mapmarkers to the script but no luck. So Im hoping someone will have the code and be able to share it or be able to direct me in the direaction where I might be able to fine this mysterious bit of script code. Thanks

Link to comment
Share on other sites

Thanks for the head-up KunoMochi much appreciated. Took your advice and used "canFastTravelToMarker" worked great.

 

Here how I used the expression:

 

Scriptname PortalStoneActivatorScript extends ObjectReference

ObjectReference Property WinterholdMarkerRef Auto ;***
Spell Property TeleportFX Auto
bool Property canFastTravel Auto

Event OnActivate(ObjectReference akActionRef)
canFastTravel = WinterholdMarkerRef.CanFastTravelToMarker();***
IF canFastTravel == True;***
; cast the flashy spell at whoever activated me
TeleportFX.Cast(self, akActionRef)

; wait a bit while the effects play
Utility.Wait(2.5)

; teleport whoever to the destination
akActionRef.MoveTo(WinterholdMarkerRef)
Game.EnableFastTravel()
Game.FastTravel(WinterholdMarkerRef)
Else
Debug.notification("Sorry! Not Possible..")
EndIF
EndEvent

 

where the " *** " are where I made the changes to the original code.

 

Place my fasttravel code within the IF than Else statements an "Bob's your uncle" works fine. I'm not much of a computer software writer I do alot of copy and paste and a lot of hoping it works but got lucky here. But if their are any suggestion to make the code more efficient please make them.

 

Thanks once again KunoMochi.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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