• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Rock Wall (Need Help)

Status
Not open for further replies.
Creates a wall of Rock Chunks that blocks a straight path for melee units. Lasts 3 seconds.

I messed up with the Timer and declaring the Rock Chunks' variables. Now they won't disappear after 3 seconds of being casted (unless attacked).

Can someone help me? Please.

Here are the triggers:
  • Rock Wall
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rock Wall
    • Actions
      • Set Ability_RockwallIndex = (Ability_RockwallIndex + 1)
      • Set Ability_RockwallCounter[Ability_RockwallIndex] = 0
      • Set Global_Point[0] = (Position of (Triggering unit))
      • Set Global_Point[1] = (Target point of ability being cast)
      • Set Ability_RockwallsCount = (Ability_RockwallsCount + 1)
      • Destructible - Create a Rock Chunks (Wall) at Global_Point[1] facing (Random angle) with scale 1.00 and variation 0
      • Set Ability_Rockwalls[Ability_RockwallsCount] = (Last created destructible)
      • For each (Integer Ability_RockwallsLoop) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set Ability_RockwallsCount = (Ability_RockwallsCount + 1)
          • Set Ability_RockwallsAngle = ((Facing of (Triggering unit)) + 90.00)
          • Set Global_Point[2] = (Global_Point[1] offset by (75.00 x (Real(Ability_RockwallsLoop))) towards Ability_RockwallsAngle degrees)
          • Destructible - Create a Rock Chunks (Wall) at Global_Point[2] facing (Random angle) with scale 1.00 and variation 0
          • Set Ability_Rockwalls[Ability_RockwallsCount] = (Last created destructible)
          • Custom script: call RemoveLocation(udg_Global_Point[2])
      • For each (Integer Ability_RockwallsLoop) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set Ability_RockwallsCount = (Ability_RockwallsCount + 1)
          • Set Ability_RockwallsAngle = ((Facing of (Triggering unit)) + 270.00)
          • Set Global_Point[2] = (Global_Point[1] offset by (75.00 x (Real(Ability_RockwallsLoop))) towards Ability_RockwallsAngle degrees)
          • Destructible - Create a Rock Chunks (Wall) at Global_Point[2] facing (Random angle) with scale 1.00 and variation 0
          • Set Ability_Rockwalls[Ability_RockwallsCount] = (Last created destructible)
          • Custom script: call RemoveLocation(udg_Global_Point[2])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Ability_RockwallIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Rock Wall Loop <gen>
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Global_Point[0])
      • Custom script: call RemoveLocation(udg_Global_Point[1])
  • Rock Wall Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer Ability_RockwallIndexX) from 1 to Ability_RockwallIndex, do (Actions)
        • Loop - Actions
          • Set Ability_RockwallCounter[Ability_RockwallIndexX] = (Ability_RockwallCounter[Ability_RockwallIndexX] + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ability_RockwallCounter[Ability_RockwallIndexX] Equal to 3
            • Then - Actions
              • For each (Integer Ability_RockwallsCountX) from ((Ability_RockwallIndexX x 9) - 8) to (Ability_RockwallIndexX x 9), do (Actions)
                • Loop - Actions
                  • Destructible - Kill Ability_Rockwalls[Ability_RockwallsCountX]
                  • Set Ability_Rockwalls[Ability_RockwallsCountX] = Ability_Rockwalls[Ability_RockwallsCount]
                  • Set Ability_RockwallsCount = (Ability_RockwallsCount - 1)
                  • Set Ability_RockwallsCountX = (Ability_RockwallsCountX - 1)
            • Else - Actions
          • Set Ability_RockwallCounter[Ability_RockwallIndexX] = Ability_RockwallCounter[Ability_RockwallIndex]
          • Set Ability_RockwallIndex = (Ability_RockwallIndex - 1)
          • Set Ability_RockwallIndexX = (Ability_RockwallIndexX - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Ability_RockwallIndex Equal to 0
            • Then - Actions
              • Trigger - Turn off (This trigger)
            • Else - Actions
 
Level 11
Joined
May 16, 2016
Messages
730
I don't like this "INDEX Bullsh@$@t". Besides any dead desrtuctible unlike unit is staying on the map tiill the end. So each time you use the spell the map memory is loaded.
Here is a variant for ya:
Just Replace Owl in the USE and DEAD trigger as dummy and in the USE trigger replace Barricades on something else. All settings are in the SETTINGS trigger.
 

Attachments

  • Build Wall.w3x
    21.5 KB · Views: 38
Status
Not open for further replies.
Top