• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

How to create unis on line?

Status
Not open for further replies.
Level 1
Joined
Nov 4, 2012
Messages
2
So, I'm making map where you defend a castle. Problem is, that I want more units on the walls than editor allows to be placed. I know how to create more units in the beginning of the game by using triggers, but my problem is that they all spawn on small area, though region where they should be is quite large. So how can I make them form clear lines instead of one big bunch?
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I hope I understood the question correctly, so you want to create units in a line with triggers?

If that is the case, then this should do:
  • Actions
    • Set tempLoc1 = (Center of (Playable map area))
    • For each (Integer A) from 0 to 9, do (Actions)
      • Loop - Actions
        • Set tempLoc2 = (tempLoc1 offset by (80.00 x (Real((Integer A)))) towards 0.00 degrees)
        • Unit - Create 1 Footman for Player 1 (Red) at tempLoc2 facing Default building facing degrees
        • Custom script: call RemoveLocation( udg_tempLoc2 )
    • Custom script: call RemoveLocation( udg_tempLoc1 )
Info:
  • tempLoc1 defines the initial location, such as the corner of the wall.
  • In this case, 10 units will spawn. Edit the last number of the loop (from 0 to 9) to "units to spawn - 1". (So for 15 units: from 0 to 14).
  • The offset (80.00 * Integer A) defines how far from each other they will spawn (change the 80.00 to whatever you like).
  • The angle defines the angle of the line (0.00 degrees is a horizontal line, 90.00 is a vertical line - anything else is possible too).
  • The "RemoveLocation"s are necessary to remove the leaks (which slow down the game).
 
Status
Not open for further replies.
Top