• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Really Strange Bug

Status
Not open for further replies.
Level 15
Joined
Nov 30, 2007
Messages
1,202
I've started to tinker a interaction system, currently you can only use it on doors, providing the user with different options Open/Close, Lock/Unlock, Knock, Close and Lock.

Anyway the bug accours when you open and close.

I open the gate, I can pass through. Then I Close the gate, I can't pass through. I open it again and still everything is fine. But when I cross the gate multiple times, the pathing of the gate is turned on and the hidden gate all of a sudden is blocking my path?

Basically there are two preplaced gates. One with pathing and one thatis invulnerable without pathing. You can select them both with the interact spell. Only one is visible at a time.

Related Triggers:
  • Door Open
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Options
      • (Ability being cast) Equal to Open Door
    • Actions
      • Game - Display to (All players) the text: Door open is runnin...
      • For each (Integer A) from 0 to 200, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • InteractionSelectedDest[(Player number of (Triggering player))] Equal to DoorDestClosed[(Integer A)]
            • Then - Actions
              • Destructible - Open DoorDestClosed[(Integer A)]
              • Destructible - Hide DoorDestClosed[(Integer A)]
              • Destructible - Show DoorDestOpen[(Integer A)]
              • Set DoorLocked[(Integer A)] = False
              • Custom script: call SelectUnitRemove(udg_InteractionOptionsUnit[GetConvertedPlayerId(GetTriggerPlayer())])
              • Custom script: return
            • Else - Actions
  • Door Close
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Options
      • (Ability being cast) Equal to Close Door
    • Actions
      • Game - Display to (All players) the text: Door Closed is run...
      • For each (Integer A) from 0 to 200, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • InteractionSelectedDest[(Player number of (Triggering player))] Equal to DoorDestOpen[(Integer A)]
            • Then - Actions
              • Destructible - Close DoorDestClosed[(Integer A)]
              • Destructible - Show DoorDestClosed[(Integer A)]
              • Destructible - Hide DoorDestOpen[(Integer A)]
              • Custom script: call SelectUnitRemove(udg_InteractionOptionsUnit[GetConvertedPlayerId(GetTriggerPlayer())])
              • Custom script: return
            • Else - Actions
  • Initiate Interaction
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Interact
    • Actions
      • Custom script: local integer Array
      • Custom script: local string s
      • Custom script: local unit u
      • Custom script: local player p = GetTriggerPlayer()
      • Custom script: local integer int = GetConvertedPlayerId(p)
      • Custom script: local location loc = GetRectCenter(gg_rct_Options_Spawn)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering player) Equal to LocalPlayer
        • Then - Actions
          • Custom script: set s = "Abilities\\Spells\\Orc\\AncestralSpirit\\AncestralSpiritCaster.mdl"
        • Else - Actions
      • Custom script: call AddSpecialEffectLocBJ(GetUnitLoc(GetSpellTargetUnit()),s)
      • Custom script: call AddSpecialEffectLocBJ(GetDestructableLoc(GetSpellTargetDestructable()),s)
      • -------- --------
      • Custom script: call CreateNUnitsAtLoc( 1, 'hhou',p, loc, 0.00 )
      • Custom script: set u = GetLastCreatedUnit()
      • Custom script: set udg_InteractionOptionsUnit[int] = u
      • Custom script: call SelectUnitForPlayerSingle(u, p )
      • Custom script: set udg_InteractionSelectedDest[int] = GetSpellTargetDestructable()
      • Custom script: set udg_InteractionSelectedUnit[int] = GetSpellTargetUnit()
      • Game - Display to (All players) the text: Interaction Window ...
      • -------- Door Interaction --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Destructible-type of (Target destructible of ability being cast)) Equal to Gate Closed (Elven)
        • Then - Actions
          • Custom script: call UnitAddAbilityBJ( 'A005', u)
          • Custom script: call UnitAddAbilityBJ( 'ACwe', u)
          • For each (Integer A) from 0 to 200, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • InteractionSelectedDest[(Player number of (Triggering player))] Equal to DoorDestClosed[(Integer A)]
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DoorLocked[(Integer A)] Equal to False
                    • Then - Actions
                      • Custom script: call UnitAddAbilityBJ( 'Aslp', u )
                    • Else - Actions
                      • Custom script: call UnitAddAbilityBJ( 'A008', u)
                  • Custom script: return
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Destructible-type of (Target destructible of ability being cast)) Equal to Gate Open (Elven)
        • Then - Actions
          • -------- Close --------
          • Custom script: call UnitAddAbilityBJ( 'A006', u)
          • For each (Integer A) from 0 to 200, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • InteractionSelectedDest[(Player number of (Triggering player))] Equal to DoorDestOpen[(Integer A)]
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DoorLocked[(Integer A)] Equal to False
                    • Then - Actions
                      • -------- Close and Lock --------
                      • Custom script: call UnitAddAbilityBJ( 'A007', u )
                    • Else - Actions
                  • Custom script: return
                • Else - Actions
        • Else - Actions
      • Custom script: set u = null
      • Custom script: set p = null
      • Custom script: call RemoveLocation(loc)
  • Abort Interaction
    • Events
      • Player - Player 1 (Red) Deselects a unit
      • Player - Player 2 (Blue) Deselects a unit
      • Player - Player 3 (Teal) Deselects a unit
      • Player - Player 4 (Purple) Deselects a unit
      • Player - Player 5 (Yellow) Deselects a unit
      • Player - Player 6 (Orange) Deselects a unit
      • Player - Player 7 (Green) Deselects a unit
      • Player - Player 8 (Pink) Deselects a unit
      • Player - Player 9 (Gray) Deselects a unit
      • Player - Player 10 (Light Blue) Deselects a unit
      • Player - Player 11 (Dark Green) Deselects a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Options
    • Actions
      • Custom script: call RemoveUnit(udg_InteractionOptionsUnit[GetConvertedPlayerId(GetTriggerPlayer())])
      • Set InteractionSelectedDest[(Player number of (Triggering player))] = No destructible
      • Set InteractionSelectedUnit[(Player number of (Triggering player))] = No unit
      • Set InteractionOptionsUnit[(Player number of (Triggering player))] = No unit
      • Game - Display to (All players) the text: Interaction Window ...
  • Setup Doors
    • Events
    • Conditions
    • Actions
      • Set DoorRect[0] = Library Door <gen>
      • Set DoorTime[0] = 08002100
      • -------- Apartment 1 --------
      • Set DoorDestClosed[1] = Gate Closed (Elven) 0066 <gen>
      • Set DoorDestOpen[1] = Gate Open (Elven) 0067 <gen>
      • -------- Apartment 2 --------
      • Set DoorDestClosed[2] = Gate Closed (Elven) 0084 <gen>
      • Set DoorDestOpen[2] = Gate Open (Elven) 0128 <gen>
      • -------- Apartment 3 --------
      • Set DoorDestClosed[3] = Gate Closed (Elven) 0144 <gen>
      • Set DoorDestOpen[3] = Gate Open (Elven) 0139 <gen>
      • -------- Apartment 4 --------
      • Set DoorDestClosed[4] = Gate Closed (Elven) 0152 <gen>
      • Set DoorDestOpen[4] = Gate Open (Elven) 0149 <gen>
      • For each (Integer A) from 0 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DoorDestClosed[(Integer A)] Not equal to No destructible
              • DoorDestOpen[(Integer A)] Not equal to No destructible
            • Then - Actions
              • Animation - Play DoorDestOpen[(Integer A)]'s death alternate animation
              • Destructible - Make DoorDestOpen[(Integer A)] Invulnerable
              • Destructible - Hide DoorDestOpen[(Integer A)]
            • Else - Actions
 

Attachments

  • LOAP uploaded.w3x
    269 KB · Views: 72
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
You could get rid of the loops like this:

  • Untitled Trigger 062
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set hash = (Last created hashtable)
      • -------- -------------------------------- --------
      • Set d1 = Demonic Gate (Diagonal 2) 0006 <gen>
      • Set d2 = Demonic Gate (Diagonal 1) 0005 <gen>
      • Custom script: call SaveDestructableHandle(udg_hash, GetHandleId(udg_d1), 0, udg_d2)
      • Custom script: call SaveDestructableHandle(udg_hash, GetHandleId(udg_d2), 0, udg_d1)
      • -------- -------------------------------- --------
  • Untitled Trigger 063
    • Events
    • Conditions
    • Actions
      • Set d1 = (Target destructible of ability being cast)
      • Custom script: set udg_d2 = LoadDestructableHandle(udg_hash, GetHandleId(udg_d1), 0)


Not sure of the actual bug. It might be that the invisible door is causing the blocked pathing.

Are you using doors that have death animation where the door opens? That could be the better option.

Or you can try playing the death anim and then hiding the door.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202

Will try using that ;)
I used wc3 gates, uploaded the map so you can take a look if you like. The animations are played at the start. I only use open/close to add or remove the pathing. Perhaps destroy/resurrect will work better. :> But I'm gonna use those for a repair gate interaction.

Unless Im not misstaken don't I need two hashtables, 1 for "DoorDestClosed[]" and 1 for "DoorDestOpen[]"?

  • Actions
    • Hashtable - Create a hashtable
    • Set DoorOpenHash = (Last created hashtable)
    • Hashtable - Create a hashtable
    • Set DoorClosedHash = (Last created hashtable)
    • -------- Apartment 1 --------
    • Set DoorDestClosed[1] = Gate Closed (Elven) 0066 <gen>
    • Set DoorDestOpen[1] = Gate Open (Elven) 0067 <gen>
    • Hashtable - Save Handle OfDoorDestOpen[1] as 1 of 1 in DoorOpenHash
    • Hashtable - Save Handle OfDoorDestClosed[1] as 1 of 1 in DoorClosedHash
*Edit: I failed misserbly with the hashtables. ;(

Hmmm, can it be a pathing issue with wc3, cus no trigger is running at the time which it accours? :>
And yea, it must be the hidden door cus its the only thing that has a pathing, but what else shall I block with? And how is it doing it?
 
Last edited:
Level 15
Joined
Nov 30, 2007
Messages
1,202
You could get rid of the loops like this:

  • Untitled Trigger 062
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set hash = (Last created hashtable)
      • -------- -------------------------------- --------
      • Set d1 = Demonic Gate (Diagonal 2) 0006 <gen>
      • Set d2 = Demonic Gate (Diagonal 1) 0005 <gen>
      • Custom script: call SaveDestructableHandle(udg_hash, GetHandleId(udg_d1), 0, udg_d2)
      • Custom script: call SaveDestructableHandle(udg_hash, GetHandleId(udg_d2), 0, udg_d1)
      • -------- -------------------------------- --------
  • Untitled Trigger 063
    • Events
    • Conditions
    • Actions
      • Set d1 = (Target destructible of ability being cast)
      • Custom script: set udg_d2 = LoadDestructableHandle(udg_hash, GetHandleId(udg_d1), 0)


Not sure of the actual bug. It might be that the invisible door is causing the blocked pathing.

Are you using doors that have death animation where the door opens? That could be the better option.

Or you can try playing the death anim and then hiding the door.

Mind to explain this again in more detail? I am remaking the entire thing, but would like to get this part right. Also can I merge the Gate variable with the GateBlocker using only one hash? From the Targeted dest I need to retrive X so that I can use:
GateOwner[X] (player)
GateStatus[X] (integer)
GateControlers[X] (player group)

  • Setup Doors
    • Actions
      • -------- Apartment 1 --------
      • Set Gate[0] = Gate (Elven) 0067 <gen>
      • Set GatePathing[0] = Gate Blocker 0281 <gen>
      • -------- Apartment 2 --------
      • Set Gate[1] = Gate (Elven) 0066 <gen>
      • Set GatePathing[1] = Gate Blocker 0084 <gen>
      • For each (Integer A) from 0 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Gate[(Integer A)] Not equal to No destructible
            • Then - Actions
              • Destructible - Hide GatePathing[(Integer A)]
            • Else - Actions
*Edit Changed the entire thing, not completly sure if this will work with 11 players though... considering the CurrentPlayer variable.

  • Initiate Interaction
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Interact
    • Actions
      • Custom script: local integer PlayerNum = GetConvertedPlayerId(GetTriggerPlayer())
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Destructible-type of (Target destructible of ability being cast)) Equal to Gate (Elven)
              • (Destructible-type of (Target destructible of ability being cast)) Equal to Gate (Human)
        • Then - Actions
          • Custom script: set udg_InteractionSelectedDest[PlayerNum] = GetSpellTargetDestructable()
          • Custom script: set udg_CurrentPlayer = GetTriggerPlayer()
            • Trigger - Run Gate Interaction <gen> (checking conditions)
        • Else - Actions

  • Gate Interaction
    • Events
    • Conditions
    • Actions
      • Custom script: local player p = udg_CurrentPlayer
      • Custom script: local integer PlayerNum = GetConvertedPlayerId(p)
      • Custom script: local integer GateNum
      • Custom script: local real x = GetLocationX(GetRectCenter(gg_rct_Options_Spawn))
      • Custom script: local real y = GetLocationY(GetRectCenter(gg_rct_Options_Spawn))
      • Custom script: call RemoveUnit(udg_OptionsUnit[PlayerNum])
      • Custom script: call CreateNUnitsAtLoc( 1, 'hhou', p, Location(x,y), 0.00 )
      • Custom script: set udg_OptionsUnit[PlayerNum] = GetLastCreatedUnit()
      • Custom script: call SelectUnitForPlayerSingle(udg_OptionsUnit[PlayerNum], p )
      • For each (Integer A) from 0 to GateCount, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Gate[(Integer A)] Equal to (Target destructible of ability being cast)
            • Then - Actions
              • Custom script: set udg_InteractionGetX[PlayerNum] = GetForLoopIndexA()
              • Custom script: call UnitAddAbilityBJ( 'ACsf', udg_OptionsUnit[PlayerNum])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GateStatus[(Integer A)] Equal to -1
                • Then - Actions
                  • Custom script: call UnitAddAbilityBJ( 'A005', udg_OptionsUnit[PlayerNum])
                  • Custom script: call UnitAddAbilityBJ( 'A008', udg_OptionsUnit[PlayerNum])
                  • Custom script: call UnitAddAbilityBJ( 'ACwe', udg_OptionsUnit[PlayerNum])
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GateStatus[(Integer A)] Equal to 0
                • Then - Actions
                  • Custom script: call UnitAddAbilityBJ( 'A005', udg_OptionsUnit[PlayerNum])
                  • Custom script: call UnitAddAbilityBJ( 'Aslp', udg_OptionsUnit[PlayerNum])
                  • Custom script: call UnitAddAbilityBJ( 'ACwe', udg_OptionsUnit[PlayerNum])
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GateStatus[(Integer A)] Equal to 1
                • Then - Actions
                  • Custom script: call UnitAddAbilityBJ( 'A006', udg_OptionsUnit[PlayerNum])
                  • Custom script: call UnitAddAbilityBJ( 'A008', udg_OptionsUnit[PlayerNum])
                  • Custom script: call UnitAddAbilityBJ( 'ACwe', udg_OptionsUnit[PlayerNum])
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GateStatus[(Integer A)] Equal to 2
                • Then - Actions
                  • Custom script: call UnitAddAbilityBJ( 'A006', udg_OptionsUnit[PlayerNum])
                  • Custom script: call UnitAddAbilityBJ( 'Aslp', udg_OptionsUnit[PlayerNum])
                  • Custom script: call UnitAddAbilityBJ( 'ACwe', udg_OptionsUnit[PlayerNum])
                • Else - Actions
            • Else - Actions
      • Custom script: set p = null
I updated the trigger handeling the spells from the gate, any feedback on it would be appreciated since it is my first atemt att jass.

JASS:
function CheckForOptionsUnit takes nothing returns boolean //I Wonder if this is redundant...
    if (not (GetUnitTypeId(GetTriggerUnit()) == 'hhou')) then
        return false
    endif
    return true
endfunction


function GateStatus_ClosedLocked takes integer i returns boolean 
    return (udg_GateStatus[i] == -2)
endfunction

function GateStatus_Broken takes integer i returns boolean //Check if it's broken
    return (udg_GateStatus[i] != 0)
endfunction

function GateStatus_OpenLocked takes integer i returns boolean 
    return (udg_GateStatus[i] == 1)
endfunction

function GateOwner takes integer i returns boolean // Will use it later!
    if (not (udg_GateOwner[i] == GetTriggerPlayer())) then
        return false
    endif
    return true
endfunction


function GateControler takes integer i returns boolean
    if (not (IsPlayerInForce(GetTriggerPlayer(), udg_GateControlers[i]) == true )) then
        return false
    endif
    return true
endfunction

function Ability_CloseDoor takes nothing returns boolean 
    if (not (GetSpellAbilityId() == 'A006')) then
        return false
    endif
    return true
endfunction

function Ability_OpenDoor takes nothing returns boolean 
    if (not (GetSpellAbilityId() == 'A005')) then
        return false
    endif
    return true
endfunction

function Ability_Lock takes nothing returns boolean 
    if (not (GetSpellAbilityId() == 'Aslp')) then
        return false
    endif
    return true
endfunction

function Ability_Unlock takes nothing returns boolean 
    if (not (GetSpellAbilityId() == 'A008')) then
        return false
    endif
    return true
endfunction

function Ability_Knock takes nothing returns boolean 
    if (not (GetSpellAbilityId() == 'ACwe')) then
        return false
    endif
    return true
endfunction


function PlayerInteractingWithGate takes integer i returns boolean    //Checks if there are more players Interacting with the same target
    if (not (udg_InteractionCurrentTarget_d[i] == udg_InteractionCurrentTarget_d[GetConvertedPlayerId(GetTriggerPlayer())])) then
        return false
    endif
    return true
endfunction


function GateSpell_Actions takes nothing returns nothing

    local player p = GetTriggerPlayer() // Will probably use it more when I add messages.
    local unit u = GetTriggerUnit()
    local integer i = udg_InteractionCurrentTarget_i[GetConvertedPlayerId(p)]
    local destructable Gate = udg_Gate[i]
    local destructable GatePathing = udg_GatePathing[i]
    local real y = GetLocationY(GetDestructableLoc(Gate))
    local real x = GetLocationX(GetDestructableLoc(Gate))
    local integer z = 1

if (GateStatus_Broken(i)) then
if (GateControler(i)) then

    if (Ability_CloseDoor()) then

    call SetDestructableAnimationBJ(Gate, "stand")
    call SetDestructableInvulnerableBJ(Gate, false)
    call DestructableRestoreLife(GatePathing, 250, true )

    loop
        exitwhen z > 11
        if (PlayerInteractingWithGate(z)) then
            call UnitRemoveAbilityBJ( 'A006', udg_InteractionCurrentOptions_u[GetConvertedPlayerId(ConvertedPlayer(z))])    //Removes Close Gate Ability
            call UnitAddAbilityBJ( 'A005', udg_InteractionCurrentOptions_u[GetConvertedPlayerId(ConvertedPlayer(z))])    //Adds Open Gate Ability
        endif
        set z = z + 1
    endloop
            
        if (GateStatus_ClosedLocked(i)) then
            set udg_GateStatus[i] = 1    //sets Gate Status to Closed and Locked if Locked
        else
            set udg_GateStatus[i] = 2    //sets Gate Status to Closed and Unlocked if Unlocked
        endif

    endif

    if (Ability_OpenDoor()) then

    call SetDestructableAnimationBJ(Gate, "death alternate")
    call SetDestructableInvulnerableBJ(Gate, true)
    call KillDestructable(GatePathing)

    loop
        exitwhen z > 11
        if (PlayerInteractingWithGate(z)) then
            call UnitRemoveAbilityBJ( 'A005', udg_InteractionCurrentOptions_u[GetConvertedPlayerId(ConvertedPlayer(z))])    //Removes Open Gate Ability
            call UnitAddAbilityBJ( 'A006', udg_InteractionCurrentOptions_u[GetConvertedPlayerId(ConvertedPlayer(z))])    //Adds Close Gate Ability
        endif
        set z = z + 1
    endloop

        if (GateStatus_OpenLocked(i)) then
            set udg_GateStatus[i] = -2    //sets Gate Status to Closed and Locked if Locked
        else
            set udg_GateStatus[i] = -1    //sets Gate Status to Closed and Unlocked if Unlocked
        endif

    endif

    if (Ability_Lock()) then

    call PlaySoundAtPointBJ(gg_snd_Lever, 100, Location(x, y), 1500.00 )
    loop
        exitwhen z > 11
        if (PlayerInteractingWithGate(z)) then
            call UnitRemoveAbilityBJ( 'Aslp', udg_InteractionCurrentOptions_u[GetConvertedPlayerId(ConvertedPlayer(z))])    //Removes Lock Ability
            call UnitAddAbilityBJ( 'A008', udg_InteractionCurrentOptions_u[GetConvertedPlayerId(ConvertedPlayer(z))])    //Add Unlock Ability
        endif
        set z = z + 1
    endloop

    endif


    if (Ability_Unlock()) then

    call PlaySoundAtPointBJ(gg_snd_Lever, 100, Location(x, y), 1500.00 )
    loop
        exitwhen z > 11
        if (PlayerInteractingWithGate(z)) then
            call UnitRemoveAbilityBJ( 'A008', udg_InteractionCurrentOptions_u[GetConvertedPlayerId(ConvertedPlayer(z))])    //Removes Unlock Ability
            call UnitAddAbilityBJ( 'Aslp', udg_InteractionCurrentOptions_u[GetConvertedPlayerId(ConvertedPlayer(z))])    //Add Lock Ability
        endif
        set z = z + 1
    endloop


    endif

endif
endif

    if (Ability_Knock()) then
    if (GateStatus_Broken(i)) then

    call PlaySoundAtPointBJ(gg_snd_Lever, 100, Location(x, y), 1500.00 )
    call TriggerSleepAction( 0.25 )
    call PlaySoundAtPointBJ(gg_snd_Lever, 100, Location(x, y), 1500.00 )
    call TriggerSleepAction( 0.25 )
    call PlaySoundAtPointBJ(gg_snd_Lever, 100, Location(x, y), 1500.00 )
    call TriggerSleepAction( 0.25 )

    endif
    endif

    set p = null
    set u = null
    set Gate = null
    set GatePathing = null
    
endfunction

//===========================================================================
function InitTrig_Gate_Spells takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST)
    call TriggerAddCondition(t, Condition( function CheckForOptionsUnit))
    call TriggerAddAction(t, function GateSpell_Actions)
    set t = null
endfunction

Oh, and the bug is solved.
 
Last edited:
Status
Not open for further replies.
Top