Jump to content

compiling errors with Skyrim SE custom follower Papyrus script


LadySagitar

Recommended Posts

I made a follower with a custom framework using the guidelines I found on this website:

 

Then I used this video to set up my follower to ride with the player:

 

The mod this video refers to was made for Skyrim:

My mod is for Skyrim SE. I'm not sure if that's where my trouble is coming from.

 

If following the video, I get to 21:24 where the author is writing a script fragment on a scene inside the follower's quest.

 

 

When I attempt the script fragment as indicated, I get this error string:

 

Starting 1 compile threads for 1 files...
Compiling "SF__GallusPlaysFlute_0200FB27"...
C:\Program Files (x86)\Steam\SteamApps\common\Skyrim Special Edition\Data\Scripts\Source\temp\SF__GallusPlaysFlute_0200FB27.psc(8,1): variable aaSagitar_GallusSagitarQuest is undefined
C:\Program Files (x86)\Steam\SteamApps\common\Skyrim Special Edition\Data\Scripts\Source\temp\SF__GallusPlaysFlute_0200FB27.psc(8,30): cannot cast a none to a _gallusforcegreetinitial, types are incompatible
C:\Program Files (x86)\Steam\SteamApps\common\Skyrim Special Edition\Data\Scripts\Source\temp\SF__GallusPlaysFlute_0200FB27.psc(12,1): variable aaSagitar_GallusSagitarQuest is undefined
C:\Program Files (x86)\Steam\SteamApps\common\Skyrim Special Edition\Data\Scripts\Source\temp\SF__GallusPlaysFlute_0200FB27.psc(12,30): cannot cast a none to a _gallusforcegreetinitial, types are incompatible
No output generated for SF__GallusPlaysFlute_0200FB27, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on SF__GallusPlaysFlute_0200FB27
I'm not sure what I'm doing incorrectly. Any help is appreciated. Thanks!

 

Link to comment
Share on other sites

The screenshot might show everything we need but as an attachment it is too small. Clicking on it doesn't make it much bigger.

Either post the script fragment code along with a fresh compiler error

Or figure out how to re-post the screenshot so that it expands to full size when clicked on.

Link to comment
Share on other sites

Thanks for replying.

 

The screenshot is a code fragment:

 

Quest --> Scenes Tab --> Scene titled _GallusPlaysFlute

 

Completion Condition on phase 1 of the scene

 

The papyrus fragment is:

 

 

(aaSagitar_GallusSagitarQuest AS _GallusForcegreetInitial).SummonHorse()
 
Utility.Wait(0.5)
 
(aaSagitar_GallusSagitarQuest AS _GallusForcegreetInitial).Stop_GallusPlaysFluteScene()
Link to comment
Share on other sites

The _GallusForcegreetInitial script:

 

 

 

Scriptname _GallusForcegreetInitial extends Quest
Quest property aaSagitar_GallusSagitarQuest auto
Actor Property aaSagitar_SilverwindHorse auto
Actor Property _GallusCompanionForUpdate Auto
GlobalVariable Property _GallusHorseRidingVar Auto
Bool Property Gallus_IsTryingToRideHorse Auto
Scene Property _GallusPlaysFlute Auto
Event OnUpdateGameTime()
;Debug.MessageBox("Test")
If (_GallusCompanionForUpdate == None)
Debug.MessageBox("We have a Problem")
UnregisterForUpdateGameTime()
Actor Player = Game.GetPlayer()
_GallusCompanionForUpdate.EvaluatePackage()
If (Player.IsOnMount() && !(_GallusCompanionForUpdate.IsOnMount()))
If (!(Gallus_IsTryingToRideHorse))
_GallusPlaysFlute.ForceStart()
EndIf
Gallus_IsTryingToRideHorse = true
ElseIf (Player.IsOnMount() && _GallusCompanionForUpdate.IsOnMount())
Gallus_IsTryingToRideHorse = false;
ElseIf (_GallusCompanionForUpdate.IsOnMount() && !(Player.IsOnMount()))
_GallusHorseRidingVar.SetValue(1)
aaSagitar_SilverwindHorse.EvaluatePackage()
_GallusCompanionForUpdate.EvaluatePackage()
If (_GallusCompanionForUpdate.IsOnMount())
_GallusCompanionForUpdate.Dismount()
EndIf
Gallus_IsTryingToRideHorse = false;
Else
Gallus_IsTryingToRideHorse = false;
EndIf
Else
EndIf
EndEvent
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function SummonHorse()
aaSagitar_SilverwindHorse.MoveTo(_GallusCompanionForUpdate)
aaSagitar_SilverwindHorse.EvaluatePackage()
_GallusCompanionForUpdate.EvaluatePackage()
Utility.Wait(3.0)
EndFunction
Function Stop_GallusPlaysFluteScene()
If(_GallusPlaysFlute.IsPlaying())
_GallusPlaysFlute.Stop()
EndIf
EndFunction

Arron Dominion's original script from the Clara Goldspright mod:

 

 

 

scriptName Clara_ForceGreetInitialIIntro extends Quest
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This property represents the Follower 'Quest'
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Quest property Clara_Followquest auto
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This property represents Mia in the world
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Actor Property Clara_HorseMia Auto
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This property represents the Companion
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Actor Property Clara_ClaraCompanionForUpdate Auto
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This property represents if Clara is riding or not - This way it can be used in various checks elsewhere
;NOTE: This global allows for you to make dialogue that will only occur if she was riding if you wanted To
; Meaning of Values:
; 1 - Not Riding
; 2 - Riding
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GlobalVariable Property Clara_HorseRidingVar Auto
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Check to see if she is trying to mount Mia
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Bool Property Clara_IsSheTryingToRideMia Auto
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This property represents the scene where Clara will give a whistle, and the horse will then appear
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Scene Property Clara_Followquest_HorseWhistle Auto
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;These are the properties associated with the Cape/Hood Logic
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
WorldSpace Property Interiors Auto
WorldSpace Property MarkarthWorld Auto
WorldSpace Property RiftenWorld Auto
WorldSpace Property SolitudeWorld Auto
WorldSpace Property WindhelmWorld Auto
WorldSpace Property WhiterunWorld Auto
Armor Property Claras_Backpack Auto
Armor Property Claras_CapeHoodDown Auto
Armor Property Claras_CapeHoodUp Auto
Armor Property Claras_Gloves Auto
Cell Property RiftenHoneyside Auto
Cell Property MarkarthVlindrelHall Auto
Cell Property SolitudeProudspireManor Auto
Cell Property WindhelmHjerim Auto
Cell Property WhiterunBreezehome Auto
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Despite this name, this contains all of the potions or poisons that are possible to give
; Index 0 - Health Potion
;Index 1 - Frenzy Poison
;Index 2 - Magicka Potion
;Index 3 - Stamina Potion
;Index 4 - Lingering Health Poison
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Potion[] Property HealthPotions Auto
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;This is a setting that dialogue will use for determining if the cloak should be used or not
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
GlobalVariable Property Clara_CloakUse Auto
Event OnInit()
Clara_Followquest.setstage(5)
RegisterForUpdateGameTime(0.0245)
EndEvent
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Event: OnUpdateGameTime
;Purpose: This event will tick/trigger ~every 15 in-game minutes.
; It will go through a variety of checks for NPC dynamic behavior
;
;Parameters: None - UpdateGameTime is just a timer for the in-game clock
;Returns: Events don't return anything
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Event OnUpdateGameTime()
;Debug.MessageBox("Test")
If (Clara_ClaraCompanionForUpdate == None)
Debug.MessageBox("We have a Problem")
;We have to unregister for updates. This check was done to make sure the game still had a NPC to work with
UnregisterForUpdateGameTime()
ElseIf ((Clara_Followquest.GetStage()== 10) || (Clara_Followquest.GetState() > 10))
;Perform check for Clara on Accessories logic
int hoodValue = ShouldWearHood(Clara_ClaraCompanionForUpdate)
int cloakLogic = Clara_CloakUse.GetValue() as INT
If (cloakLogic < 2)
If (hoodValue == 0)
;No Hood Time
Clara_ClaraCompanionForUpdate.RemoveItem(Claras_Backpack)
Clara_ClaraCompanionForUpdate.RemoveItem(Claras_CapeHoodDown)
Clara_ClaraCompanionForUpdate.RemoveItem(Claras_CapeHoodUp)
Clara_ClaraCompanionForUpdate.RemoveItem(Claras_Gloves)
ElseIf (hoodValue == 1)
;Handle Backpack first
If (!(Clara_ClaraCompanionForUpdate.IsEquipped(Claras_Backpack)))
;We need to add the hood and equip
Clara_ClaraCompanionForUpdate.AddItem(Claras_Backpack)
Clara_ClaraCompanionForUpdate.EquipItem(Claras_Backpack)
EndIf
;Handle Cape Hood Down next
If (!(Clara_ClaraCompanionForUpdate.IsEquipped(Claras_CapeHoodDown)))
Clara_ClaraCompanionForUpdate.AddItem(Claras_CapeHoodDown)
Clara_ClaraCompanionForUpdate.EquipItem(Claras_CapeHoodDown)
EndIf
;Handle Gloves
If (!(Clara_ClaraCompanionForUpdate.IsEquipped(Claras_Gloves)))
Clara_ClaraCompanionForUpdate.AddItem(Claras_Gloves)
Clara_ClaraCompanionForUpdate.EquipItem(Claras_Gloves)
EndIf
;Remove the hooded version
Clara_ClaraCompanionForUpdate.RemoveItem(Claras_CapeHoodUp)
ElseIf (hoodValue == 2)
;Handle Backpack first
If (!(Clara_ClaraCompanionForUpdate.IsEquipped(Claras_Backpack)))
;We need to add the hood and equip
Clara_ClaraCompanionForUpdate.AddItem(Claras_Backpack)
Clara_ClaraCompanionForUpdate.EquipItem(Claras_Backpack)
EndIf
;Check Cape Hood Up
If (!(Clara_ClaraCompanionForUpdate.IsEquipped(Claras_CapeHoodUp)))
;We need to add the hood and equip
Clara_ClaraCompanionForUpdate.AddItem(Claras_CapeHoodUp)
Clara_ClaraCompanionForUpdate.EquipItem(Claras_CapeHoodUp)
EndIf
;Handle Gloves
If (!(Clara_ClaraCompanionForUpdate.IsEquipped(Claras_Gloves)))
Clara_ClaraCompanionForUpdate.AddItem(Claras_Gloves)
Clara_ClaraCompanionForUpdate.EquipItem(Claras_Gloves)
EndIf
;Remove the non-hooded version
Clara_ClaraCompanionForUpdate.RemoveItem(Claras_CapeHoodDown)
Else
;We are just eating the -1 for the Do Nothing call
EndIf
EndIf
;Perform horse checks
Actor Player = Game.GetPlayer()
;Clara needs a sanity check here
Clara_ClaraCompanionForUpdate.EvaluatePackage()
;Debug.MessageBox("HERE I GO!")
If (Player.IsOnMount() && !(Clara_ClaraCompanionForUpdate.IsOnMount()))
;Scenario 1 - Player is on a horse, but Clara is Not
;In this scenario, we want to force the horse mount whistle
;This will be done via a forced Scene
If (!(Clara_IsSheTryingToRideMia))
Clara_Followquest_HorseWhistle.ForceStart()
EndIf
;So this doesn't happen over and over
Clara_IsSheTryingToRideMia = true
ElseIf (Player.IsOnMount() && Clara_ClaraCompanionForUpdate.IsOnMount())
;Scenario 2 - Player is on a horse, and Clara is on a horse
;Do nothing in this scenario, so no functions/such will be used
Clara_IsSheTryingToRideMia = false;
ElseIf (Clara_ClaraCompanionForUpdate.IsOnMount() && !(Player.IsOnMount()))
;Scenario 3 - Clara is on a horse, but Player is not
;FIRST: Set Global to not riding
Clara_HorseRidingVar.SetValue(1)
;NEXT: Evaluate Mia's packages
Clara_HorseMia.EvaluatePackage()
;NEXT: Evaluate Clara's packages
Clara_ClaraCompanionForUpdate.EvaluatePackage()
;Finally: Make sure Clara is actually dismounted
If (Clara_ClaraCompanionForUpdate.IsOnMount())
Clara_ClaraCompanionForUpdate.Dismount()
EndIf
Clara_IsSheTryingToRideMia = false;
Else
;Scenario 4 - Player is not on horse, and Clara is not on horse
;Do nothing in this scenario, so no function/such will be used - Except reset the Hore Riding Attempt if it is not already
Clara_IsSheTryingToRideMia = false;
EndIf
Else
;
EndIf
EndEvent
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Function: SummonHorse
;Purpose: This method will move Mia over to Clara
;
;Parameters: Nothing
;Returns: Nothing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function SummonHorse()
Clara_HorseMia.MoveTo(Clara_ClaraCompanionForUpdate)
Clara_HorseMia.EvaluatePackage()
Clara_ClaraCompanionForUpdate.EvaluatePackage()
Utility.Wait(3.0)
EndFunction
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Function: StopWhistleScene
;Purpose: This method will end the Whistle sequence
;
;Parameters: Nothing
;Returns: Nothing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function StopWhistleScene()
If(Clara_Followquest_HorseWhistle.IsPlaying())
Clara_Followquest_HorseWhistle.Stop()
EndIf
EndFunction
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Function: ShouldWearHood
;Purpose: This method will determine if the NPC should be wearing a hood or Not
;
;Parameters: Companion - NPC that will be involved with the hood check
;Returns: Hood = 1 | Hood and Cape = 2 | No Hood = 0 | Irrelevant = -1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Int Function ShouldWearHood(Actor Companion)
;First determine our Weather
Weather currentlyOccuringWeather = Weather.GetCurrentWeather()
;Determine the class of Weather
int weatherClass = currentlyOccuringWeather.GetClassification()
;Determine if this class is considered bad
bool isBad = False
If (weatherClass > 1)
isBad = True
EndIf
;Determine the WorldSpaces for the Actors
Worldspace companionWorldspace = Companion.GetWorldSpace()
Worldspace playerWorldspace = Game.GetPlayer().GetWorldSpace()
If (isBad)
;We have determined there is bad Weather
If (companionWorldspace != playerWorldspace)
;The player is not in the same space as the NPC
;Result - Skip the action
return -1
ElseIf (companionWorldSpace == Interiors)
;Why we are inside who knows
Cell currInteriorCell = Companion.GetParentCell()
;Debug.MessageBox(currInteriorCell)
if ((currInteriorCell == RiftenHoneyside) || (currInteriorCell == MarkarthVlindrelHall) || (currInteriorCell == SolitudeProudspireManor) || (currInteriorCell == WindhelmHjerim) || (currInteriorCell == WhiterunBreezehome))
return 0
Else
;Not in player home
return 1
EndIf
ElseIf ((companionWorldSpace == MarkarthWorld) || (companionWorldSpace == RiftenWorld) || (companionWorldSpace == SolitudeWorld) || (companionWorldSpace == WhiterunWorld) || (companionWorldSpace == WindhelmWorld))
return 1
Else
return 2
EndIf
Else
;Not bad weather, but still need to determine if outside
If ((companionWorldSpace != MarkarthWorld) && (companionWorldSpace != RiftenWorld) && (companionWorldSpace != SolitudeWorld) && (companionWorldSpace != WhiterunWorld) && (companionWorldSpace != WindhelmWorld) &&(companionWorldSpace != Interiors))
return 1
Else
Cell currInteriorCell = Companion.GetParentCell()
;Debug.MessageBox(currInteriorCell)
if ((currInteriorCell == RiftenHoneyside) || (currInteriorCell == MarkarthVlindrelHall) || (currInteriorCell == SolitudeProudspireManor) || (currInteriorCell == WindhelmHjerim) || (currInteriorCell == WhiterunBreezehome))
return 0
Else
;Not in player home
return 1
EndIf
EndIf
EndIf
EndFunction
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Function: PerformGiftGiving
;Purpose: This method will open the gift giving menu, and handle what to do with the return value of Favor Points gained
;
;Parameters: Companion - NPC that will be involved
;Returns: Nothing
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function PerformGiftGiving(Actor Companion)
;First open up the menu
int giftGivingResult = Companion.ShowGiftMenu(true, None, true, true)
;Figure out how to deal with the favor
If (giftGivingResult > 0)
int pickPotionOrPoison = Utility.RandomInt(0, 100)
Actor Player = Game.GetPlayer()
;Figure out which one to give
If (pickPotionOrPoison < 20)
Player.AddItem(HealthPotions[0], 1)
ElseIf (pickPotionOrPoison >= 20 && pickPotionOrPoison < 40)
Player.AddItem(HealthPotions[1], 1)
ElseIf (pickPotionOrPoison >= 40 && pickPotionOrPoison < 60)
Player.AddItem(HealthPotions[2], 1)
ElseIf (pickPotionOrPoison >= 60 && pickPotionOrPoison < 80)
Player.AddItem(HealthPotions[3], 1)
Else
Player.AddItem(HealthPotions[4], 1)
EndIf
EndIf
EndFunction

Edited by LadySagitar
Link to comment
Share on other sites

The compiler error states that the variable aaSagitar_GallusSagitarQuest is undefined.

 

If this is the same quest as the one that the fragment is on, you can use the special variable called kmyquest. See here for details: https://www.creationkit.com/index.php?title=Quest_Stage_Fragments

 

If this is a different quest from the one that the fragment is on, you will need to comment out the code lines containing the variable, compile, add the property variable via the property window, uncomment the previous lines and compile again.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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