• 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] A footman spawning trigger

Status
Not open for further replies.
Level 5
Joined
Dec 4, 2007
Messages
111
Hello I'm making a footman frenzy type of a map and I was wondering how can I make efective triggering. Meaning should I make a seperate trigger for every player (highly improbable) or should I make a seperate trigger for every type of unit produced. If you have another sugestion feel free to share it :)
 
Level 16
Joined
Oct 12, 2008
Messages
1,570
Make it a loop,,
Maybe a loop in a loop?
  • For each Integer A from 1 to 12
    • loop - Actions
      • For each Integer B from 1 to (The amount of footman you want)
        • loop - Actions
          • Set TempLoc = Center of YourRegion
          • Create 1 Footman @ Temploc for (Player(Integer A))
  • Custom script: call RemoveLocation(udg_TempLoc)
 
Level 5
Joined
Dec 4, 2007
Messages
111
Make it a loop,,
Maybe a loop in a loop?
  • For each Integer A from 1 to 12
    • loop - Actions
      • For each Integer B from 1 to (The amount of footman you want)
        • loop - Actions
          • Set TempLoc = Center of YourRegion
          • Create 1 Footman @ Temploc for (Player(Integer A))
  • Custom script: call RemoveLocation(udg_TempLoc)

How will this help I can create several footman with one single action without the need of intergers



Edit : sorry for double post
 
Level 5
Joined
Dec 4, 2007
Messages
111
Uhm, this way you can add them to a unit group easyly, if you dont want that, you can just create 5 (or so) footman directly under the Integer A loop

Maybe but still I don't understand how can this help me please be more accurate
 
Level 9
Joined
Apr 3, 2008
Messages
700
  • Actions
    • Set TempGroup = (Units of type SpawningBuilding)
    • Unit Group - Pick every unit in TempGroup and do (Actions)
      • Loop - actions
        • Set TempLoc = (Position of (Picked unit))
        • Unit - Create 1 Spawn for (Owner of (Picked unit)) at TempLoc facing Default building facing (270.0) degrees
        • Point - Remove TempLoc
    • Unit Group - Destroy unit group TempGroup
And you don't need loop if you want to create many units.

Giantr said:
I'm want to learn you see
Learn Jass so. There is no such word as"efficiency" if you're using GUI.
 
Level 5
Joined
Dec 4, 2007
Messages
111
Jass seems too much complex all that writing and such is not for me. And I'd rather learn GUI before setting out to do jass
 
Level 9
Joined
May 30, 2008
Messages
430
i don't know what u need exactly but u need 1 trigger that have to be

every X seconds of game time

Actions
if then else
cond
if units of type barrack for player 1 equal to 1
act
create 1 footman for player 1 at his start location

if then else
cond
if units of type crypt for player 1 equal to 1
act
create 1 ghoul for player 1 at his start location

and so on and this is symple and leak free
 
Level 5
Joined
Dec 4, 2007
Messages
111
  • Spawn Footmen
    • Events
      • Time - Every 6.00 seconds of game time
    • Conditions
    • Actions
      • Set Unit_Group = (Units in (Playable map area) matching (((Unit-type of (Matching unit)) Equal to Barracks) and (((Matching unit) is alive) Equal to True)))
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • Set Point = (Position of (Picked unit))
          • Unit - Create 1 Footman for (Owner of (Picked unit)) at Point facing Default building facing degrees
          • Custom script: call RemoveLocation(udg_Point)
      • Custom script: call DestroyGroup(udg_Unit_Group)
I think this is better but there is one slight problem I have to do a seperate trigger for every unit (and that is not the most efficient way to go) So can anyone tell how can I not make a seperate trigger for every unit and if not possible I'll let it be.
 
Status
Not open for further replies.
Top