Skip to content

Problem with CreateVIsualEffect in BG2

Wizer13Wizer13 Member Posts: 65
Hi everyone. I'm experimenting with modding, and i've been trying to include an animation of teleportation before a LeaveAreaLUA (x,y). I've managed to initiate the animation on each player, but the whole sequence goes in loops afterwards. It even imposes itself multiple times. Since i've not seen a parameter to include a number of time for apparition, I wonder how to stop it, or which action I should use.

Here's the coding I've used:

IF
Global("QUEST_CAVI","GLOBAL",1)
THEN
RESPONSE #100
CreateVisualEffectObject("OHRSGATE",Player1)
CreateVisualEffectObject("OHRSGATE",Player2)
CreateVisualEffectObject("OHRSGATE",Player3)
CreateVisualEffectObject("OHRSGATE",Player4)
CreateVisualEffectObject("OHRSGATE",Player5)
CreateVisualEffectObject("OHRSGATE",Player6)
Wait(2)
FadeToColor([20.0],0)
ActionOverride(Player1,LeaveAreaLUA("ARCC01","",[645. 811],4))
ActionOverride(Player2,LeaveAreaLUA("ARCC01","",[628. 793],4))
ActionOverride(Player3,LeaveAreaLUA("ARCC01","",[716. 797],4))
ActionOverride(Player4,LeaveAreaLUA("ARCC01","",[730. 818],4))
ActionOverride(Player5,LeaveAreaLUA("ARCC01","",[726. 858],4))
ActionOverride(Player6,LeaveAreaLUA("ARCC01","",[691. 874],4))
FadeFromColor([20.0],0)

END

Thank you for your time! :)

Comments

  • CamDawgCamDawg Member, Developer Posts: 3,438
    edited July 2017
    It's an unbounded loop, so this script will keep firing. You need to do something in the action block to prevent the trigger block from remaining true or it will fire again, e.g.

    IF
    Global("QUEST_CAVI","GLOBAL",1)
    THEN
    RESPONSE #100
    SetGlobal("QUEST_CAVI","GLOBAL",2) // <-- this prevents it from being true again
    // rest of stuff
    END
    Alternatively, you could also use a one-time, throw-away variable:

    IF
    Global("QUEST_CAVI","GLOBAL",1)
    Global("CD_DoThisCutSceneOnce","LOCALS",0)
    THEN
    RESPONSE #100
    SetGlobal("CD_DoThisCutSceneOnce","LOCALS",1)
    // rest of stuff
    END
    Also, grab a prefix if you haven't done so already.
  • Wizer13Wizer13 Member Posts: 65
    Thank you very much! ;) I'll try this!
  • Wizer13Wizer13 Member Posts: 65
    That worked perfectly! Thank you again!
  • Wizer13Wizer13 Member Posts: 65
    As for the prefix, I've tried, but the forum seem down or something. Cannot contact the administrators, and they don't resend the validation and I've tried many times. Guess I'll have to wait.
Sign In or Register to comment.