Author Topic: SetTimer() actions  (Read 2410 times)

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
SetTimer() actions
« on: November 16, 2004, 02:10:54 PM »
Does anyone know for sure the difference between
 SetGlobalTimer() and RealSetGlobalTimer() actions?
 Both actions set real time. Maybe, the latter ignores
 events such as DayNight(), but it is just my guess.

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: SetTimer() actions
« Reply #1 on: November 16, 2004, 02:15:59 PM »
The first one sets Game Time the second sets Real Time
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: SetTimer() actions
« Reply #2 on: November 16, 2004, 03:11:18 PM »
RealTimers also continue to count down when the game is paused.  They don't expire any faster if you rest or travel.

Timers will get boosted quite a bit if you rest.  They pause when the game pauses.
Earn Money Sleeping.

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: SetTimer() actions
« Reply #3 on: November 16, 2004, 03:19:51 PM »
Quote
The first one sets Game Time the second sets Real Time
By my experience, the first action, SetGlobalTimer(), sets real time as well

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: SetTimer() actions
« Reply #4 on: November 16, 2004, 03:33:37 PM »
Trust us.
Earn Money Sleeping.

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: SetTimer() actions
« Reply #5 on: November 16, 2004, 03:40:32 PM »
Quote
The first one sets Game Time the second sets Real Time
By my experience, the first action, SetGlobalTimer(), sets real time as well

When have you experienced this?
The color of infinity inside an empty glass.

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: SetTimer() actions
« Reply #6 on: November 16, 2004, 04:22:07 PM »
I may have been misunderstanding terms. What I meant, is that
 SetGlobalTimer(...,300) sets the timer to 300*12=3600 sec,
 i.e. one IN-GAME hour (that's why I miscalled it real time)
 Thanks for the replies.
 By the way, in BioWare scripts they mostly use SetReal... for banters.
Does it mean that I can make banters trigger as often as I want by
 leaving the game paused for a while after each?

Offline DoughyGuy

  • Plaid: It's What's For Dinner!
  • Planewalker
  • *****
  • Posts: 78
  • Rattle-rattle, thunder, clatter, boom-boom-boom!
Re: SetTimer() actions
« Reply #7 on: November 16, 2004, 07:05:37 PM »
If you have the debug mode in your ini file, you can use Ctrl+I to instigate banters, but it goes through all banters, so you may come up with a whole lot of nothing for the first 5 or 6 times, or you may get two in a row... Depends on who's in the party

But yes, if you leave the game paused, no In-Game time will pass, but the counters that control banter will keep going

At least I have found this in my humble experience :)

"That's right! I'm DoughyGuy! I control the world's supply of dairy products! Steak is my ally! Butter does my bidding! Sour cream bows down before me in total abject terror! "

Visit the Land Of The DoughyGuy!

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: SetTimer() actions
« Reply #8 on: November 16, 2004, 08:08:20 PM »
Regular banters are not initiated via script at all, so no, the timers they use don't matter since, uh, they don't exist.

The romance dialogues, however, are controlled via RealTimers.  I think that's what you meant.  And yes, you can leave the game paused for 3000 seconds at a time if you want to see LTs one after the other.  Or you could just type CLUAConsole:SetGlobal("WhoeverRomance","GLOBAL"1) in the console and be done with it.
Earn Money Sleeping.

Offline Lu

  • Planewalker
  • *****
  • Posts: 750
  • Gender: Female
Re: SetTimer() actions
« Reply #9 on: November 16, 2004, 08:33:38 PM »
Again, thanks to everyone and particular thanks to Ghreyfain, for I was about to ask one more question.
 So, it's true that IE triggers B-dialogues on its own, even if there are no respective Interact()
 actions scripted, isn't it?

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: SetTimer() actions
« Reply #10 on: November 17, 2004, 03:02:40 PM »
That's true, yeah.  Of course, if it doesn't find a state in the B.dlg that's true, it won't do anything.
Earn Money Sleeping.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: SetTimer() actions
« Reply #11 on: November 17, 2004, 03:30:16 PM »
The nearest we can figure it is that the game runs an internal timer, and every so often it goes to INTERDIA, selects one of the DLGs at random, and attempts an Interact() on that DLG.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Smoketest

  • Planewalker
  • *****
  • Posts: 59
  • Gender: Male
Re: SetTimer() actions
« Reply #12 on: November 18, 2004, 05:40:49 AM »
Yes, there is an internal timer for game-triggered interactions (banters). The only way to affect it in script is with two actions:

BanterBlockFlag(I:State*BOOLEAN)

If set to TRUE, it turns off the banter timer. Normally it is set to FALSE. The unmodded game doesn't use this action.

BanterBlockTime(I:Time)

Extends the amount of time before a banter triggers. CUT01G.BCS, part of the cutscene with Irenicus in the Promenade, uses this action to temporarily extend the banter timer for 600 seconds. (I'm pretty sure the banter timer is based on real time, because resting, traveling and pausing seem to have no effect on it. That is, doing those things won't shorten the time until the next banter.) I've only seen this action used once in the unmodded game.

As mentioned, Interact lets you initiate a banter without waiting for the internal timer. I don't think Interact has any effect on the internal timer, but I haven't examined it closely. It could either run independantly of the internal timer, or it could reset the internal timer. The IESDP doesn't say.

By the way, information about timers, script actions and everything else Infinity Engine is covered in the IESDP.

Also, don't mix your timer variables. If you set a variable with RealSetGlobalTimer, check it with RealGlobalTimerExpired. Likewise for SetGlobalTimer and GlobalTimerExpired. If you mix your timer variables, you can expect unwanted behavior.

The two different time scales are somewhat similar. A value of 600 is 10 minutes if realtime or two hours if game time. The difference comes when you start resting, traveling and pausing the game. Soon the game-time timer value is much larger than the real-time timer value (when you rest, eight hours gets tacked on to the game-time timer, but only a second or two passes on the real-time timer.) When you set a timer, the duration you specify gets added to the current timer value and stored in the specified variable. When the timer matches the stored value, it triggers and a script can act on that. The timer itself, however, keeps advancing.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: SetTimer() actions
« Reply #13 on: November 18, 2004, 01:02:32 PM »
Yes, there is an internal timer for game-triggered interactions (banters). The only way to affect it in script is with two actions:

BanterBlockFlag(I:State*BOOLEAN)

If set to TRUE, it turns off the banter timer. Normally it is set to FALSE. The unmodded game doesn't use this action.

BanterBlockTime(I:Time)

Extends the amount of time before a banter triggers. CUT01G.BCS, part of the cutscene with Irenicus in the Promenade, uses this action to temporarily extend the banter timer for 600 seconds. (I'm pretty sure the banter timer is based on real time, because resting, traveling and pausing seem to have no effect on it. That is, doing those things won't shorten the time until the next banter.) I've only seen this action used once in the unmodded game.

Very interesting, I'd never seen those before. Or at least, don't recall seeing them. Have you done any research as to whether the selection of which DLG to ping seems to be random or is determined by other factors?
« Last Edit: November 18, 2004, 01:12:38 PM by jcompton »
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline hlidskialf

  • Owner of the first chair with an ale-fridge
  • Planewalker
  • *****
  • Posts: 100
  • Gender: Male
Re: SetTimer() actions
« Reply #14 on: November 18, 2004, 10:47:53 PM »
There's also a breakdown of timer differences in IESDP.
Unknown to most, hlidskialf is the first incarnation of the eternal warrior with a beer fridge in his chair.

Offline Smoketest

  • Planewalker
  • *****
  • Posts: 59
  • Gender: Male
Re: SetTimer() actions
« Reply #15 on: November 19, 2004, 12:20:09 AM »
Very interesting, I'd never seen those before. Or at least, don't recall seeing them. Have you done any research as to whether the selection of which DLG to ping seems to be random or is determined by other factors?

I've done no specific testing. However, in a game experience recently, I got a banter between Jaheira and another party member. For a reason I can't remember, I had to reload (I saved before the banter occured.) This time it took awhile before a banter went off and, when it did, it was between Yoshimo and someone else. So the selection seems to be random. (Jaheira's banter did fire later.)

Another related point is that, since BG1, there have been times when two party members would turn to each other as if to begin dialog, but nothing else would happen (their 'busy' stance timed out and they resumed standing.) This still occurs in BG2. (If you have character movement sounds enabled, it's easier to notice thanks to the audio cue; their armor rustles when this happens.) It may be instances of the banter timer triggering, but no valid banters being available for the selected character(s).

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: SetTimer() actions
« Reply #16 on: November 19, 2004, 12:30:00 AM »
Another related point is that, since BG1, there have been times when two party members would turn to each other as if to begin dialog, but nothing else would happen (their 'busy' stance timed out and they resumed standing.) This still occurs in BG2. (If you have character movement sounds enabled, it's easier to notice thanks to the audio cue; their armor rustles when this happens.) It may be instances of the banter timer triggering, but no valid banters being available for the selected character(s).

Yeah, that one I'd figured. I've just never had the patience to see if the banter selection is random, if it's some sort of cylinder-firing-sequence (2-6-3-5-4-2-6-3-5-4-etc) or what...
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

 

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)?: