Skip to content

Script actions from TobEx: Update variables in dialogs instantly

argent77argent77 Member Posts: 3,434
edited January 2016 in Feature Requests
The way how variables are updated in dialogs can be very problematic if you need to refer to the variable later on in the same dialog. To be on the safe side you have to add at least two transitions between the write and read operation which is not always doable.

TobEx implemented very useful new Actions to update variables in dialogs instantly. As the action IDs from TobEx have already been assigned to different actions in the Enhanced Editions I'd like to propose to use the action IDs of the original variable-related actions and add a new parameter to indicate that the variable has to be updated instantly.

Example:
30 SetGlobal(S:Name*,S:Area*,I:Value*) 30 DialogueSetGlobal(S:Name*,S:Area*,I:Value*,I:Unused*,I:Instant*) ... 109 IncrementGlobal(S:Name*,S:Area*,I:Value*) 109 DialogueIncrementGlobal(S:Name*,S:Area*,I:Value*,I:Unused*,I:Instant*) ... 307 SG(S:Name*,I:Num*) 307 DialogueSG(S:Name*,I:Num*,I:Unused*,I:Instant*)
Setting "I:Instant*" to a non-zero value indicates that the variable has to be updated instantly.

Edit: It might be useful to extend this behavior to the timer-related actions as well, even though I see fewer use cases for them in dialogs.
61 StartTimer(I:ID*,I:Time*) 61 DialogueStartTimer(I:ID*,I:Time*,I:Instant*) ... 115 SetGlobalTimer(S:Name*,S:Area*,I:Time*GTimes) 115 DialogueSetGlobalTimer(S:Name*,S:Area*,I:Time*GTimes,I:Unused*,I:Instant*) ... 268 RealSetGlobalTimer(S:Name*,S:Area*,I:Time*GTimes) 268 DialogueRealSetGlobalTimer(S:Name*,S:Area*,I:Time*GTimes,I:Unused*,I:Instant*) ... 377 SetGlobalTimerRandomX(S:Name*,S:Area*,I:Min*GTimes,I:Max*GTimes) 377 DialogueSetGlobalTimerRandomX(S:Name*,S:Area*,I:Min*GTimes,I:Max*GTimes,I:Instant*)
I'm not certain if it's possible to apply it to the new StartRandomTimer() action as well, as it already uses the maximum number of supported integer parameters.
369 StartRandomTimer(I:TimerID*,I:MinTime*,I:MaxTime*) 369 DialogueStartRandomTimer(I:TimerID*,I:MinTime*,I:MaxTime*,I:Instant*)
Post edited by argent77 on
Sign In or Register to comment.