• 🏆 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!

Help with Push Units

Status
Not open for further replies.
Level 8
Joined
Jun 26, 2019
Messages
318
Hello. I need help with changing the trigger system to be set as pushing unit, not as special effect or ability. I need it be as unit, and set it as pusher unit, for me to not have to spamming the special effects or abilities to send push balls to push the units, because if I put it in my main map from this test map, it would cause the map lagging bad due too many special effects or abilities, you know.

I just need single push ball as UNIT on each trigger with each regions also to just send one push ball each, and I can set trigger to order the unit to move to the targeted point from begin point as unit pusher to push units and stay blocking units out of the line for until the time is expired, and remove pushing units out of game, and come back again later.

I am not good at English, but you know what I am trying to do here because I need this for to keep pushing the players into middle of map for every 10 minutes due to players being "pussy" to avoid or waiting for other players to attack while they are sitting near their healing station, to prevent causing the game time longer.

I couldn't figure out how to change this trigger system to be set as unit, not special effect or ability. I want it to be set as unit and this unit will push other units like it did as special effect and ability. Here the test map file. I want you to check it out. Test it and you can see what I am trying to do to get this set as unit, not special effect or ability, so I can move one unit on each to push other units.

-------------------------------------

  • Push Ball
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to Turn On Push Ball
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GB_Indexs[0] Equal to 0
        • Then - Actions
          • Trigger - Turn on Push Ball Loop <gen>
        • Else - Actions
      • Set GB_Indexs[0] = (GB_Indexs[0] + 1)
      • Set GB_Indexs[1] = (GB_Indexs[1] + 1)
      • -------- Setting Everything --------
      • -------- --------------------------------------------------------------------------------- --------
      • -------- Don't Change anything here --------
      • -------- --------------------------------------------------------------------------------- --------
      • Set GB_Caster[GB_Indexs[0]] = (Triggering unit)
      • Set GB_Casting_Point[GB_Indexs[0]] = (Center of Region 000 <gen>)
      • Set GB_Target_Point = (Center of Region 002 <gen>)
      • Set GB_Angle[GB_Indexs[0]] = (Angle from GB_Casting_Point[GB_Indexs[0]] to GB_Target_Point)
      • Set GB_Distance[GB_Indexs[0]] = 3000.00
      • Set GB_Reached_Distance[GB_Indexs[0]] = 0.00
      • Set GB_Range[GB_Indexs[0]] = 0.00
      • Set GB_Off_Boolean[GB_Indexs[0]] = True
      • -------- --------------------------------------------------------------------------------- --------
      • -------- Here you can change the Speed of the ball --------
      • -------- --------------------------------------------------------------------------------- --------
      • Set GB_Moving_Range[GB_Indexs[0]] = 20.00
      • -------- --------------------------------------------------------------------------------- --------
      • -------- This is where you change the Turning Speed (to make them do circle) --------
      • -------- 0 = no circle just pushing --------
      • -------- --------------------------------------------------------------------------------- --------
      • Set GB_Turning_Rate[GB_Indexs[0]] = 0.00
      • -------- --------------------------------------------------------------------------------- --------
      • -------- This is for changing the Damage (this is a damage every 0.03 sec) --------
      • -------- The 250 AOE is Multiplied by the Level... --------
      • -------- --------------------------------------------------------------------------------- --------
      • Set GB_Damage_250_AOE = 0.00
      • Set GB_Damage_500_AOE = 0.00
      • -------- --------------------------------------------------------------------------------- --------
      • -------- This is for the special Effects --------
      • -------- --------------------------------------------------------------------------------- --------
      • Set GB_Special_Effect_Units = Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
      • Set GB_Special_Effect_Ball = Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • -------- --------------------------------------------------------------------------------- --------
      • -------- This is the Knockback Speed --------
      • -------- --------------------------------------------------------------------------------- --------
      • Set GB_Knockback_Speed = 20.00
      • -------- --------------------------------------------------------------------------------- --------
      • -------- Don't change anything in the Push Ball Loop Trigger --------
      • -------- --------------------------------------------------------------------------------- --------
      • Custom script: call RemoveLocation(udg_GB_Target_Point)
  • Push Ball Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer GB_Indexs[2]) from 1 to GB_Indexs[0], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • GB_Off_Boolean[GB_Indexs[2]] Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • GB_Reached_Distance[GB_Indexs[2]] Greater than or equal to GB_Distance[GB_Indexs[2]]
                • Then - Actions
                  • Custom script: call RemoveLocation(udg_GB_Casting_Point[udg_GB_Indexs[2]])
                  • Set GB_Off_Boolean[GB_Indexs[2]] = False
                  • Set GB_Indexs[1] = (GB_Indexs[1] - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • GB_Indexs[1] Equal to 0
                    • Then - Actions
                      • Set GB_Indexs[0] = 0
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
                  • Set GB_Range[GB_Indexs[2]] = (GB_Range[GB_Indexs[2]] + GB_Moving_Range[GB_Indexs[2]])
                  • Set GB_Moving_Point = (GB_Casting_Point[GB_Indexs[2]] offset by GB_Range[GB_Indexs[2]] towards GB_Angle[GB_Indexs[2]] degrees)
                  • -------- Special Effect of the Ball --------
                  • Special Effect - Create a special effect at GB_Moving_Point using GB_Special_Effect_Ball
                  • Special Effect - Destroy (Last created special effect)
                  • Set GB_Unit_Group = (Units within 500.00 of GB_Moving_Point matching ((((Matching unit) is alive) Equal to True) and ((((Owner of (Matching unit)) is an ally of (Owner of (Matching unit))) Equal to True) and (((Matching unit) is A structure) Equal to False))))
                  • Unit Group - Pick every unit in GB_Unit_Group and do (Actions)
                    • Loop - Actions
                      • -------- 500 AOE range damage --------
                      • Unit - Cause GB_Caster[GB_Indexs[2]] to damage (Picked unit), dealing GB_Damage_500_AOE damage of attack type Spells and damage type Normal
                      • -------- Setting everything to make move the units --------
                      • Set GB_Custom_Value = (Custom value of (Picked unit))
                      • Set GB_Unit[GB_Custom_Value] = (Picked unit)
                      • Set GB_Unit_Point[GB_Custom_Value] = (Position of GB_Unit[GB_Custom_Value])
                      • -------- Special Effect on the units --------
                      • Set GB_100 = (Random integer number between 1 and 100)
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • GB_100 Less than or equal to 50
                        • Then - Actions
                          • Special Effect - Create a special effect at GB_Unit_Point[GB_Custom_Value] using GB_Special_Effect_Units
                          • Special Effect - Destroy (Last created special effect)
                        • Else - Actions
                      • Set GB_Unit_Angle[GB_Custom_Value] = (Angle from GB_Moving_Point to GB_Unit_Point[GB_Custom_Value])
                      • Set GB_Unit_Moving_Point[GB_Custom_Value] = (GB_Unit_Point[GB_Custom_Value] offset by GB_Knockback_Speed towards (GB_Unit_Angle[GB_Custom_Value] + GB_Turning_Rate[GB_Indexs[2]]) degrees)
                      • -------- Moving the units --------
                      • Unit - Move GB_Unit[GB_Custom_Value] instantly to GB_Unit_Moving_Point[GB_Custom_Value]
                  • -------- The Group that will recieve the 250 AOE range Damage --------
                  • Set GB_Unit_Group_2 = (Units within 250.00 of GB_Moving_Point matching ((((Matching unit) is alive) Equal to True) and ((((Owner of (Matching unit)) is an ally of (Owner of (Matching unit))) Equal to True) and (((Matching unit) is A structure) Equal to False))))
                  • Unit Group - Pick every unit in GB_Unit_Group_2 and do (Actions)
                    • Loop - Actions
                      • -------- Dealing the damage --------
                  • -------- Setting the time --------
                  • Set GB_Reached_Distance[GB_Indexs[2]] = (GB_Moving_Range[GB_Indexs[2]] + GB_Reached_Distance[GB_Indexs[2]])
                  • -------- Removing the Leaks --------
                  • Custom script: call RemoveLocation(udg_GB_Unit_Moving_Point[udg_GB_Custom_Value])
                  • Custom script: call RemoveLocation(udg_GB_Unit_Point[udg_GB_Custom_Value])
                  • Custom script: call RemoveLocation(udg_GB_Moving_Point)
                  • Custom script: call DestroyGroup(udg_GB_Unit_Group)
                  • Custom script: call DestroyGroup(udg_GB_Unit_Group_2)
            • Else - Actions
  • Attack
    • Events
      • Time - Elapsed game time is 3.00 seconds
    • Conditions
    • Actions
      • Unit - Order Trigger Run 0199 <gen> to Attack Turn On Push Ball 0004 <gen>
 

Attachments

  • Push System Test.w3x
    37.3 KB · Views: 15

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
If the special effects cause performance issues then consider removing the actions that create and destroy them.
  • empty.gif
    empty.gif
    empty.gif
    empty.gif
    line.gif
    empty.gif
    empty.gif
    join.gif
    ani.gif
    Special Effect - Create a special effect at GB_Moving_Point using GB_Special_Effect_Ball

  • empty.gif
    empty.gif
    empty.gif
    empty.gif
    line.gif
    empty.gif
    empty.gif
    join.gif
    ani.gif
    Special Effect - Destroy (Last created special effect)
Disabling or removing these two lines should remove the special effects.
 
Level 8
Joined
Jun 26, 2019
Messages
318
How do I make this push ball to be stuck on unit, and when the unit moves, the push ball moves with the unit like follow, you know?

And, if I remove those special effects, it will cause a lot of leak and probably crash the WC3 game, tho. I am just saying that this whole trigger is for a special effect to be push ball. I am trying to figure out how to create a trigger as unit and set it to be push ball.

This is almost work out, but it still dropped the ball, I want it to stuck on unit. Here the trigger I almost had it, but still working on it to figure out how to get the ball to be stay with the unit all the time while unit is sitting or moving unit the unit is removed from the game.

  • Unit Group - Pick every unit in (Units in Region 012 <gen>) and do (Actions)
    • Loop - Actions
      • Set GB_Range[GB_Indexs[2]] = (GB_Range[GB_Indexs[2]] + GB_Moving_Range[GB_Indexs[2]])
      • Set GB_Moving_Point = (Position of (Picked unit))
      • -------- Special Effect of the Ball --------
      • Special Effect - Create a special effect at GB_Moving_Point using GB_Special_Effect_Ball
      • Special Effect - Destroy (Last created special effect)
      • Set GB_Unit_Group = (Units within 500.00 of GB_Moving_Point matching ((((Matching unit) is alive)
 

Attachments

  • Push System Test 2.w3x
    37.3 KB · Views: 18
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
And, if I remove those special effects, it will cause a lot of leak and probably crash the WC3 game, tho. I am just saying that this whole trigger is for a special effect to be push ball. I am trying to figure out how to create a trigger as unit and set it to be push ball.
I do not see how it would leak if those two actions were removed or disabled.
How do I make this push ball to be stuck on unit, and when the unit moves, the push ball moves with the unit like follow, you know?
I still do not understand. What is a "push ball"? What is it meant to be doing?
 
Level 8
Joined
Jun 26, 2019
Messages
318
Sigh. I don't know how to explain what kind of trigger I wanted. Well, you go test the map I uploaded the map file, and you will see the push balls pushing the ships. But, it's too much, I want the push ball to be as unit, and move from begin point to end point, and stay there at end point for few minutes, then remove the push ball from the game. Understand? There's one works like this in other map called "Battleships Crossfire", one of ships that has this trigger called "Carrack" with barrier ability that will push enemy ships. It's like knockback system.
 

Attachments

  • Push System Test1.w3x
    37.4 KB · Views: 16

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
So you are after something like Heroes of the Storm's Flastad's Mighty Gust which goes into a Tassadar Force Wall?

The ability would need to do the following.
  • Move all the projectiles and dragged units. Check if the projectile has impacted any new units and if so add them to the drag group.
  • Check if the projectile has time expired (or reached maximum range). If so free up all resources used to track dragged units and remove the projectile dummy or effect. Create a new pathing blocker dummy unit at the same location and give it the desired timed life. Moving units with complex pathing can be resource intensive, hence the recommendation to only create it once the projectile phase ends. One could also run terrain hit checks to end the projectile stage early in case it hits unpathable terrain or the edge of the map.
One could track dragged units in a unit group and translate them by the same offset as the projectile every update. The impact test can check if the unit is already in this dragged unit group and if so not add them again.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I don't know how to change it into a unit. Not special effect or ability, you know.
As mentioned above. Keep the projectile as a special effect and create the unit once it impacts/expires where the special effect was. The projectile can drag the units near it along with it, being much more reliable and pushing units and trying to use other units in Warcraft III.
 
Level 8
Joined
Jun 26, 2019
Messages
318
Just create the unit? Where to put it at? Next to special effects? What about the setting of 2 positions? Position of Unit. But, I need the event to be set as game time because if it's ability, I can't force a unit to cast a ability. It's impossible. There's nobody can make a trigger to force a unit to cast a ability. That's why I want event to be game time, like every 10 minutes. With no condition needed. Just event and action. But, if I change event to game time, there will be leaks in action triggers... because of some triggers are ability. You know, "position of ability casting unit."
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
What about the setting of 2 positions?
What 2 positions?
I can't force a unit to cast a ability. It's impossible. There's nobody can make a trigger to force a unit to cast a ability.
One can force units to cast abilities using triggers. This is done by making sure the unit has the ability, can cast it (enough mana, not on cooldown, not silenced) and then ordering the unit to cast it with the appropriate order type. The order used is the base order ID/string of any custom abilities. The Channel custom ability allows one to set the order ID/string it uses.
That's why I want event to be game time, like every 10 minutes.
Every 10 game minutes is a simple periodic event with a period timeout of 600 seconds.
But, if I change event to game time, there will be leaks in action triggers...
There will only be leaks if you let there be leaks. If one cleans up all allocated resources when they no longer are useful there will be no leaks.
because of some triggers are ability.
Triggers and not abilities. They are two different types.
You know, "position of ability casting unit."
I know that function. It only makes sense in response to events where an ability was cast. Nothing really to do with leaks, but more like an error.
The other map will show you example that actually worked with float units to go over 522 speed limit, it can go up to a number you type in, if you type "2000," and the float unit will go at 2000 speed of movement and you will see it go flash and no lag at all. But, I am talking about to get it work with float units in my map. Check it out. Here 2 maps. My map is "Speed Ability" and other map is "MoveSpeedXGUI."
If it works on the other map, why not copy their triggers to your map?
 
Last edited:
Status
Not open for further replies.
Top