Author Topic: TimeGT() and TimeLT() triggers  (Read 3094 times)

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
TimeGT() and TimeLT() triggers
« on: July 17, 2006, 10:44:26 AM »
  Does anybody know how the trigger parameter and the current game time are compared?
  I had a script block with a trigger TimeLT(11), the game clock was showing 10am, yet the trigger obviously returned FALSE. When I tried TimeLT(12) instead, all worked perfectly

Offline Macready

  • Planewalker
  • *****
  • Posts: 1801
    • EasyTutu
Re: TimeGT() and TimeLT() triggers
« Reply #1 on: July 17, 2006, 11:05:15 AM »
Hello -

Cancel that.  I don't think my response was helpful.
« Last Edit: July 17, 2006, 11:10:18 AM by Macready »
EasyTutu: Tutu installation made simple.

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: TimeGT() and TimeLT() triggers
« Reply #2 on: July 17, 2006, 11:41:36 AM »
Assuming the script was correct and it was actually 10 AM... I'm not sure.

I think (big emphasis on *think*) the engine may offset the checked time by 30 minutes. So TimeLT(11) would be something like TimeLT(10:30). Or not. I really have no idea.

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: TimeGT() and TimeLT() triggers
« Reply #3 on: July 17, 2006, 12:18:56 PM »
  I hope that the script was correct, by the fact that changing TimeLT(11) to TimeLT(12) let it run perfectly, as I've already said (though one may say you nevar know with 'em scripts)
  The explanation that I can come up with, is as follows. IE interpretes TimeLT(11) as 10 or less. Since 10am on the clock actually means 10 something, so... the rest is obvious. This is just a guess, of course
  I can deal with it, sure enough, but I think that the problem deserves being discussed on the forums

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: TimeGT() and TimeLT() triggers
« Reply #4 on: July 17, 2006, 01:52:21 PM »
  The explanation that I can come up with, is as follows. IE interpretes TimeLT(11) as 10 or less. Since 10am on the clock actually means 10 something, so... the rest is obvious.

Yes, IE scripting functions only use integers, so TimeLT(11) wouldn't include anything between 10 and 11.
"You alone can make my song take flight..."

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: TimeGT() and TimeLT() triggers
« Reply #5 on: July 17, 2006, 09:02:29 PM »
  I've tested the triggers in game at several randomly chosen moments, and looks like I know the explanation. E.g time between 2:30 and 3:30 works as exactly 3 o'clock when TimeLT() and TimeGT() check it. So in this case, here's what the triggers will return

   TimeGT(2): TRUE
   TimeGT(3): FALSE
   TimeLT(3): FALSE
   TimeLT(4): TRUE

  I hope the example explains the general rule

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: TimeGT() and TimeLT() triggers
« Reply #6 on: July 18, 2006, 02:08:29 AM »
This is a valuable information  :D

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: TimeGT() and TimeLT() triggers
« Reply #7 on: July 18, 2006, 08:38:55 AM »
  Avenger, of course it's actually a guess. Theoretically, it's still possible that the triggers count as 3 hours time between say, 2:20 and 3:20 (or 2:59 and 3:59, or whatever), but it's very likely that the border's exactly 30 minutes
   Ten times I tested the triggers at random moments when the game time was X hours and hell knows how many minutes, so 5 times it worked as X o'clock, and five times it was X+1 o'clock. So I bet that my guess is correct

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: TimeGT() and TimeLT() triggers
« Reply #8 on: July 18, 2006, 09:49:35 AM »
My assumption was that time corresponds to the bits in the schedule fields. Which means hours are n:30 to (n+1):29.

You may have proved this, but I can't really tell.

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: TimeGT() and TimeLT() triggers
« Reply #9 on: July 18, 2006, 10:51:42 AM »
Well, i didn't know the schedule works on rounded hours too.

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: TimeGT() and TimeLT() triggers
« Reply #10 on: July 18, 2006, 01:41:04 PM »
  DevSin, I actually haven't proven it, I've only come up with a reasonable guess. The straight way to prove the hypothesis would surely be checking the codes, but that's beyond my competence. Knowing the minutes exactly isn't possible either, so I can only base my guess on statistics
  So if say, 2/3 of all times the triggers interpreted X hours on the game clock as X (and 1/3 as X+1), then my guess would be, that time between (X-1):40 and X:40 was interpreted as X. Likewise, if it were 4/5 and 1/5, it would mean time between (X-1):48 and X:48. But since I got 50-50, the most reasonable hypothesis is that time between (X-1):30 and X:30 (or X:29, that's not very important here) works as X hours

Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: TimeGT() and TimeLT() triggers
« Reply #11 on: July 20, 2006, 01:14:21 PM »
I had a chance to check this out last night. Time is related to the 24 hour schedule used by scheduled objects as thus:
Code: [Select]
bit 0  - 0030 to 0129 - Time(1)  | TimeLT(2)  | TimeGT(0)
bit 1  - 0130 to 0229 - Time(2)  | TimeLT(3)  | TimeGT(1)
bit 2  - 0230 to 0329 - Time(3)  | TimeLT(4)  | TimeGT(2)
bit 3  - 0330 to 0429 - Time(4)  | TimeLT(5)  | TimeGT(3)
bit 4  - 0430 to 0529 - Time(5)  | TimeLT(6)  | TimeGT(4)
bit 5  - 0530 to 0629 - Time(6)  | TimeLT(7)  | TimeGT(5)  // DAWN_START
bit 6  - 0630 to 0729 - Time(7)  | TimeLT(8)  | TimeGT(6)  // DAWN_END
bit 7  - 0730 to 0829 - Time(8)  | TimeLT(9)  | TimeGT(7)
bit 8  - 0830 to 0929 - Time(9)  | TimeLT(10) | TimeGT(8)
bit 9  - 0930 to 1029 - Time(10) | TimeLT(11) | TimeGT(9)
bit 10 - 1030 to 1129 - Time(11) | TimeLT(12) | TimeGT(10)
bit 11 - 1130 to 1229 - Time(12) | TimeLT(13) | TimeGT(11) // NOON
bit 12 - 1230 to 1329 - Time(13) | TimeLT(14) | TimeGT(12)
bit 13 - 1330 to 1429 - Time(14) | TimeLT(15) | TimeGT(13)
bit 14 - 1430 to 1529 - Time(15) | TimeLT(16) | TimeGT(14)
bit 15 - 1530 to 1629 - Time(16) | TimeLT(17) | TimeGT(15)
bit 16 - 1630 to 1729 - Time(17) | TimeLT(18) | TimeGT(16)
bit 17 - 1730 to 1829 - Time(18) | TimeLT(19) | TimeGT(17)
bit 18 - 1830 to 1929 - Time(19) | TimeLT(20) | TimeGT(18)
bit 19 - 1930 to 2029 - Time(20) | TimeLT(21) | TimeGT(19)
bit 20 - 2030 to 2129 - Time(21) | TimeLT(22) | TimeGT(20) // DUSK_START
bit 21 - 2130 to 2229 - Time(22) | TimeLT(23) | TimeGT(21) // DUSK_END
bit 22 - 2230 to 2329 - Time(23) | TimeLT(-)  | TimeGT(22)
bit 23 - 2330 to 0029 - Time(0)  | TimeLT(1)  | TimeGT(-)  // MIDNIGHT
Have fun!
« Last Edit: July 20, 2006, 01:19:22 PM by devSin »

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: