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

Roundbased: Order of unpausing units

Status
Not open for further replies.
Level 1
Joined
May 9, 2010
Messages
4
Hey guys,
I spent the last 4 days on trying to create a roundbased map.

After few trys, i got the movement system working; a unit can use the Ability "Walk" (based on Channeling) to move from field to field.

But now i want the units to be unpaused in the order of their intelligence.
So the Unit with the highest intelligence should be unpaused first and after the owning player ordered the unit to cast a spell it should be unlocked again and the next unit should be unpaused.

But after i tried it for days and hours, i cant create a system, that puts the units in the right order in an array and unpausing them in the right order and kicking out dead units...

If someone could give me some inspiration or an example how this could work properly, i would be very thankful!
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
I believe this works, didn't have any time to optimize it:

  • Untitled Trigger 018
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set Units[0] = Blademaster 0032 <gen>
      • Set Units[1] = Archmage 0000 <gen>
      • Set Units[2] = Paladin 0003 <gen>
      • Set Units[3] = Shadow Hunter 0024 <gen>
  • Untitled Trigger 017 Copy
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • For each (Integer loopB) from 1 to 3, do (Actions) // from 1 to max index
        • Loop - Actions
          • For each (Integer loopA) from 0 to 2, do (Actions) // from 0 to max index - 1
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Intelligence of Units[loopA] (Include bonuses)) Greater than (Intelligence of Units[(loopA + 1)] (Include bonuses))
                • Then - Actions
                  • Set u1 = Units[(loopA + 1)]
                  • Set Units[(loopA + 1)] = Units[loopA]
                  • Set Units[loopA] = u1
                • Else - Actions
      • For each (Integer loopA) from 0 to 3, do (Actions)
        • Loop - Actions
          • Game - Display to Player Group - Player 1 (Red) for 30.00 seconds the text: (String((Unit-type of Units[loopA])))
I'll check it when I get back home.
 
Status
Not open for further replies.
Top