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

Pull Unit

Status
Not open for further replies.
Level 4
Joined
Sep 18, 2005
Messages
72
Alright Im Making a spell where a herp creates a portal and all the surrounding enemy units are pulled towards it (you know the every 0.01 seconds move the unit towards variable distnace between X and X minus XX) That type of thing not move unit instantly or walk......help :?
 
Level 3
Joined
Oct 30, 2005
Messages
51
since im a kind guy, i'll tell you. . . It aint that difficult, although i havent experimented on it. And although i know it's something like DotA's black hole

Anyways, you HAVE to use move unit instantly. Unless you're using WEU, which has the unit slide function. The trigger for your ablity to basically should go like:


Trigger 1
Event:
A unit casts an ability
Condition:
Abiltiy equals to <whatever it's called>
Action:
-Create special effect at <target point of ability being cast>
-Trigger turn on <trigger 2>
-wait (Depends on how long you want your spell to be>
-Trigger turn off <trigger 2>



Trigger 2
Event:
Every 0.01 seconds
Condition:
none
Action:(i'm not sure if this works. It works for single units though)
-move units within <your own radius> rage of <target point of ability being cast> by offset 2 towards (i'm not sure about the angle)




This is about all the help i can give. Sorry if it doesnt prove useful enough. Just pray some skilled trigger artiste comes to your aid :D
 
Level 3
Joined
Mar 2, 2006
Messages
40
F.M.A said:
Alright Im Making a spell where a herp creates a portal and all the surrounding enemy units are pulled towards it (you know the every 0.01 seconds move the unit towards variable distnace between X and X minus XX) That type of thing not move unit instantly or walk......help :?
I can give you the exact trigger. First make your ability based on channel. Channel's purpose is practicaly doing nothig. Make it a point targetable, in options select visible and deselect disable other abilities. In follow throught time, well that's how long the channel will last. Change it's art - effect to the model of the portal. Now the triggering part. For a perfect speell i suggest hree triggers. One to begin, one to suck the units and the final to stop it :
Code:
Portal Begin
    Events
        Unit - A unit Begins channeling an ability
    Conditions
        (Ability being cast) Equal to Sucking Portal 
    Actions
        Set Portal_Point = (Target point of ability being cast)
        Set Player_Caster = (Owner of (Casting unit))
        Countdown Timer - Start Portal_Timer as a Repeating timer that will expire in 0.10 seconds
Code:
Portal Suck
    Events
        Time - Portal_Timer expires
    Conditions
    Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units within 500.00 of Portal_Point matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of Player_Caster) Equal to True))) and do (Actions)
            Loop - Actions
                Unit - Move (Picked unit) instantly to ((Position of (Picked unit)) offset by 10.00 towards (Angle from (Position of (Picked unit)) to Portal_Point) degrees)
Code:
Portal Stop
    Events
        Unit - A unit Stops casting an ability
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to Sucking Portal 
    Actions
        Countdown Timer - Pause Portal_Timer
And finaly explaining the thing. The first trigger is easy. It sets up the variables. The point is needed for the spell to know where to suck the units. The player is used in the condition of the next trigger to suck only enemies. And finaly, the timer. Timers are 100000 times better then the wait action for small periods of time. The second trigger activates each time the timer expires. It picks every unit in 600 range of the portal point and moves them closer. The third trigger will activate when you stop or finish the ability. It stops the timer, so the second trigger so it won't activate again at least till the next cast :lol: Finally, set bj_wantDestroyGroup = true means that this will destroy the next created group. Use this custom script every time before you use "Pick every unit/item/player/etc...", otherwise it will ceep adding and adding groups till the game crashes. I hope i helped you.
 
Status
Not open for further replies.
Top