Game day script - many errors. Help!

Post » Wed May 22, 2013 10:36 am

I must have tried this many times before but never got it working correctly. What is wrong with this script. I used Wiki for the function. Please don't point me to another article in a wiki, just please fix this. Thank you.

Quest Property myquest AutoInt Property PreReqStage AutoInt Property StageToSet AutoObjectReference Property Actor AutoInt Function GetDayOfWeek()	Int GameDaysPassed 	GameDaysPassed = GetPassedGameDays()	return GameDaysPassed % 7EndFunctionEvent OnTriggerEnter(objectreference akactionref)if akactionref == game.getplayer()If myquest.GetStage() == PreReqStageIf GameDaysPassed == 5Actor.Enable()myQuest.SetStage(StageToSet)endifendifendifEndEvent
User avatar
Jessica Raven
 
Posts: 3409
Joined: Thu Dec 21, 2006 4:33 am

Post » Wed May 22, 2013 1:00 am

Quest Property myquest AutoInt Property PreReqStage AutoInt Property StageToSet AutoObjectReference Property akActor AutoInt Function GetDayOfWeek()	Int GameDaysPassed 	GameDaysPassed = GetPassedGameDays()	return GameDaysPassed % 7EndFunctionInt Function GetPassedGameDays()	Float GameTime	Int GameDaysPassed 	GameTime = Utility.GetCurrentGameTime()	GameDaysPassed = GameTime As Int	Return GameDaysPassedEndFunctionEvent OnTriggerEnter(objectreference akactionref)If((akactionref == game.getplayer()) && (myquest.GetStage() == PreReqStage) && (GetDayOfWeek() == 5))	akActor.Enable()	myQuest.SetStage(StageToSet)EndIfEndEvent

I think that should work (it compiles just fine in any case). Here's what was causing the issues:

- The ObjectReference property's name was the same as a type of variable (Actor in this case), which is not allowed.

- GetPassedGameDays() does not exist in the scripts provided with Skyrim, so it had to be taken from the Wiki example where it was used.

- The last If statement tried to compare a variable (GameDaysPassed) that does not exist outside of the GetDayOfWeek() function.

User avatar
Peetay
 
Posts: 3303
Joined: Sun Jul 22, 2007 10:33 am


Return to V - Skyrim