• 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.

Change Movement - Speed for units depending on Blight and Detection of Animations of Burrowed Units

Status
Not open for further replies.
Level 2
Joined
Oct 24, 2014
Messages
7
Hello everybody,

Question 1:
I created a small mod for burrowed units, which allows them to move at 10% of their default movement speed while underground.
Then I tried creating a trigger which allows them to move at 50% of their default movement speed while burrowed on blighted ground.
I based my trigger on this thread:
movespeed increase while on blight

Worked with solution from this thread:
[Solved] - Unit expiration timer (Pause/Unpause)

I just can't get it to work :/

For comparison I tried increasing the movement speed of a nonburrowed unit, e.g the Crypt Lord, but this also does not work.
Please tell me what I'm doing wrong.


Question 2:
I added particle effects to the movement of burrowed units, which I want to be visible to anybody, even if they can't detect the unit itself.
Is that possible, if yes, how? Example is at the bottom of the map.

Greetings Iovilius
 

Attachments

  • BurrowedMovement.w3x
    3.9 MB · Views: 6
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,389
What have you tried? Can we see your trigger(s)?

 
Level 2
Joined
Oct 24, 2014
Messages
7
I found a way to make Question 1 work.
Solution was in this thread:
[Solved] - Unit expiration timer (Pause/Unpause)

I used a spellbook and a dummy ability based on "Critical Strike (Neutral Hostile)"
Updated the map in the first post.

  • Burrowed Movement Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 0.00 seconds
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Disable BurrowedMovementBook (Custom) for (Player((Integer A)))
  • Burrowed Movement
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set temp_burrowed_group = (Units of type Burrowed Crypt Fiend (Custom))
      • Unit Group - Pick every unit in temp_burrowed_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Position of (Picked unit)) is blighted) Equal to True
              • (Level of BurrowedMovementBook (Custom) for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Set (Picked unit) movement speed to (5.00 x (Default movement speed of (Picked unit)))
              • Unit - Add BurrowedMovementBook (Custom) to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Position of (Picked unit)) is blighted) Equal to False
                  • (Level of BurrowedMovementBook (Custom) for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
                  • Unit - Remove BurrowedMovementBook (Custom) from (Picked unit)
                • Else - Actions
      • Custom script: call DestroyGroup(udg_temp_burrowed_group)
      • Set temp_burrowed_group = (Units of type Burrowed Carrion Beetle (Level 2)(Custom))
      • Unit Group - Pick every unit in temp_burrowed_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Position of (Picked unit)) is blighted) Equal to True
              • (Level of BurrowedMovementBook (Custom) for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Set (Picked unit) movement speed to (5.00 x (Default movement speed of (Picked unit)))
              • Unit - Add BurrowedMovementBook (Custom) to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Position of (Picked unit)) is blighted) Equal to False
                  • (Level of BurrowedMovementBook (Custom) for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
                  • Unit - Remove BurrowedMovementBook (Custom) from (Picked unit)
                • Else - Actions
      • Custom script: call DestroyGroup(udg_temp_burrowed_group)
      • Set temp_burrowed_group = (Units of type Burrowed Carrion Beetle (Level 3)(Custom))
      • Unit Group - Pick every unit in temp_burrowed_group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Position of (Picked unit)) is blighted) Equal to True
              • (Level of BurrowedMovementBook (Custom) for (Picked unit)) Less than 1
            • Then - Actions
              • Unit - Set (Picked unit) movement speed to (5.00 x (Default movement speed of (Picked unit)))
              • Unit - Add BurrowedMovementBook (Custom) to (Picked unit)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Position of (Picked unit)) is blighted) Equal to False
                  • (Level of BurrowedMovementBook (Custom) for (Picked unit)) Greater than or equal to 1
                • Then - Actions
                  • Unit - Set (Picked unit) movement speed to (Default movement speed of (Picked unit))
                  • Unit - Remove BurrowedMovementBook (Custom) from (Picked unit)
                • Else - Actions
      • Custom script: call DestroyGroup(udg_temp_burrowed_group)
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,389
A nice improvement would be this:
Create a permanent Unit Group, let's called it Burrowed.
When a unit uses the burrow ability -> Add them to the Burrowed unit group / do whatever else you may want to them
When a unit unburrows/dies -> Remove them from the Burrowed unit group / undo whatever you may have done before

Then you can periodically check the Burrowed group without needing to create 3 separate temporary unit groups.

You're also leaking a Point each time you do this:
  • ((Position of (Picked unit)) is blighted) Equal to False
Set a Point variable to the Position of the (Picked unit). It'd also be better to set a Unit variable to the (Picked unit) to make it more efficient.
  • Loop - Actions
  • Set Variable BurrowedUnit = (Picked unit)
  • Set Variable BurrowedPoint = (Position of BurrowedUnit)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Then remove it after the If Then Else:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • Custom script: call RemoveLocation(udg_BurrowedPoint)
Regarding the audio issue, I don't know. You're on an older version so it's not like a recent patch broke the game.
 
Level 2
Joined
Oct 24, 2014
Messages
7
New Version hopefully without leaks:

  • Burrowed Movement Ini
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Wait 0.00 seconds
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Player - Disable BurrowedMovementBook (Custom) for (Player((Integer A)))
  • Add to Burrowed Group
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Crypt Fiend (Custom)
          • (Unit-type of (Triggering unit)) Equal to Carrion Beetle (Level 2)(Custom)
          • (Unit-type of (Triggering unit)) Equal to Carrion Beetle (Level 3)(Custom)
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Burrow (Crypt Fiend)(Custom)
          • (Ability being cast) Equal to Burrow (Scarab lvl 2)(Custom)
          • (Ability being cast) Equal to Burrow (Scarab lvl 3)(Custom)
    • Actions
      • Unit Group - Add (Triggering unit) to Burrowed_Group
  • Remove from Burrowed Group
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Burrowed Crypt Fiend (Custom)
          • (Unit-type of (Triggering unit)) Equal to Burrowed Carrion Beetle (Level 2)(Custom)
          • (Unit-type of (Triggering unit)) Equal to Burrowed Carrion Beetle (Level 3)(Custom)
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Burrow (Crypt Fiend)(Custom)
          • (Ability being cast) Equal to Burrow (Scarab lvl 2)(Custom)
          • (Ability being cast) Equal to Burrow (Scarab lvl 3)(Custom)
    • Actions
      • Unit Group - Remove (Triggering unit) from Burrowed_Group
  • Burrowed Movement
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Burrowed_Group and do (Actions)
        • Loop - Actions
          • Set Burrowed_Unit = (Picked unit)
          • Set Burrowed_Point = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Burrowed_Point is blighted) Equal to True
              • (Level of BurrowedMovementBook (Custom) for Burrowed_Unit) Less than 1
            • Then - Actions
              • Unit - Set Burrowed_Unit movement speed to (5.00 x (Default movement speed of Burrowed_Unit))
              • Unit - Add BurrowedMovementBook (Custom) to Burrowed_Unit
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Burrowed_Point is blighted) Equal to False
                  • (Level of BurrowedMovementBook (Custom) for Burrowed_Unit) Greater than or equal to 1
                • Then - Actions
                  • Unit - Set Burrowed_Unit movement speed to (Default movement speed of Burrowed_Unit)
                  • Unit - Remove BurrowedMovementBook (Custom) from Burrowed_Unit
                • Else - Actions
          • Custom script: call RemoveLocation(udg_Burrowed_Point)
Thank you @Uncle for your help. Do you also have an idea how to solve my second problem? I want to make the particles from the burrowed movement animation visible to players even if the unit causing them is invisible to them? Or do you know where I could look for a solution? A video showcasing this is attached.
Also, I sometimes read here, how members give others 'Rep' to thank them for their help. Does this simply mean 'to reply' to posts or is there a 'Reputation' button for that?

Regarding the audio... I have autosave activated in the editor. It tried to save while I was changing stuff and got an error. I think that somehow messed with my audio settings, because they were all over the place.
 

Attachments

  • Warcraft III 2022-07-27 05-57-41.mp4
    13.7 MB
Last edited:
Level 25
Joined
Feb 9, 2009
Messages
1,798
Handy system for that.
Bribe has an example in his damage system too:
 
Status
Not open for further replies.
Top