Script for a quest with time limit

Post » Wed Nov 05, 2014 3:23 pm

I'm making a new quest. In this quest the player has to find an NPC before time runs out.

Searching i found this script, but i dont understand a lot of things (is changed by me, puting my properties names):





Scriptname ScvmagaenapurosTiempoScript extends Quest   GlobalVariable Property GlobalDays auto ;initial days to completeGlobalVariable Property GlobalTime auto ;counter for hours leftQuest Property SCVC1magaenapuros auto ; questint Property FailObjective auto ;int Property FailStage auto ;Int property myStageValue auto; Stage Float endTime Event OnInit()if (TGRDays.GetValue() > 0);Debug.Notification("Starting countdown")GlobalTime.SetValue(GlobalDays.GetValue() * 24)endTime = Utility.GetCurrentGameTime()+GlobalDays.GetValue()SCVC1magaenapuros.UpdateCurrentInstanceGlobal(GlobalTime)RegisterForUpdateGameTime(0.10)EndIfEndEvent Event OnUpdateGameTime()if (!SCVC1magaenapuros.GetCurrentStageID() == myStageValue)UnregisterForUpdateGameTime()EndIffloat step = Math.Ceiling((endTime - Utility.GetCurrentGameTime()) * 24) - GlobalTime.GetValue()if (step != 0)if (0-step > GlobalTime.GetValue()) ;avoid displaying less then 0step = 0 - GlobalTime.GetValue()EndIfif SCVC1magaenapuros.ModObjectiveGlobal(step, GlobalTime, FailObjective, 0, false, false)GlobalTime.SetValue(0.0)SCVC1magaenapuros.UpdateCurrentInstanceGlobal(GlobalTime)SCVC1magaenapuros.SetStage(FailStage)UnregisterForUpdateGameTime()EndIfEndIfEndEvent


And this is what compile error says:

Starting 1 compile threads for 1 files...Compiling "SCVmagaenapurosTiempoScript"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SCVmagaenapurosTiempoScript.psc(13,5): variable TGRDays is undefinedC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SCVmagaenapurosTiempoScript.psc(13,13): none is not a known user-defined typeC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SCVmagaenapurosTiempoScript.psc(13,24): cannot compare a none to a int (cast missing or types unrelated)C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\SCVmagaenapurosTiempoScript.psc(13,24): cannot relatively compare variables to NoneNo output generated for SCVmagaenapurosTiempoScript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on SCVmagaenapurosTiempoScript
What am i doing wrong?
User avatar
Rachael
 
Posts: 3412
Joined: Sat Feb 17, 2007 2:10 pm

Post » Wed Nov 05, 2014 9:15 am

Well the first issue is that you didn't change the variable names in the script to the ones of your properties. It's looking for a property you removed - you don't have the global TGRDays. Exchange it with the proper global you created.

User avatar
Auguste Bartholdi
 
Posts: 3521
Joined: Tue Jun 13, 2006 11:20 am

Post » Wed Nov 05, 2014 4:32 pm

wow! just changing "TGRDays" to "GlobalDays" works fine haha. I have to lear a lot....

By the way, i have no idea what GlobalDays and GlobalTime do. Sorry, i'm not english, and some things are difficult to understand for me.

Nor do i know what i have to change in this script to adapt to my quest :S
User avatar
Melung Chan
 
Posts: 3340
Joined: Sun Jun 24, 2007 4:15 am


Return to V - Skyrim