1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Pull Unit

Discussion in 'Triggers & Scripts' started by F.M.A, Feb 19, 2006.

  1. F.M.A

    F.M.A

    Joined:
    Sep 18, 2005
    Messages:
    72
    Resources:
    0
    Resources:
    0
    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 :?
     
  2. Frozenfire3D

    Frozenfire3D

    Joined:
    Oct 30, 2005
    Messages:
    51
    Resources:
    0
    Resources:
    0
    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
     
  3. MeanMachine

    MeanMachine

    Joined:
    Mar 2, 2006
    Messages:
    40
    Resources:
    1
    Models:
    1
    Resources:
    1
    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 (Text):

    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 (Text):

    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 (Text):

    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.
     
  4. Jacek

    Jacek

    Joined:
    Nov 25, 2004
    Messages:
    1,291
    Resources:
    0
    Resources:
    0
    just a note:

    this spell isn't multiinstance - two or more these spells can't be cast at same moment.
     
  5. MeanMachine

    MeanMachine

    Joined:
    Mar 2, 2006
    Messages:
    40
    Resources:
    1
    Models:
    1
    Resources:
    1
    Another note - GUI doesn't have all the JASS functions. I can post it in JASS and it'll be 100% multicastable, but i don't think it's wise to use too many portals at the same time.