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

Instant vaccuum + Create a barrier around the area?

Status
Not open for further replies.
Level 6
Joined
Oct 4, 2011
Messages
226
Hi. Im working on a Mage type hero and right now he lacks the control I want him to have.. anyways I'm wanting to use dispel magic as a dumby ability for it I think thats a good choice. When you cast this ability I want it to instantly suck all enemy units in the aoe to the center of the dispel magic cast point. Finally I want to figure out how to create a temporary barrier around that point trapping units there for (X) seconds. Thanks for feedback sorry my grammar isn't the best x D
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I'm not good at all doing spells like this... but:

I have to say that the best Dummy Skill is "Channel", since it does nothing. It's there just for those skills which effects are triggered. Also provides almost all kinds of customizations.

Making the vacuum effect is hard. Using "Pick every unit and Move Picked Unit to Target Point of Ability Being cast" would be instant move, but would do your effect :p

About the barrier, I don't know how to make a barrier like "Thrall's" in DotA, where allied units can go through but enemies not. I Guess it uses some kind of "Move unit instantly to Point with offset -1 towards Facing Direction of Triggering Unit" checking every 0.03 second.

For a fixed barrier (like trees or something) you can use
- Set Point = Target Point of Ability Being Cast
- For each integer A from 1 to 360 do
-- Set Angle = Angle + 1
-- Set Point2 = Point 1 with offset *Your·AoE·Range* towards Angle
-- Create 1 PathBlocker (Destructible, Unit, or whatever) at Point2
-- Add a Generic Expiration timer to LastCreated*Thing* that will expire in *Duration Of Your Spell*.

That loop should create 1 blocker for every angle (1, 2, 3, 4... 359, 360), at a certain distance (Point2 Offset) and remove the PathBlocker (Expiration timer). If Path Blocker is a Unit with a collision size bigger than 1, the units will probably stack and eventually re-order, destroying your "barrier". If they're destructibles, I think they won't be created if the path is blocked.

I'm not sure if this would work though, haven't even tested. This should at least give you a clue.
 
Level 6
Joined
Oct 4, 2011
Messages
226
Okay well i just opened the editor and edited the channel ability and its not even a useable ability o_O im really lost there. its 2 am here im gonna go to sleep now but thanks for your help i read over it ima look over it again in the morning maybe a formula for making a nice circle barrier of pathing blockers would suffice. Goodnight
 
Level 12
Joined
Oct 16, 2010
Messages
680
if you going to create a barrier like "Thrall's" it will be a little bit complicated

How it works:
every for example 0.03 sec you check every unit in the group (containing the sucked unit(s) ofc) if they are moved away from the center more then u want

calculates from coordinations ( x , y ) which direction the unit is moving and calculates from the units movespeed how much u have to pull the unit backward
that is equals how far the unit moves under 0.03 sec

EDIT: the x and y positions where u have to place the unit instantly based on where the unit is in every 0.03 sec ,
should be:
EnemyUnitsX = EnemyUnitsX + ((CenterX-EnemyUnitsX)/(([distance()]/ EnemyUnitsMoveSpeed)/0.03))
EnemyUnitsY = EnemyUnitsY + ((CenterY-EnemyUnitsY)/(([distance()]/ EnemyUnitsMoveSpeed)/0.03))

distance() = the distance between the enemy unit and the center of the spell like
squareroot((centerX-enemyX)^2+(centerY-enemyY)^2)

this should be done in every 0.03 period but check if the distance between the unit and the center is more then u want.

the effect will be that moonwalking unit at the edge of the border:p

if u not familiar with the idea or its too complicated for u i prefer for ask someone who can do this to u , or just use pathing blockers for it. the only problem with the pathing blockers, not just the enemy but not a single unit will be able to get trough.

Btw, to get the channel ability useable u should check the "visible" box in the spells "Data-Options"
 
Last edited:
Level 6
Joined
Oct 4, 2011
Messages
226
Lender, your a big help! thanks man. although the thrall mekansm seems very hard i feel i could do it its just Its a little hard for me to understand not seeing it in trigger form. its hard for me to tell what variables to create of type and whats really going on. If you could make it so i can use this as a sorta template that would be beautiful. If not i might try experimenting with the pathing blockers, (The Hero that is going to use it is ranged and basically im making an adventure map to pass the time, for my brother, He's going to be the only player in the map its gonna be campeign'ish) So blocking all units in the AoE might not be the biggest deal but im willing to givethe cleaner thrall version a shot.
 
Level 6
Joined
Oct 4, 2011
Messages
226
I want to do the thrall way I just need a clear system like Distance(INTEGER), EnemyUnitsX(POINT), I feel I can do it tho ;L
 
Level 6
Joined
Oct 4, 2011
Messages
226
Ya definately needs something done to be able to do this im fucking stumped T.T really i feel like a baby ;'( Even though ur advice was great man... im still clueless XD idk the order to put anything in and i try to turn your advice into triggers but i just fail -__-

How do you get to set a POINT type variable to an arithmatic? (EnemyUnitsX= EnemyUnitsX + etc...)
I think to make this work I need alot of details. If you don't want to I understand but if u help me + rep

Another small question: With the square root option, doesn't it automaticly do the sqaure root math i dont need to add the ^2's in right?
 
Last edited:
Level 6
Joined
Oct 4, 2011
Messages
226
What i got so far...

  • Barrier
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Barrier
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Barrier for (Triggering unit)) Equal to 1
        • Then - Actions
          • Set BarrierCastFORGROUP_Point = (Target point of ability being cast)
          • Set BarrierCasting_Unit = (Triggering unit)
          • Set Barrier_UnitG = (Units within 325.00 of BarrierCastFORGROUP_Point matching ((((Matching unit) belongs to an enemy of (Owner of BarrierCasting_Unit)) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is dead) Equal to False) and (((M
          • Set BarrierCastX_Point = (X of (Target point of ability being cast))
          • Set BarrierCastY_Point = (Y of (Target point of ability being cast))
          • Set BarrierDistance_Real = ((Square root((BarrierCastX_Point - Barrier_RealConvertedX))) + (Square root((BarrierCastY_Point - Barrier_RealConvertedY))))
          • Trigger - Turn on Barrier Recenter <gen>
          • Wait 3.10 game-time seconds
          • Trigger - Turn off Barrier Recenter <gen>
          • Custom script: call RemoveGroup(udg_Barrier_UnitG)
        • Else - Actions
This is the periodic .03 seconds trigger.

  • Barrier Recenter
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
      • Unit Group - Pick every unit in Barrier_UnitG and do (Actions)
        • Loop - Actions
          • Set Barrier_RealConvertedX = (X of (Position of (Picked unit)))
          • Set Barrier_RealConvertedY = (Y of (Position of (Picked unit)))
          • Set BarrierEUnitsMovespeed_Real = (Current movement speed of (Picked unit))
          • Set Barrier_RealConvertedX = (Barrier_RealConvertedX + (BarrierCastX_Point - (Barrier_RealConvertedX / (BarrierDistance_Real / (BarrierEUnitsMovespeed_Real / 0.03)))))
          • Set Barrier_RealConvertedY = (Barrier_RealConvertedY + (BarrierCastY_Point - (Barrier_RealConvertedY / (BarrierDistance_Real / (BarrierEUnitsMovespeed_Real / 0.03)))))
          • Unit - Move (Picked unit) instantly to (Point(Barrier_RealConvertedX, Barrier_RealConvertedY))
When i cast it, it warps the unit group to the bottom right of the screen they flash for a while and are removed lol. I think i messed up my Remove Unit group script also.. >.> i forget sometimes.
 
Level 12
Joined
Oct 16, 2010
Messages
680
Another small question: With the square root option, doesn't it automaticly do the sqaure root math i dont need to add the ^2's in right?

Well , not really . (centerX-enemyX)^2 equals with (centerX-enemyX)*(centerX-enemyX) tried to mean that is powered
Sorry for the mislead
Try this:
Set BarrierDistance_Real = Square root( Power(BarrierCastX_Point - Barrier_RealConvertedX , 2 ) + Power(BarrierCastY_Point - Barrier_RealConvertedY , 2 ))


Set Barrier_RealConvertedX = (Barrier_RealConvertedX + (BarrierCastX_Point - (Barrier_RealConvertedX / (BarrierDistance_Real / (BarrierEUnitsMovespeed_Real / 0.03)))))
Set Barrier_RealConvertedY = (Barrier_RealConvertedY + (BarrierCastY_Point - (Barrier_RealConvertedY / (BarrierDistance_Real / (BarrierEUnitsMovespeed_Real / 0.03)))))

um, this is not exactly what i told . Parentheses are really important.
It should look like this:
Set Barrier_RealConvertedX = Barrier_RealConvertedX + ((BarrierCastX_Point - Barrier_RealConvertedX) / ((BarrierDistance_Real / BarrierEUnitsMovespeed_Real) / 0.03))

try setting it up in this order:

1. Barrier_RealConvertedX + ( )
2. Barrier_RealConvertedX + ( / )
3. Barrier_RealConvertedX + ((BarrierCastX_Point - Barrier_RealConvertedX)/( ))
4. Barrier_RealConvertedX + ((BarrierCastX_Point - Barrier_RealConvertedX)/(( )/0.03))
5. Barrier_RealConvertedX + ((BarrierCastX_Point - Barrier_RealConvertedX)/((BarrierDistance_Real / BarrierEUnitsMovespeed_Real)/0.03))

And btw , remove that if /then/else from your second trigger
its useless
and make one inside the loop
that checks if the enemy tries to move out from the barrier
that means if the distance between the center of the barrier and the unit is more then the amount u want like 300.
only than do those calculates and ofc the positioning
 
Last edited:
Status
Not open for further replies.
Top