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

[Solved] heeeelep! i have a problem with triggers

Status
Not open for further replies.
hello everyone i am ghost thruster i am very new to forums and would like to recieve help on my trigger. i made a custom squad system but it did not work plz help i will give credits in my map Ultimate Hero Arena Matrix v45.3a (it is still in the alpha but i will finished it)

ive narrowed the problem down to one action, which seems to not be work:
  • training
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
    • Actions
      • For each (Integer index[1]) from 1 to squad_types, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Trained unit)) Equal to squad_dummy[index[1]]
            • Then - Actions
              • Trigger - Turn on numbers <gen>
              • -------- indexing for the number of squads on field --------
              • Set squads_index1 = (squads_index1 + 1)
              • Set squads_index2 = (squads_index2 + 1)
              • Set squads_on[squads_index1] = True
              • Set squads_total[squads_index1] = squad_no[index[1]]
              • -------- making the new squad --------
              • Set point[1] = (Position of (Trained unit))
              • Set point[2] = (Rally-Point of (Triggering unit) as a point)
              • Unit - Remove (Trained unit) from the game
              • -------- beware, will not work if squad_no[Integer A] is > 12 --------
              • For each (Integer index[2]) from 1 to squad_no[index[1]], do (Actions)
                • Loop - Actions
                  • Unit - Create 1 squad_unit[index[1]] for (Owner of (Trained unit)) at point[1] facing Default building facing degrees
                  • -------- the below action fucks up - somehow after squads_squad[1], there won't be a squads_squad[2] --------
                  • Unit Group - Add (Last created unit) to squads_squad[squads_index1]
              • Unit Group - Order squads_squad[squads_index1] to Attack-Move To point[2]
              • Set squads_lead[squads_index1] = (Last created unit)
              • Unit - Add Squad Capn to (Last created unit)
              • Custom script: call RemoveLocation(udg_point[1])
              • Custom script: call RemoveLocation(udg_point[2])
              • Custom script: exitwhen 0 == 0
            • Else - Actions
my map is below thank you for he;p
 

Attachments

  • squad.w3x
    21.2 KB · Views: 47
im looking now, but in the mean time, can you please find out why the current indexing is fucked up in my system?

edit: defskull like i said our systems are too different. its almost impossible for me to put in your method of picking units, checking who their squad leader is, and ordering them individually because a) what if a squad leader changes, or dies? b) picking units in a group and ordering them one-by-one does not make the move in formation
 
Last edited:
Status
Not open for further replies.
Top