Jump to content

[LE] Creation Kit crashes when trying to make a new script


Recommended Posts

Hi, I am trying to make a new script but the CK crashes. First I had the "the extends script does not exist, please choose one that does" but fixed that with the extraction solution. I think, because now the CK crashes when I try to add my new script.

The script I am adding is from this
http://skyrimmw.weebly.com/skyrim-modding/making-a-custom-follower-skyrim-modding-tutorial

 

Below is my version of the script they used in the tutorial(at the beginning of the tutorial)

 

 

 

Scriptname RHFollowerDialogQuestScript extends Quest

Actor Property PlayerREF Auto

ReferenceAlias Property FollowerAlias Auto

Faction Property DismissedFollowerFaction Auto

Faction Property CurrentHireling Auto

Message Property  FollowerDismissMessage Auto

Message Property  FollowerDismissMessageWedding Auto

Message Property  FollowerDismissMessageCompanions Auto

Message Property  FollowerDismissMessageCompanionsMale Auto

Message Property  FollowerDismissMessageCompanionsFemale Auto

Message Property  FollowerDismissMessageWait Auto

SetHirelingRehire Property HirelingRehireScript Auto


;Property to tell follower to say dismissal line

Int Property iFollowerDismiss Auto Conditional


Function SetFollower(ObjectReference FollowerRef)

     actor FollowerActor = FollowerRef as Actor

     FollowerActor.RemoveFromFaction(DismissedFollowerFaction)

     If FollowerActor.GetRelationshipRank(PlayerREF) <3 && FollowerActor.GetRelationshipRank(PlayerREF) >= 0

          FollowerActor.SetRelationshipRank(PlayerREF, 3)

     EndIf

     FollowerActor.SetPlayerTeammate()

     ;FollowerActor.SetActorValue("Morality", 0)

     FollowerAlias.ForceRefTo(FollowerActor)

     FollowerActor.EvaluatePackage()

EndFunction
 

Function FollowerWait()

     actor FollowerActor = FollowerAlias.GetActorRef() as Actor

     FollowerActor.SetActorValue("WaitingForPlayer", 1)

     SetObjectiveDisplayed(10, abforce = true)

     ;follower will wait 3 days


EndFunction
 

Function FollowerFollow()

     actor FollowerActor = FollowerAlias.GetActorRef() as Actor

     FollowerActor.SetActorValue("WaitingForPlayer", 0)

     SetObjectiveDisplayed(10, abdisplayed = false)

     FollowerActor.EvaluatePackage()

EndFunction

 
Function DismissFollower(Int iMessage = 0, Int iSayLine = 1)

     If FollowerAlias && FollowerAlias.GetActorReference().IsDead() == False

          If iMessage == 0

               FollowerDismissMessage.Show()

          ElseIf iMessage == 1

               FollowerDismissMessageWedding.Show()

          ElseIf iMessage == 2

               FollowerDismissMessageCompanions.Show()

          ElseIf iMessage == 3

               FollowerDismissMessageCompanionsMale.Show()

          ElseIf iMessage == 4

               FollowerDismissMessageCompanionsFemale.Show()

          ElseIf iMessage == 5

               FollowerDismissMessageWait.Show()

          Else

              ;failsafe

              FollowerDismissMessage.Show()

          EndIf

          actor DismissedFollowerActor = FollowerAlias.GetActorRef() as Actor

          DismissedFollowerActor.StopCombatAlarm()

          DismissedFollowerActor.AddToFaction(DismissedFollowerFaction)

          DismissedFollowerActor.SetPlayerTeammate(false)

          DismissedFollowerActor.RemoveFromFaction(CurrentHireling)

          DismissedFollowerActor.SetActorValue("WaitingForPlayer", 0)

          ;hireling rehire function

          HirelingRehireScript.DismissHireling(DismissedFollowerActor.GetActorBase())

          If iSayLine == 1

               iFollowerDismiss = 1

              DismissedFollowerActor.EvaluatePackage()

             ;Wait for follower to say line

             Utility.Wait(2)

          EndIf

             FollowerAlias.Clear()

             iFollowerDismiss = 0

             ;don't set count to 0 if Companions have replaced follower

          If iMessage == 2

               ;do nothing

          EndIf

     EndIf

EndFunction

 

 

Link to comment
Share on other sites

I suggest in CK, making your new script and saving it with nothing in it first. It seems to crash less that way. Additionally, then editing your scripts with a program like Notepad++ makes it a lot easier in my opinion anyways. That way you minimize the likelyhood that the CK crashes, in CK you'll still have to Compile/Save but otherwise you should be alright, and hopefully you don't crash doing that.

Link to comment
Share on other sites

Figured it out! I think I had to use the same name that I put in the name box in the actual script. Or if it was the fact that creating a blank script filled in the top part as it should. Either way it is fixed and script worked! Thank you! :D

Link to comment
Share on other sites

  • Recently Browsing   0 members

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