Jump to content

Stutter Bug Caused by Timer


theacefes

Recommended Posts

I have a timer:

 

IF 
InParty(Player1)
!ActuallyInCombat()
Global("K#TrollAnnoy","GLOBAL", 0)
!GlobalTimerNotExpired("TrollTimer","GLOBAL")
THEN
RESPONSE #100
Dialogue([PC])
RealSetGlobalTimer("TrollTimer","GLOBAL",60)  
END

IF 
InParty(Player1)
!ActuallyInCombat()
Global("K#TrollAnnoy","GLOBAL", 1)
!GlobalTimerNotExpired("TrollTimer","GLOBAL")
THEN
RESPONSE #100
Dialogue([PC])
RealSetGlobalTimer("TrollTimer","GLOBAL",60)  
END

IF 
InParty(Player1)
!ActuallyInCombat()
Global("K#TrollAnnoy","GLOBAL", 2)
!GlobalTimerNotExpired("TrollTimer","GLOBAL")
THEN
RESPONSE #100
Dialogue([PC])
RealSetGlobalTimer("TrollTimer","GLOBAL",60)  
END

IF 
InParty(Player1)
!ActuallyInCombat()
Global("K#TrollAnnoy","GLOBAL", 3)
!GlobalTimerNotExpired("TrollTimer","GLOBAL")
THEN
RESPONSE #100
Dialogue([PC])
RealSetGlobalTimer("TrollTimer","GLOBAL",60)  
END

IF 
InParty(Player1)
!ActuallyInCombat()
Global("K#TrollAnnoy","GLOBAL", 4)
!GlobalTimerNotExpired("TrollTimer","GLOBAL")
THEN
RESPONSE #100
Dialogue([PC])
RealSetGlobalTimer("TrollTimer","GLOBAL",15)  
END

IF 
InParty(Player1)
!ActuallyInCombat()
Global("K#TrollAnnoy","GLOBAL", 5)
!GlobalTimerNotExpired("TrollTimer","GLOBAL")
THEN
RESPONSE #100
Dialogue([PC])
RealSetGlobalTimer("TrollTimer","GLOBAL",30)  
END

IF 
InParty(Player1)
!ActuallyInCombat()
Global("K#TrollAnnoy","GLOBAL", 6)
!GlobalTimerNotExpired("TrollTimer","GLOBAL")
THEN
RESPONSE #100
Dialogue([PC])
RealSetGlobalTimer("TrollTimer","GLOBAL",20)  
END

IF 
InParty(Player1)
!ActuallyInCombat()
Global("K#TrollAnnoy","GLOBAL", 7)
!GlobalTimerNotExpired("TrollTimer","GLOBAL")
THEN
RESPONSE #100
Dialogue([PC])
RealSetGlobalTimer("TrollTimer","GLOBAL",30)  
END

IF 
InParty(Player1)
!ActuallyInCombat()
Global("K#TrollAnnoy","GLOBAL", 8)
!GlobalTimerNotExpired("TrollTimer","GLOBAL")
THEN
RESPONSE #100
Dialogue([PC])
RealSetGlobalTimer("TrollTimer","GLOBAL",60)  
END

 

For some reason the installation keeps failing at THEN RESPONSE #100 Dialogue...

 

I've tried using Interact() but I get a stutter bug. Any suggestions?

 

EDIT: Oops, sorry, should have posted the debug.

 

Compiling 1 dialogue file ...

[Modders Mod/Dialogues/K#Troll.d] PARSE ERROR at line 28 column 14-17
Near Text: THEN
syntax error

[Modders Mod/Dialogues/K#Troll.d]  ERROR at line 28 column 14-17
Near Text: THEN
Parsing.Parse_error
ERROR: parsing [Modders Mod/Dialogues/K#Troll.d]: Parsing.Parse_error
ERROR: compiling [Modders Mod/Dialogues/K#Troll.d]!
Stopping installation because of error.

Link to comment

IF

InParty(Player1)

!ActuallyInCombat()

Global("K#TrollAnnoy","GLOBAL", 0)

!GlobalTimerNotExpired("TrollTimer","GLOBAL")

THEN

RESPONSE #100

Dialogue([PC])

RealSetGlobalTimer("TrollTimer","GLOBAL",60)

END

 

IF

InParty(Player1)

!ActuallyInCombat()

Global("K#TrollAnnoy","GLOBAL", 1)

!GlobalTimerNotExpired("TrollTimer","GLOBAL")

THEN

RESPONSE #100

Dialogue([PC])

RealSetGlobalTimer("TrollTimer","GLOBAL",60)

END

 

 

The coded part is line 28

Link to comment

The debug mentions a problem in a .D, not a .BAF. What's the .D file?

 

What Avenger means is you are mixing real-time timers with game-time timers. So use 115 SetGlobalTimer(S:Name*,S:Area*,I:Time*GTimes) instead of 268 RealSetGlobalTimer(S:Name*,S:Area*,I:Time*GTimes), or alternatively the equivalent triggers.

Link to comment

And the reason for the stutter bug is that Interact() uses the character's B file whereas Dialogue() (and its equivalent actions) use the character's J file. SO if you were the using the wrong one for where you coded the dialogue, it wouldn't be able to fire the talk.

 

Like Andy said, you're setting a RealSetGlobalTimer("TrollTimer","GLOBAL",60) (i.e. real time) but are trying to check a game time timer !GlobalTimerNotExpired("TrollTimer","GLOBAL"), so you'd want !RealGlobalTimerExpired("TrollTimer","GLOBAL"). Either that or change the setting of the timer in the first place to be SetGlobalTimer(...) as opposed to RealSetGlobalTimer(...).

 

Edit: On reading Andy's post again he has a very good point. It's throwing an error with your troll dialogue file not your script file. So have a look there instead.

Link to comment

Archived

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

×
×
  • Create New...