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

[Trigger] The Moving Portal

Status
Not open for further replies.
Level 4
Joined
Jan 2, 2008
Messages
103
This is driving me insane, a unit (Pride) casts an ability, and unit(Summoner) spawns somewhere on the map, this works fine.
Then, you move the unit (Summoner) onto a circle and a unit is created at your start location. Also works fine, now, near your start location is a unit (Portal) with the "waygate ability".

I am trying to get the waygate destination to the casting unit (Pride).

What is wrong with this trigger?


  • HumanSummoner
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Unit-type of (Triggering unit)) Equal to Pride
      • Then - Actions
        • Unit - Create 1 Human Summoner for (Owner of (Triggering unit)) at (Center of HumanSSpawn <gen>) facing Default building facing degrees
        • Camera - Pan camera as necessary for (Owner of (Triggering unit)) to (Center of HumanSSpawn <gen>) over 1.00 seconds
        • Unit Group - Pick every unit in (Units owned by (Owner of (Casting unit)) of type Portal) and do (Actions)
          • Loop - Actions
            • Neutral Building - Set (Picked unit) destination to (Position of (Casting unit))
      • Else - Actions
        • Do nothing
 
Last edited:
Level 4
Joined
Dec 4, 2007
Messages
76
Well I dont quite clearly understand your problem, but maybe you could a trigger like this:

  • Portal
    • Events
      • Unit - A unit comes within 100.00 of Portal
    • Conditions
    • Actions
      • Unit - Move (Triggering unit) instantly to (Position of (Pride))
Now the catch to this trigger is that "Pride" needs to be a variable of type "unit". In your first trigger, when the unit casts the spell, Add the action "Set Variable - Set Pride = (Casting Unit)" This way the game will know that when any unit (most likely the summoner, you can add conditions for that) comes within 100 range of "Portal" It will move that unit to the position of the casting unit. If this isint your exact problem please specify and maybe I can help some more.
 
Level 4
Joined
Jan 2, 2008
Messages
103
@Daedin Sorry, but the trigger has to run somewhat like mine does, there are 6 different units that can cast, and 6 different units to move, 8 different portals, ect. So can't be specific.

@Jetfang If it's leaking, how may I fix it?
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Set a group variable to the group you need and then instead of that "udg_PlayerGroup" put your variable name.

For example, if your group variable was named "Group", then the code would be "udg_Group".

In this case you don't really need this.
You can just put this code before (a line before) you pick the units
  • Custom script: set bj_wantDestroyGroup = true

This will destroy the group after it finished its actions.
 
Status
Not open for further replies.
Top