Minor scripting issue, TimeScale.SetValue() wont work.

Post » Mon Nov 19, 2012 12:01 pm

Hey everyone,

I have a script set up on two door objects that does several things. The doors are on a boat, and the idea is that to use the doors (And travel on the boat) a few conditions need to be met. If they are, the player is moved to a spot and shown a timelapse to simulate the boat ride, then moved to the destination. That's all working just wonderfully, however one command is not working.

I move the player to the other end of the journey, and I intend to increase the timescale in order to show the player a 'timelapse' and then say 'You take the boatride'. The issue is that the timescale is not set. Everything else fires, except the timescale remains at whatever the player set it as. (20, etc) If I change it via console so that the time passes, the rest of the script fires just fine again, except that it doesn't set the timescale back to 20 (Or whatever the player had it at).

Here is the entire script, I want to bold the relevant parts, but it wont let me... It's the GlobalVar property, the Int Speed property, and the GetValue and SetValue timescale lines in the biggest If block there.

Scriptname FSBoatTravelSCRIPT extends ObjectReferenceObjectReference 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 AutoInt ReqStage ;required stage to use the boatInt ObjNum ;objective number in FSSQ02 to displayMiscObject 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 cutsceneEvent OnInit()BlockActivation(True)EndEventEvent OnActivate(ObjectReference akActionRef)If (akActionRef == PlayerRef)  If FSSQ02.GetStage() < ReqStage   AskWulf.Show()   If FSSQ02.IsObjectiveDisplayed(ObjNum) == 0	FSSQ02.SetObjectiveDisplayed(ObjNum)   EndIf  ElseIf FSSQ02.GetStage() == ReqStage   If (PlayerRef.GetItemCount(Gold001)) >= (FSBoatPrice.GetValue())	Game.DisablePlayerControls()	Speed = (TimeScale.GetValue() as Int)	Utility.Wait(0.5)	PlayerRef.MoveTo(Place1)	TimeScale.SetValue(600)	Utility.WaitGameTime(8)	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))   Else	NoMoney.Show((FSBoatPrice.GetValue()))   EndIf  EndIfElse  Self.Activate(akActionRef, True)EndIfEndEvent

So basically the TimeScale.SetValue() lines don't work. I get no errors and it compiles. Any ideas?

Thanks,
AJV
User avatar
i grind hard
 
Posts: 3463
Joined: Sat Aug 18, 2007 2:58 am

Post » Mon Nov 19, 2012 9:56 am

Just checking the obvious first, have you pointed your property at the TimeScale GlobalVariable in the Creation Kit?

Cipscis
User avatar
Laura Elizabeth
 
Posts: 3454
Joined: Wed Oct 11, 2006 7:34 pm

Post » Mon Nov 19, 2012 2:25 pm

Just checking the obvious first, have you pointed your property at the TimeScale GlobalVariable in the Creation Kit?

Cipscis
:facepalm: After all these years I think you know me too well. That was it... I set like all 9 other properties on both doors, and even double checked them, but for some silly reason left Timescale empty.

Thanks!
User avatar
TRIsha FEnnesse
 
Posts: 3369
Joined: Sun Feb 04, 2007 5:59 am

Post » Mon Nov 19, 2012 12:41 pm

Hooking up properties is the scripting equivalent of plugging in a cable for me. The easiest, and last, thing I ever check.
User avatar
Connie Thomas
 
Posts: 3362
Joined: Sun Nov 19, 2006 9:58 am

Post » Mon Nov 19, 2012 6:39 pm

Hooking up properties is the scripting equivalent of plugging in a cable for me. The easiest, and last, thing I ever check.
Same for me... normally. I just totally zoned out for some reason and didn't think it necessary to direct my property to the global. xD How I've made as much as I've made is beyond me...
User avatar
Charlotte X
 
Posts: 3318
Joined: Thu Dec 07, 2006 2:53 am

Post » Mon Nov 19, 2012 3:48 pm

I still forget to set them sometimes, it's usually pretty apparent in the game, but when you've attached the same script to tons of objects (for my decoration mod, every new furniture form needs the move script) it can be almost impossible to test them all.
User avatar
cosmo valerga
 
Posts: 3477
Joined: Sat Oct 13, 2007 10:21 am


Return to V - Skyrim