Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scriptname BQ_ControlScript extends Quest ;DO NOT COPY THIS LINE
- ObjectReference Property yourmarker Auto ;Set as the XMarkerHeader you want to teleport your character to
- ;;;;;;;;;;;;;;;;LEAVE THE VARIABLES DOWN BELOW AS UNDEFINED;;;;;;;;;;;;;;;;;;;;;;;;;;;
- String Property stime Auto
- String Property stime1 Auto
- String Property stime2 Auto
- ;;;;;;;;;;;;;;;;;;;;;;;;;;; Functions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- float Function GetCurrentTimeOfDay()
- stime = Utility.GameTimeToString(Utility.GetCurrentGameTime()) ;gets the current date and time as a string
- stime1 = stringUtil.Substring(stime, 11, 2) ;cuts the amount of hours out of the string above
- stime2 = stringUtil.Substring(stime, 14, 2) ;cuts the amount of minutes out of the string 2 lines above
- string timecomb = (stime1 + "." + stime2) ;combines the hours and minutes in a "float-like" format
- float currenttime = (timecomb as float) ;casts/changes the type to float (decimals)
- ;debug.messagebox("This is currenttime float: " + currenttime) ;check to see if the function works properly, disabled currently
- Return currenttime ;outputs the current time
- EndFunction
- float Function GetCurrentHourOfDay()
- float Time = Utility.GetCurrentGameTime() ;gets current percentage and amount of the day(s) that is over
- Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit, leaving only the percentage of the current day
- Time *= 24 ; Convert from fraction/percentage of a day to number of hours
- Return Time ;outputs the number of hours already over (-> NOT the time, just the amount of hours: 2.9 i.e.)
- EndFunction
- float Function TimeTillEleven()
- if (GetCurrentTimeOfDay() < 11.00) ;checks wether it is before our specified time
- float h = (11 - GetCurrentHourOfDay()) ;calculates the amount of time until our specified time (currently 11 o' clock) is reached
- return h ;outputs the calculated amount
- elseif (GetCurrentTimeOfDay() > 13.00) ;check wether it is after our specified time
- float h = (24 - GetCurrentHourOfDay() + 11) ;calculates the time until midnight + the hours until our time is reached(currently 11) from there on
- return h ;outputs the calculated amount
- EndIf
- EndFunction
- Function RequirementsMet()
- Game.GetPlayer().MoveTo(yourmarker) ; teleports the player to a location marker
- EndFunction
- Event OnUpdateGameTime() ;ran when the timer is over (11 o'clock is reached)
- RequirementsMet() ;Function "RequirementsMet" is ran
- EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement