Lauriel Posted August 23, 2021 Share Posted August 23, 2021 (edited) I'm pretty sure the answer to this is 'no', other than having all subsequent triggers return false. Which means if you have 10 blocks, only want 1 to run, you have to make sure their triggers all exclude all the other possibilities. There's no other to say 'just stop already!'? EDIT: BTW, I did try testing for 'DidIt = 0' and setting 'DidIt = 1' inside script blocks and the dialogues they call, but it just doesn't matter. DidIt won't get set until after the entire script is finished running. Edited August 23, 2021 by Lauriel Quote Link to comment
jastey Posted August 23, 2021 Share Posted August 23, 2021 49 minutes ago, Lauriel said: BTW, I did try testing for 'DidIt = 0' and setting 'DidIt = 1' inside script blocks and the dialogues they call, but it just doesn't matter. DidIt won't get set until after the entire script is finished running. I am highly surprised to hear this, unless you included Continue() into the script blocks. Would you post your test example? Quote Link to comment
lynx Posted August 23, 2021 Share Posted August 23, 2021 Indeed, something is fishy. On creature scripts, run-once events are often done by using a separate script slot then using ChangeAIScript("", slot) after the payload. I think you have blocking actions in the same response block as your setglobal, so it doesn't all execute at once. Quote Link to comment
Lauriel Posted August 23, 2021 Author Share Posted August 23, 2021 43 minutes ago, jastey said: am highly surprised to hear this, unless you included Continue() into the script blocks. Would you post your test example? Spoiler /////////////////////////////////////////////////////////////// // Allow NPCs to say goodbye before the group splits // // Parsed via main_sod.tpa called via #LAdvGm1.d and #LShare // // Dialogue needs to go in a certain order in some cases // /////////////////////////////////////////////////////////////// IF IsValidForPartyDialogue("JAHEIRA") Global("#L_SaidBye","GLOBAL",0) TriggerOverride("JAHEIRA",Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride("JAHEIRA",See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) SetGlobal("#L_SaidBye","GLOBAL",1) EndCutSceneMode() ActionOverride("JAHEIRA",Dialogue(Myself)) Wait(3) END IF IsValidForPartyDialogue("DYNAHEIR") Global("#L_SaidBye","GLOBAL",0) TriggerOverride("DYNAHEIR",Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride("DYNAHEIR",See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) SetGlobal("#L_SaidBye","GLOBAL",1) EndCutSceneMode() ActionOverride("DYNAHEIR",Dialogue(Myself)) Wait(3) END IF !Name("None",Player2) IsValidForPartyDialogue(Player2) Global("#L_SaidBye","GLOBAL",0) TriggerOverride(Player2,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player2,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) SetGlobal("#L_SaidBye","GLOBAL",1) EndCutSceneMode() ActionOverride(Player2,Dialogue(Myself)) Wait(3) END IF NumInPartyGT(2) !Name("None",Player3) IsValidForPartyDialogue(Player3) Global("#L_SaidBye","GLOBAL",0) TriggerOverride(Player3,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player3,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) SetGlobal("#L_SaidBye","GLOBAL",1) EndCutSceneMode() ActionOverride(Player3,Dialogue(Myself)) Wait(3) END IF NumInPartyGT(3) !Name("None",Player4) IsValidForPartyDialogue(Player4) Global("#L_SaidBye","GLOBAL",0) TriggerOverride(Player4,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player4,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) SetGlobal("#L_SaidBye","GLOBAL",1) EndCutSceneMode() ActionOverride(Player4,Dialogue(Myself)) Wait(3) END IF NumInPartyGT(4) !Name("None",Player5) IsValidForPartyDialogue(Player5) Global("#L_SaidBye","GLOBAL",0) TriggerOverride(Player5,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player5,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) SetGlobal("#L_SaidBye","GLOBAL",1) EndCutSceneMode() ActionOverride(Player5,Dialogue(Myself)) Wait(3) END IF IsValidForPartyDialogue(Player6) Global("#L_SaidBye","GLOBAL",0) TriggerOverride(Player6,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player6,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) SetGlobal("#L_SaidBye","GLOBAL",1) EndCutSceneMode() ActionOverride(Player6,Dialogue(Myself)) Wait(3) END IF True() THEN RESPONSE #100 CutSceneId(Player1) SetGlobal("#L_SaidBye","GLOBAL",0) EndCutSceneMode() END The global being checked for is #L_SaidBye. The waits at the end of the blocks seemed to fix the issue when I tested it during the transition to SoD, but that was only because the NPCs left the group during the dialogues. When I tested it with the canon group that stays in the group when transitioning to BG2, I realized each block was being processed. I even tried setting #L_SaidBye in the dialogues, but it didn't change the outcome at all. All blocks were still being processed. Quote Link to comment
lynx Posted August 23, 2021 Share Posted August 23, 2021 The way I see it: - it's 0, so the matching block runs - .. and sets it to 1 - but then also waits, so triggers get reprocessed - meaning the last block runs setting it to 0 - ad nauseam Quote Link to comment
Lauriel Posted August 23, 2021 Author Share Posted August 23, 2021 1 minute ago, lynx said: but then also waits, so triggers get reprocessed - meaning the last block runs setting it to 0 - ad nauseam The script only gets called once. Why would resetting the variable at the end cause it to run all blocks again? Quote Link to comment
Lauriel Posted August 23, 2021 Author Share Posted August 23, 2021 (edited) 15 minutes ago, lynx said: The way I see it: - it's 0, so the matching block runs - .. and sets it to 1 - but then also waits, so triggers get reprocessed - meaning the last block runs setting it to 0 - ad nauseam I took out the setting it to 0 in the last block and it made no difference. I paused it after once of the dialogues and the global was set properly. However, to the script, that change is invisible. It does not work to set a variable inside a script and expect subsequent blocks to see the change. Edited August 23, 2021 by Lauriel Quote Link to comment
lynx Posted August 23, 2021 Share Posted August 23, 2021 Are you starting this as a cutscene? Then all blocks get evaluated by default. Quote Link to comment
Lauriel Posted August 23, 2021 Author Share Posted August 23, 2021 (edited) 4 minutes ago, lynx said: Are you starting this as a cutscene? Yes 4 minutes ago, lynx said: Then all blocks get evaluated by default. I realize that - which is why I set the variable so that the triggers in the blocks would return false...but they don't. Hence the question in the original post. Edited August 23, 2021 by Lauriel Quote Link to comment
lynx Posted August 23, 2021 Share Posted August 23, 2021 I think conditions are ignored. You could use False in all of them and they should still run. Quote Link to comment
Lauriel Posted August 23, 2021 Author Share Posted August 23, 2021 (edited) 6 minutes ago, lynx said: I think conditions are ignored. You could use False in all of them and they should still run. No, I initiated the script using StartCutSceneEx("#LSayBye",TRUE) so script triggers get evaluated properly. And those that didn't rely upon #L_SaidBye to be false were skipped as would be expected. And I've since modified the script so that only one of the blocks will evaluate to true and it works like it should. But, I was hoping there was a way to stop the process just to make the code a bit less messy. But there doesn't seem to be one. Here is what works - it's just so unwieldy ... Spoiler /////////////////////////////////////////////////////////////// // Allow NPCs to say goodbye before the group splits // // Parsed via main_sod.tpa called via #LAdvGm1.d and #LShare // // Dialogue needs to go in a certain order in some cases // /////////////////////////////////////////////////////////////// IF IsValidForPartyDialogue("JAHEIRA") TriggerOverride("JAHEIRA",Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride("JAHEIRA",See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) EndCutSceneMode() ActionOverride("JAHEIRA",Dialogue(Myself)) END IF OR(4) !IsValidForPartyDialogue("JAHEIRA") !TriggerOverride("JAHEIRA",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("JAHEIRA",See(Player1)) TriggerOverride(Player1,False()) IsValidForPartyDialogue("MINSC") OR(3) Global("#L_StartCaelarAttack","GLOBAL",1) Global("#L_StartCaelarAttack","GLOBAL",2) Global("#L_StartCaelarAttack","GLOBAL",3) TriggerOverride("MINSC",Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride("MINSC",See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) EndCutSceneMode() ActionOverride("MINSC",Dialogue(Myself)) Wait(3) END IF OR(4) !IsValidForPartyDialogue("JAHEIRA") !TriggerOverride("JAHEIRA",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("JAHEIRA",See(Player1)) TriggerOverride(Player1,False()) IsValidForPartyDialogue("DYNAHEIR") Global("#L_StartBG2","GLOBAL",1) TriggerOverride("DYNAHEIR",Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride("DYNAHEIR",See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) EndCutSceneMode() ActionOverride("DYNAHEIR",Dialogue(Myself)) Wait(3) END IF OR(4) !IsValidForPartyDialogue("JAHEIRA") !TriggerOverride("JAHEIRA",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("JAHEIRA",See(Player1)) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("MINSC") !TriggerOverride("MINSC",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("MINSC",See(Player1)) Global("#L_StartBG2","GLOBAL",1) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("DYNAHEIR") !TriggerOverride("DYNAHEIR",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("DYNAHEIR",See(Player1)) Global("#L_StartBG2","GLOBAL",0) TriggerOverride(Player1,False()) !Name("None",Player2) IsValidForPartyDialogue(Player2) TriggerOverride(Player2,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player2,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) EndCutSceneMode() ActionOverride(Player2,Dialogue(Myself)) Wait(3) END IF OR(4) !IsValidForPartyDialogue("JAHEIRA") !TriggerOverride("JAHEIRA",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("JAHEIRA",See(Player1)) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("MINSC") !TriggerOverride("MINSC",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("MINSC",See(Player1)) Global("#L_StartBG2","GLOBAL",1) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("DYNAHEIR") !TriggerOverride("DYNAHEIR",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("DYNAHEIR",See(Player1)) Global("#L_StartBG2","GLOBAL",0) TriggerOverride(Player1,False()) OR(5) Name("None",Player2) !IsValidForPartyDialogue(Player2) !TriggerOverride(Player2,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player2,See(Player1)) TriggerOverride(Player1,False()) NumInPartyGT(2) !Name("None",Player3) IsValidForPartyDialogue(Player3) TriggerOverride(Player3,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player3,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) EndCutSceneMode() ActionOverride(Player3,Dialogue(Myself)) Wait(3) END IF OR(4) !IsValidForPartyDialogue("JAHEIRA") !TriggerOverride("JAHEIRA",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("JAHEIRA",See(Player1)) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("MINSC") !TriggerOverride("MINSC",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("MINSC",See(Player1)) Global("#L_StartBG2","GLOBAL",1) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("DYNAHEIR") !TriggerOverride("DYNAHEIR",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("DYNAHEIR",See(Player1)) Global("#L_StartBG2","GLOBAL",0) TriggerOverride(Player1,False()) OR(5) Name("None",Player2) !IsValidForPartyDialogue(Player2) !TriggerOverride(Player2,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player2,See(Player1)) TriggerOverride(Player1,False()) OR(5) Name("None",Player3) !IsValidForPartyDialogue(Player3) !TriggerOverride(Player3,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player3,See(Player1)) TriggerOverride(Player1,False()) NumInPartyGT(3) !Name("None",Player4) IsValidForPartyDialogue(Player4) TriggerOverride(Player4,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player4,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) EndCutSceneMode() ActionOverride(Player4,Dialogue(Myself)) Wait(3) END IF OR(4) !IsValidForPartyDialogue("JAHEIRA") !TriggerOverride("JAHEIRA",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("JAHEIRA",See(Player1)) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("MINSC") !TriggerOverride("MINSC",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("MINSC",See(Player1)) Global("#L_StartBG2","GLOBAL",1) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("DYNAHEIR") !TriggerOverride("DYNAHEIR",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("DYNAHEIR",See(Player1)) Global("#L_StartBG2","GLOBAL",0) TriggerOverride(Player1,False()) OR(5) Name("None",Player2) !IsValidForPartyDialogue(Player2) !TriggerOverride(Player2,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player2,See(Player1)) TriggerOverride(Player1,False()) OR(5) Name("None",Player3) !IsValidForPartyDialogue(Player3) !TriggerOverride(Player3,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player3,See(Player1)) TriggerOverride(Player1,False()) OR(5) Name("None",Player4) !IsValidForPartyDialogue(Player4) !TriggerOverride(Player4,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player4,See(Player1)) TriggerOverride(Player1,False()) NumInPartyGT(4) !Name("None",Player5) IsValidForPartyDialogue(Player5) TriggerOverride(Player5,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player5,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) EndCutSceneMode() ActionOverride(Player5,Dialogue(Myself)) Wait(3) END IF OR(4) !IsValidForPartyDialogue("JAHEIRA") !TriggerOverride("JAHEIRA",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("JAHEIRA",See(Player1)) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("MINSC") !TriggerOverride("MINSC",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("MINSC",See(Player1)) Global("#L_StartBG2","GLOBAL",1) TriggerOverride(Player1,False()) OR(5) !IsValidForPartyDialogue("DYNAHEIR") !TriggerOverride("DYNAHEIR",Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride("DYNAHEIR",See(Player1)) Global("#L_StartBG2","GLOBAL",0) TriggerOverride(Player1,False()) OR(5) Name("None",Player2) !IsValidForPartyDialogue(Player2) !TriggerOverride(Player2,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player2,See(Player1)) TriggerOverride(Player1,False()) OR(5) Name("None",Player3) !IsValidForPartyDialogue(Player3) !TriggerOverride(Player3,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player3,See(Player1)) TriggerOverride(Player1,False()) OR(5) Name("None",Player4) !IsValidForPartyDialogue(Player4) !TriggerOverride(Player4,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player4,See(Player1)) TriggerOverride(Player1,False()) OR(5) Name("None",Player5) !IsValidForPartyDialogue(Player5) !TriggerOverride(Player5,Global("#L_SayGoodbye","LOCALS",1)) !TriggerOverride(Player5,See(Player1)) TriggerOverride(Player5,False()) IsValidForPartyDialogue(Player6) TriggerOverride(Player6,Global("#L_SayGoodbye","LOCALS",1)) TriggerOverride(Player6,See(Player1)) THEN RESPONSE #100 CutSceneId(Player1) EndCutSceneMode() ActionOverride(Player6,Dialogue(Myself)) Wait(3) END IF True() THEN RESPONSE #100 CutSceneId(Player1) EndCutSceneMode() END Edited August 23, 2021 by Lauriel Quote Link to comment
lynx Posted August 23, 2021 Share Posted August 23, 2021 Then I guess it's a problem of all the conditions being checked first, then executed, not linearly as one would expect. Quote Link to comment
jastey Posted August 23, 2021 Share Posted August 23, 2021 20 minutes ago, lynx said: not linearly as one would expect. That's a possibility. e.g. the cutscene in BGII where Imoen is brought in fronto fthe CW in the goverments building, all the walking to and fro of CW in the background etc. is different scriptblocks that do not seem to get executed one after the other but more of parallel. Quote Link to comment
Bubb Posted August 24, 2021 Share Posted August 24, 2021 Script actions always get queued up and executed after a complete pass of the script, (after the triggers have been checked), so it's impossible to change how triggers will evaluate during the current pass. The only exception I know of is in IWD2, where the introduction of SCRINST.IDS and DLGINST.IDS allows certain actions to execute during the middle of a pass. So, unfortunately the inverted-trigger mess masterpiece that you've settled on is the only way. Cutscenes are also special in that they have custom script handling. Here's some notable things, not all of them are relevant to your situation, but they might help prevent some confusion in the future: 1) The first action in a block is treated as a placeholder — the engine uses the object it contains to execute all subsequent actions for that block. CutSceneId() is the convention for this first action, but it can be anything. Note that CutSceneId() is basically a renamed NoAction(), its position in the script is the only thing that matters. The first action is otherwise discarded and not run. 2) Continue() is meaningless. Cutscenes process every available script block, even if it already entered one, (unlike object/creature/area/game scripts). 3) There is no event handling, so all triggers with an IDS value less than 0x4000 auto-fail. There's probably more, but that's all I can think of at the moment. Quote Link to comment
Lauriel Posted August 24, 2021 Author Share Posted August 24, 2021 6 minutes ago, Bubb said: it's impossible to change how triggers will evaluate during the current pass Thank you. I figured as much but thought it worth an ask... Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.