Advertisement
Kalle1111

Quest Script

Feb 24th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. Scriptname BQ_ControlScript extends Quest ;DO NOT COPY THIS LINE
  2.  
  3. ObjectReference Property yourmarker Auto ;Set as the XMarkerHeader you want to teleport your character to
  4.  
  5. ;;;;;;;;;;;;;;;;LEAVE THE VARIABLES DOWN BELOW AS UNDEFINED;;;;;;;;;;;;;;;;;;;;;;;;;;;
  6. String Property stime Auto
  7. String Property stime1 Auto
  8. String Property stime2 Auto
  9.  
  10.  
  11. ;;;;;;;;;;;;;;;;;;;;;;;;;;; Functions;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  12.  
  13. float Function GetCurrentTimeOfDay()
  14. stime = Utility.GameTimeToString(Utility.GetCurrentGameTime()) ;gets the current date and time as a string
  15. stime1 = stringUtil.Substring(stime, 11, 2) ;cuts the amount of hours out of the string above
  16. stime2 = stringUtil.Substring(stime, 14, 2) ;cuts the amount of minutes out of the string 2 lines above
  17. string timecomb = (stime1 + "." + stime2) ;combines the hours and minutes in a "float-like" format
  18. float currenttime = (timecomb as float) ;casts/changes the type to float (decimals)
  19. ;debug.messagebox("This is currenttime float: " + currenttime) ;check to see if the function works properly, disabled currently
  20. Return currenttime ;outputs the current time
  21. EndFunction
  22.  
  23. float Function GetCurrentHourOfDay()
  24. float Time = Utility.GetCurrentGameTime() ;gets current percentage and amount of the day(s) that is over
  25. Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit, leaving only the percentage of the current day
  26. Time *= 24 ; Convert from fraction/percentage of a day to number of hours
  27. Return Time ;outputs the number of hours already over (-> NOT the time, just the amount of hours: 2.9 i.e.)
  28. EndFunction
  29.  
  30. float Function TimeTillEleven()
  31. if (GetCurrentTimeOfDay() < 11.00) ;checks wether it is before our specified time
  32. float h = (11 - GetCurrentHourOfDay()) ;calculates the amount of time until our specified time (currently 11 o' clock) is reached
  33. return h ;outputs the calculated amount
  34. elseif (GetCurrentTimeOfDay() > 13.00) ;check wether it is after our specified time
  35. float h = (24 - GetCurrentHourOfDay() + 11) ;calculates the time until midnight + the hours until our time is reached(currently 11) from there on
  36. return h ;outputs the calculated amount
  37. EndIf
  38. EndFunction
  39.  
  40. Function RequirementsMet()
  41. Game.GetPlayer().MoveTo(yourmarker) ; teleports the player to a location marker
  42. EndFunction
  43.  
  44. Event OnUpdateGameTime() ;ran when the timer is over (11 o'clock is reached)
  45. RequirementsMet() ;Function "RequirementsMet" is ran
  46. EndEvent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement