Jump to content

"Instant" actions


i30817

Recommended Posts

They're really not innit?

 

IF
 Global("GT#KEY","LOCAL",1)  
THEN
 RESPONSE #100
 SetGlobal("GT#KEY","LOCAL",0)
END

IF
   True()
THEN
 RESPONSE #100
   SetGlobal("GT#KEY","LOCAL",1)
   Continue()
END

IF
!Global("GT#KEY","LOCAL",1)
THEN
RESPONSE #100
  DisplayStringHead(Myself,@8)
END

 

It always displays @8, though it obviously shouldn't, if "SetGlobal" really was instant.

Link to comment

its the Continue() it allows the script to continue parsing. the action was done BUT in the case of setting variables the change isn't noticed till the script processing restarts.

 

However in your test script if you dropped the Continue() you'll never see the 3rd block at all since True() is always true and will always cause that block to execute.

 

You're gonna have to allow for some script restarting at times, it's unavoidable.

Link to comment

I wouldn't call it a programming language, but yes, Continue() will cause further triggers to be evaluated before actions are executed. So your variable will not have a new value until the next frame.

 

It's one of the things that makes using Continue() dangerous. They changed its behavior for Icewind Dale II so that some instant actions would take effect before evaluating additional triggers. It also works slightly differently (or something) in BG/TotSC, from what little I remember.

Link to comment

Archived

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

×
×
  • Create New...