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

[AI] AI

Status
Not open for further replies.
Level 4
Joined
Jul 25, 2014
Messages
57
  • Szolgak2pihenoek
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Peasant) and do (Actions)
        • Loop - Actions
          • Set semmitcsinaloszolgak = (Last created unit group)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Not equal to Peasant
            • Then - Actions
              • Unit Group - Remove (Matching unit) from semmitcsinaloszolgak
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current order of (Picked unit)) Not equal to (Order(<Empty String>))
                • Then - Actions
                  • Unit Group - Remove (Matching unit) from semmitcsinaloszolgak
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Picked unit)) Not equal to Player 10 (Light Blue)
                    • Then - Actions
                      • Unit Group - Remove (Matching unit) from semmitcsinaloszolgak
                    • Else - Actions
      • Set semmitcsinaloszolgakszama = (Number of units in semmitcsinaloszolgak)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • semmitcsinaloszolgakszama Less than 3
        • Then - Actions
          • Unit - Order fohaz to train/upgrade to a Peasant
        • Else - Actions

It never triggers the final actions, although the conditions are true.
Maybe "empty string" doesn´t works like the unit has no order?


Edit : Now it halfly works: it produces peasants, but doesn´t stops at the right time.
 
Last edited:
Level 4
Joined
Jul 25, 2014
Messages
57
So... I tried to make it without using that command, but still doesn´t works:

  • Szolgak2pihenoek Copy
    • Events
      • Time - Every 10.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Picked unit)) Not equal to Peasant)) and do (Actions)
        • Loop - Actions
          • Set szolgagroup = (Last created unit group)
      • Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue) matching ((Current order of (Triggering unit)) Equal to (Order(<Empty String>)))) and do (Actions)
        • Loop - Actions
          • Set szolgagroupowner = (Last created unit group)
      • Unit Group - Remove all units of szolgagroup from szolgagroupowner
      • Set szolgacount = (Number of units in szolgagroupowner)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • szolgacount Less than 2
        • Then - Actions
          • Game - Display to (All players) the text: semmitcsinaloszolga...
          • Unit - Order fohaz to train/upgrade to a Peasant
        • Else - Actions
          • Game - Display to (All players) the text: Nem


The texts are only for me, because i tested it´s work by them.
 
Level 11
Joined
Dec 19, 2012
Messages
411
  • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Picked unit)) Not equal to Peasant)) and do (Actions)
    • Loop - Actions
      • Set szolgagroup = (Last created unit group)
Change (Picked unit) to (Matching unit)

  • Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue) matching ((Current order of (Triggering unit)) Equal to (Order(<Empty String>)))) and do (Actions)
    • Loop - Actions
      • Set szolgagroupowner = (Last created unit group)
Change (Triggering unit) to (Matching unit)

Probably would work
 
Last edited:
Level 11
Joined
Dec 19, 2012
Messages
411
Sorry, my mistake. I didn't notice originally your unit group got problem.

  • Unit Group - Pick every unit in (Units in (Playable map area) matching ((Unit-type of (Picked unit)) Not equal to Peasant)) and do (Actions)
    • Loop - Actions
      • Set szolgagroup = (Last created unit group)
  • Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue) matching ((Current order of (Triggering unit)) Equal to (Order(<Empty String>)))) and do (Actions)
    • Loop - Actions
      • Set szolgagroupowner = (Last created unit group)
The Action :
  • Set szolgagroup = (Last created unit group)
is wrongly used. It only works for (Unit - Create Units) action. If you want to add peasant into unit group, use
  • Unit Group - Add yourUnit to yourGroup
 
Level 4
Joined
Jul 25, 2014
Messages
57
Thank you. This way it finally works :
  • Szolgak2pihenoek
    • Events
      • Time - Every 10.01 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Peasant) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to szolgagroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Picked unit)) Not equal to (Order(<Empty String>))
            • Then - Actions
              • Unit Group - Remove (Picked unit) from szolgagroup
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Not equal to Player 10 (Light Blue)
                • Then - Actions
                  • Unit Group - Remove (Picked unit) from szolgagroup
                • Else - Actions
      • Set szolgacount = (Number of units in szolgagroup)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • szolgacount Less than 2
        • Then - Actions
          • Game - Display to (All players) the text: semmitcsinaloszolga...
          • Unit - Order fohaz to train/upgrade to a Peasant
        • Else - Actions
          • Game - Display to (All players) the text: Nem
 
Status
Not open for further replies.
Top