Jump to content

RealGlobalTimerNotExpired-!RealGlobalTimerNotExpired


cmorgan

Recommended Posts

Hey there, folks - I have a slight problem logicing this out. I want to make sure my Dream stuff does not fire at the same time as the BG2 dreams and the Romantic Encounters and one or two other NPC mods "critical moments".

 

There was some work a few years ago trying to come up with a way of parsing the installed game and creating a universal "not when other stuff is available on the dreamscript", but I could never get the code to work - and it required an "end of the install crossmod" solution.

 

So now I need to figure out how to tell the game "look for this timer and skip Aran's block in C-ARAND.BCS if someone else's timer has expired". That way he doesn't come sniffing around while PC is otherwise... err... occupied. I need it to work even if the other mod was not installed/the other timer does not exist.

 

 

as I understand it,

 

!RealGlobalTimerNotExpired("c-arandreamtalk","GLOBAL")

 

evaluates true if

 

1. the real timer (CREAL) has never been set

2. the realtimer (CREAL) has expired

 

RealGlobalTimerNotExpired("othertimer_like_RE_content","GLOBAL")

 

evaluates true if

 

1. the real timer (CREAL) has been set

2. the realtimer (CREAL) has not expired

 

What i need to be able to do is say

 

!RealGlobalTimerNotExpired("c-arandreamtalk","GLOBAL")

OR(2)

!Exists( RealGlobalTimer, "RE_timer" )

RealGlobalTimerNotExpired("RE_timer","GLOBAL")

OR(2)

!Exists( RealGlobalTimer, "Keldorn_Romance_Night_Talk_timer" )

RealGlobalTimerNotExpired("Keldorn_Romance_Night_Talk_timer","GLOBAL")

 

 

etc., etc.

 

Any suggestions?

Link to comment

This, I think

 

!RealGlobalTimerNotExpired("c-arandreamtalk","GLOBAL")

OR(2)

Global("RE_timer","global",0)

RealGlobalTimerNotExpired("RE_timer","GLOBAL")

OR(2)

Global("Keldorn_Romance_Night_Talk_timer","global",0)

RealGlobalTimerNotExpired("Keldorn_Romance_Night_Talk_timer","GLOBAL")

Link to comment

Why not just !RealGlobalTimerExpired("RE_timer") !RealGlobalTimerExpired("Keldorn_Romance_Night_Talk_timer")?

 

RealGlobalTimerExpired() (if it even exists?) would be true if Timer has been set and Timer has expired. Therefore, !RealGlobalTimerExpired() is true if Timer has not been set or Timer has not expired. In other words, OR(2) Global("RE_timer",0) RealGlobalTimerNotExpired("RE_timer"). (Except it's a bit better because RE_timer couldn't have been hashed at all, instead of either not existing or existing but being set to 0.)

Link to comment

So, in effect, the statement is (logically) contained within the RealGlobalTimerExpired()... hmmm.

 

OK, then, to make sure a dearmscripted talk doesn't fire when someone else's (known) dreamscripted talk is set up to, we leverage... hold ion. Gotta go research.

Link to comment

Summary, I think:

 

TREAL

!RealGlobalTimerNotExpired("mytimer","SCOPE") = if it has never been set or has expired = mymod's talk is ready

!RealGlobalTimerExpired("theirtimer","SCOPE") = if othermod's timer has never been set or if it has not yet expired = their talk is not firing this time around

 

TINGAME

!GlobalTimerNotExpired("mytimer","SCOPE") = if it has never been set or has expired = mymod's talk is ready

!GlobalTimerExpired("theirtimer","SCOPE") = if othermod's timer has never been set or if it has not yet expired = their talk is not firing this time around

 

 

But on further research, I found out why we abandoned this idea. Some mods skip this timering entirely and trigger via LOCALS, some use the same timer as LT's or FT's or other talks, and so forth. So there is no "industry standard" to modify into a comprehensive approach; the only thing that could be done would to create a blanket "every block in dreamscript" addition, and hope that no one has stuff tucked in there that shouldn't be delayed. Unfortunately, this is not the case. Some folks have put things into the dreamscript that set up timers, etc, that do not need this kind of blocking, and might result in serious delays and unintended consequences.

 

Bleh. At least I can set up my code to be RE and Ajantis and some of the other night-talks - friendly, so that Aran's stuff doesn't fire when someone else's content is ready to fire.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...