• 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 Help!!!

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,243
  • Trigger 018
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Iron Forged Swords
    • Actions
      • Trigger - Turn on Spawn <gen>
  • Spawn
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Loc_1 = Center of Region something
      • Unit - Create 1 Footman for Player 1 (Red) at Temp_Loc_1 facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)
Spawn is initially off.
 
Level 11
Joined
May 31, 2008
Messages
698
dont do that. Instead of turning a trigger on just make one trigger for each spawning unit that picks all players in ArcherGroup (example for archers maybe). When a player researches Archers Spawn just add them to the group. That way you dont need to make a trigger for each player for each unit.
 
Level 11
Joined
May 31, 2008
Messages
698
Make a player group for each kind of creep. For example if you had archers and grunts:

AddSpawn
Unit finishes research (or whatever ur event is)
no conditions
make an if/then/else for each creep
if research is Archers
then add Owner of triggering unit to ArcherGroup
if research is Grunts
then add owner of triggering unit to Grunt Group


SpawnUnits
Every 5 seconds
Pick all players in ArcherGroup and create one archer for picked player at ArcherSpawnRegion
Pick all players in GruntGroup and create one grunt for picked player at GruntSpawnRegion

You just have to do that for every unit there is. You only need those 2 triggers.
 
Level 8
Joined
Sep 18, 2008
Messages
298
Your idea is still to confusing, i dont understand what to do with if/then/else, and idk just confusing..

EDIT: Well i figured out what i did wrong, i made it a Unit Group not a player, i then did everything you told me to, and it still wouldnt work, even if it did though, i would have to make tons of triggers for the spawn location
Heres what i did:
  • Red OrcRed
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • If ((Researched tech-type) Equal to Fel Orc Summon ) then do (Player Group - Add (Owner of (Triggering unit)) to FelOrcGrunt) else do (Do nothing)
  • RedOrcSRed
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set Temp_Loc = Red Spawn <gen>
      • Player Group - Pick every player in FelOrcGrunt and do (Unit - Create 1 Footman for (Picked player) at (Center of Red Spawn <gen>) facing (Position of (Triggering unit)))
 
Last edited:
Level 11
Joined
May 31, 2008
Messages
698
Unit - A unit Finishes an upgrade
Change to Unit - A unit Finishes research
Also make TempLoc a point not a region and set it to the center of the region u want
Using a unit group is wrong did u even read what hes trying to do?

Here are the 3 triggers you will need:

  • SetVars
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Set UnitType[0] = Footman
      • Set UnitType[1] = Knight
      • Set UnitType[2] = Rifleman
      • Set UnitType[3] = Mortar Team
      • Set UnitType[4] = Flying Machine
      • Set UnitType[5] = Gryphon Rider
      • Set UnitType[6] = Priest
      • Set TechType[0] = Footman Summon
      • Set TechType[1] = Knight Summon
      • Set TechType[2] = Rifleman Summon
      • Set TechType[3] = Mortar Team Summon
      • Set TechType[4] = Flying Machine Summon
      • Set TechType[5] = Gryphon Rider Summon
      • Set TechType[6] = Priest Summon
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set SpawnLoc[(Integer A)] = ((Player((Integer A))) start location)
  • Research
    • Events
      • Unit - A unit Finishes research
    • Conditions
    • Actions
      • For each (Integer A) from 0 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Researched tech-type) Equal to TechType[(Integer A)]
            • Then - Actions
              • Player Group - Add (Owner of (Triggering unit)) to SpawnGroup[(Integer A)]
            • Else - Actions
  • Spawn
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to 6, do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in SpawnGroup[(Integer A)] and do (Actions)
            • Loop - Actions
              • Unit - Create 1 UnitType[(Integer A)] for (Picked player) at SpawnLoc[(Player number of (Picked player))] facing Default building facing degrees
 
Level 8
Joined
Sep 18, 2008
Messages
298
Unit - A unit Finishes an upgrade
Change to Unit - A unit Finishes research
Also make TempLoc a point not a region and set it to the center of the region u want
Using a unit group is wrong did u even read what hes trying to do?

Here are the 3 triggers you will need:

  • SetVars
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Set UnitType[0] = Footman
      • Set UnitType[1] = Knight
      • Set UnitType[2] = Rifleman
      • Set UnitType[3] = Mortar Team
      • Set UnitType[4] = Flying Machine
      • Set UnitType[5] = Gryphon Rider
      • Set UnitType[6] = Priest
      • Set TechType[0] = Footman Summon
      • Set TechType[1] = Knight Summon
      • Set TechType[2] = Rifleman Summon
      • Set TechType[3] = Mortar Team Summon
      • Set TechType[4] = Flying Machine Summon
      • Set TechType[5] = Gryphon Rider Summon
      • Set TechType[6] = Priest Summon
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set SpawnLoc[(Integer A)] = ((Player((Integer A))) start location)
  • Research
    • Events
      • Unit - A unit Finishes research
    • Conditions
    • Actions
      • For each (Integer A) from 0 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Researched tech-type) Equal to TechType[(Integer A)]
            • Then - Actions
              • Player Group - Add (Owner of (Triggering unit)) to SpawnGroup[(Integer A)]
            • Else - Actions
  • Spawn
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to 6, do (Actions)
        • Loop - Actions
          • Player Group - Pick every player in SpawnGroup[(Integer A)] and do (Actions)
            • Loop - Actions
              • Unit - Create 1 UnitType[(Integer A)] for (Picked player) at SpawnLoc[(Player number of (Picked player))] facing Default building facing degrees

I already told you i re-did it with player group

And thx for the help but what your telling me to do is a bit advance for me, i dont even understand whats happeneing in that trigger
 
Level 11
Joined
May 31, 2008
Messages
698
Well you shud learn how loops and variable arrays work.

  • For each (Integer A) from 0 to 6, do (Actions)
  • Loop - Actions
    • Player Group - Pick every player in SpawnGroup[(Integer A)] and do (Actions)
      • Loop - Actions
        • Unit - Create 1 UnitType[(Integer A)] for (Picked player) at SpawnLoc[(Player number of (Picked player))] facing Default building facing degrees
All that this does is this:

  • Player Group - Pick every player in SpawnGroup[0] and do (Actions)
    • Loop - Actions
      • Unit - Create 1 UnitType[0] for (Picked player) at SpawnLoc[(Player number of (Picked player))] facing Default building facing degrees
And it does that for spawn group 1, 2, 3 ...
So really all you are doing is creating group arrays and unit type arrays and you associate the group number with the unit type. So we set UnitType[0] = Footman. So really SpawnGroup[0] (which is a player group btw) is used for making footmen. It will select every player in SpawnGroup[0] and create a unit type UnitType[0] which we already set to footman, so it will make a footman. Here is where we set UnitType[0] to a footman

  • SetVars
  • Events
    • Time - Elapsed game time is 0.50 seconds
  • Conditions
  • Actions
    • Set UnitType[0] = Footman
 
Status
Not open for further replies.
Top