• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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