I've been getting enough reports on this to warrant me taking a poke; I have a script on a trapdoor in Falskaar that controls transport to and from Skyrim. It simply checks a few things and handles the player's input properly. First it checks if a quest is completed, then if the player has enough money to make the trip. Here is the script:
Scriptname FSKR_BoatTravelSCRIPT extends ObjectReference ObjectReference Property PlayerRef AutoMessage Property AskWulf Auto ;the player still needs to talk to Wulf to establish transportMessage Property NoMoney Auto ;the player cannot afford passage on Wulf's shipObjectReference Property Place1 Auto ;where to stand while showing time passObjectReference Property Place2 Auto ;where to stand when completedImageSpaceModifier Property ISFade Auto ;the ISM to display at end of timelapseQuest Property FSSQ02 AutoMiscObject Property Gold001 AutoGlobalVariable Property FSBoatPrice Auto ;the price of travelling on the boatGlobalVariable Property TimeScale AutoInt Speed ; int to save players set timescaleMessage Property Arrival Auto; Message to display at the end of the cutsceneMessage Property Confirm Auto; Is the player sure they wish to travel on the boat?Quest Property FSFF02 Auto ; for one time misc obj Event OnInit() BlockActivation(True)EndEvent Event OnActivate(ObjectReference akActionRef) If (akActionRef == PlayerRef) If ((PlayerRef as Actor).IsInCombat() == 0) If FSSQ02.GetStage() <= 5 AskWulf.Show() If FSSQ02.IsObjectiveDisplayed(1) == 0 FSSQ02.SetObjectiveDisplayed(1) EndIf ElseIf FSSQ02.GetStage() == 10 If PlayerRef.GetItemCount(Gold001) >= (FSBoatPrice.GetValue()) ; <--- The line that fails for no reason. Global is set correctly (Verified ingame) and player has enough gold! Int iButton = Confirm.Show((FSBoatPrice.GetValue())) If iButton != -1 If iButton == 0 ;travel on the boat Game.DisablePlayerControls(True, True, True, True, True, False, True, False) Speed = (TimeScale.GetValue() as Int) ; Utility.Wait(0.5) PlayerRef.MoveTo(Place1) Utility.Wait(0.5) TimeScale.SetValue(10000) Utility.WaitGameTime(14) TimeScale.SetValue(Speed) Utility.Wait(2) Arrival.Show() ISFade.Apply() Utility.Wait(1.5) PlayerRef.MoveTo(Place2) Utility.Wait(1.5) Game.EnablePlayerControls() PlayerRef.RemoveItem(Gold001, (FSBoatPrice.GetValue() as Int)) If FSFF02.GetStage() < 2 FSFF02.SetStage(2) EndIf ElseIf iButton == 1 ; close the menu ;do nothing EndIf EndIf Else NoMoney.Show((FSBoatPrice.GetValue())) EndIf EndIf EndIf Else Self.Activate(akActionRef, True) EndIfEndEvent
People are reporting that, even with large amounts of gold, the 'You do not have enough money' message is popping up. They've checked the global that it compares to, and the global is set correctly. So the money check line "If PlayerRef.GetItemCount(Gold001) >= (FSBoatPrice.GetValue())" is failing for no apparent reason.
Can anyone think of any reasons why this would fail, and if my script it as fault or not? Not everyone reports this, it works for a vast majority of people. But enough have reported it that I'd like to fix it if I can.
Thanks,
AV