• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

how do i move unit after finishing structure?

Status
Not open for further replies.
Level 3
Joined
Aug 29, 2012
Messages
22
this is my trigger (its my first time doing this lol)

gec4o9uwp

http://postimg.org/image/gec4o9uwp/

after my ordered unit finishes constuction how do i order him to move in a point?
 
Level 21
Joined
Nov 4, 2013
Messages
2,017
First thing is that you do not need to make screenshots of your triggers, you can use the trigger tags
folder.gif
to copy your triggers. You just right click on all your triggers then on "Copy as Text" and then you paste in the tags. Since I want to solve your problem, you will also see how to use the trigger tags correctly:

  • Barracks01
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Unit - Create 1 Mur'gul Slave (BUILDER) for Player 2 (Blue) at (Center of PeonSpawn <gen>) facing Default building facing degrees
      • Sound - Play MurlocReady1 <gen> at 100.00% volume, attached to (Last created unit)
      • Unit - Order (Last created unit) to build a Spawning Grounds at (Center of Barracks01 <gen>)
However, your triggers leak twice which means that you may suffer from lag when you play the game for a long period (well, these two leaks are insignificant but if you have excessive leaks then it gets problematic). To remove the leaks you have (location leaks in your case), you'll have to add these functions:

  • Barracks01
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set PeonSpawn = (Center of PeonSpawn <gen>)
      • Set BarracksBuildPoint = (Center of Barracks01<gen>)
      • Unit - Create 1 Mur'gul Slave (BUILDER) for Player 2 (Blue) at PeonSpawn facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_PeonSpawn)
      • Sound - Play MurlocReady1 <gen> at 100.00% volume, attached to (Last created unit)
      • Unit - Order (Last created unit) to build a Spawning Grounds at BarracksBuildPoint
      • Custom script: call RemoveLocation(udg_BarracksBuildPoint)
PeonSpawn and BarracksBuildPoint are two Point variables. To create them, press Ctrl + B, then Ctrl + N, type the name of one of the two variables, select Point as variable type then press OK. Repeat this for the other variable. Once you did that, use the Set Variable function to insert the first two commands. Use Custom Script for the other two new other commands. You must copy exactly these words in the first script call RemoveLocation(udg_PeonSpawn) and these words call RemoveLocation(udg_BarracksBuildPoint) in the second one. Now you fixed the leaks but not your problem yet. What you want to achieve is nearly impossible because, as mogulkhan1Axe said, there are no commands to refer to the unit building a structure. There is a semi-solution that will serve the purpose. Firstly, you must create a Unit variable (do the same things you did for the point variables but instead of selecting point, select unit). Name the variable Worker for example and add this function just below the "Create 1 Mur'gul" command:

  • Set Worker = (Last created unit)
Now create a whole new trigger now (call it Worker Finishes Construction for example)

  • Worker Finishes Construction
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Spawning Grounds
    • Actions
      • Trigger - Turn off (This trigger)
      • Set A New Point Variable You'll Have To Create = (Center of region where worker will move)
      • Unit - Order Worker to Move to (Point)
      • Custom script: call RemoveLocation(udg_Point)
That's all. I'd also recommend reading this tutorial about leaks since it could help you prevent other types of leaks.
 
Level 3
Joined
Aug 29, 2012
Messages
22
First thing is that you do not need to make screenshots of your triggers, you can use the trigger tags
folder.gif
to copy your triggers. You just right click on all your triggers then on "Copy as Text" and then you paste in the tags. Since I want to solve your problem, you will also see how to use the trigger tags correctly:

  • Barracks01
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Unit - Create 1 Mur'gul Slave (BUILDER) for Player 2 (Blue) at (Center of PeonSpawn <gen>) facing Default building facing degrees
      • Sound - Play MurlocReady1 <gen> at 100.00% volume, attached to (Last created unit)
      • Unit - Order (Last created unit) to build a Spawning Grounds at (Center of Barracks01 <gen>)
However, your triggers leak twice which means that you may suffer from lag when you play the game for a long period (well, these two leaks are insignificant but if you have excessive leaks then it gets problematic). To remove the leaks you have (location leaks in your case), you'll have to add these functions:

  • Barracks01
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Set PeonSpawn = (Center of PeonSpawn <gen>)
      • Set BarracksBuildPoint = (Center of Barracks01<gen>)
      • Unit - Create 1 Mur'gul Slave (BUILDER) for Player 2 (Blue) at PeonSpawn facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_PeonSpawn)
      • Sound - Play MurlocReady1 <gen> at 100.00% volume, attached to (Last created unit)
      • Unit - Order (Last created unit) to build a Spawning Grounds at BarracksBuildPoint
      • Custom script: call RemoveLocation(udg_BarracksBuildPoint)
PeonSpawn and BarracksBuildPoint are two Point variables. To create them, press Ctrl + B, then Ctrl + N, type the name of one of the two variables, select Point as variable type then press OK. Repeat this for the other variable. Once you did that, use the Set Variable function to insert the first two commands. Use Custom Script for the other two new other commands. You must copy exactly these words in the first script call RemoveLocation(udg_PeonSpawn) and these words call RemoveLocation(udg_BarracksBuildPoint) in the second one. Now you fixed the leaks but not your problem yet. What you want to achieve is nearly impossible because, as mogulkhan1Axe said, there are no commands to refer to the unit building a structure. There is a semi-solution that will serve the purpose. Firstly, you must create a Unit variable (do the same things you did for the point variables but instead of selecting point, select unit). Name the variable Worker for example and add this function just below the "Create 1 Mur'gul" command:

  • Set Worker = (Last created unit)
Now create a whole new trigger now (call it Worker Finishes Construction for example)

  • Worker Finishes Construction
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Spawning Grounds
    • Actions
      • Trigger - Turn off (This trigger)
      • Set A New Point Variable You'll Have To Create = (Center of region where worker will move)
      • Unit - Order Worker to Move to (Point)
      • Custom script: call RemoveLocation(udg_Point)
That's all. I'd also recommend reading this tutorial about leaks since it could help you prevent other types of leaks.

thanks for the help :)
 
Status
Not open for further replies.
Top