• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Ai issue?

Status
Not open for further replies.
Level 12
Joined
Dec 2, 2016
Messages
733
  • SpawnHumans
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 1 (Red) slot status) Equal to Is playing
        • Then - Actions
          • If ((Player 1 (Red) slot status) Equal to Is playing) then do (Player - Set Player 1 (Red) Current lumber to 40) else do (Do nothing)
          • If ((Player 1 (Red) slot status) Equal to Is playing) then do (Player - Set Player 1 (Red) Food cap to 15) else do (Do nothing)
          • Unit - Create 1 Human for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
          • Selection - Add (Last created unit) to selection for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 2 (Blue) slot status) Equal to Is playing
        • Then - Actions
          • If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Player - Set Player 2 (Blue) Current lumber to 40) else do (Do nothing)
          • If ((Player 2 (Blue) slot status) Equal to Is playing) then do (Player - Set Player 2 (Blue) Food cap to 15) else do (Do nothing)
          • Unit - Create 1 Human for Player 2 (Blue) at (Player 2 (Blue) start location) facing Default building facing degrees
          • Selection - Add (Last created unit) to selection for Player 2 (Blue)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player 3 (Teal) slot status) Equal to Is playing
        • Then - Actions
          • If ((Player 3 (Teal) slot status) Equal to Is playing) then do (Player - Set Player 3 (Teal) Current lumber to 40) else do (Do nothing)
          • If ((Player 3 (Teal) slot status) Equal to Is playing) then do (Player - Set Player 3 (Teal) Food cap to 15) else do (Do nothing)
          • Unit - Create 1 Human for Player 3 (Teal) at (Player 3 (Teal) start location) facing Default building facing degrees
          • Selection - Add (Last created unit) to selection for Player 3 (Teal)
        • Else - Actions
^ This is my code that spawns humans based on if they're player slot color is being used.
Gyazo - af791f3c43878a5d0b7220b72c0f04f2.png
^ This shows that they are all user slots and not computer slots.
So red's human spawns which is mine, but somehow blue's human spawns, while teal's human does not spawn. Somehow it's thinking that slot is a computer slot anyone know what issue I'm having?

Even when I close the blue color slot entirely it still adds an computer to the game.
Edit: When I reset all players lots to default it only spawns one human. But as soon as I declare that blue, teal etc are on team 1. And brown and DG are on team 2, same issue a computer spawns in the blue color slot.
 
Last edited:
Level 16
Joined
Mar 27, 2011
Messages
1,349
I think checking someone's slot status will simply check if their slot (in the game lobby) is occupied. It doesn't matter if its a computer or user. I use the following line to check 2 things. Is the slot being used, and who is occupying the slot (a human or a computer):

((Player 1 (Red) slot status) Equal to Is playing) and ((Player 1 (Red) controller) Equal to User)

Also, you do not need to check their slot status twice. Try the below instead:

  • SpawnHumans
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player 1 (Red) slot status) Equal to Is playing) and ((Player 1 (Red) controller) Equal to User)
        • Then - Actions
          • Player - Set Player 1 (Red) Current lumber to 40
          • Player - Set Player 1 (Red) Food cap to 15
          • Unit - Create 1 Human for Player 1 (Red) at (Player 1 (Red) start location) facing Default building facing degrees
          • Selection - Add (Last created unit) to selection for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player 2 (Blue) slot status) Equal to Is playing) and ((Player 2 (Blue) controller) Equal to User)
        • Then - Actions
          • Player - Set Player 2 (Blue) Current lumber to 40
          • Player - Set Player 2 (Blue) Food cap to 15
          • Unit - Create 1 Human for Player 2 (Blue) at (Player 2 (Blue) start location) facing Default building facing degrees
          • Selection - Add (Last created unit) to selection for Player 2 (Blue)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player 3 (Teal) slot status) Equal to Is playing) and ((Player 3 (Teal) controller) Equal to User)
        • Then - Actions
          • Player - Set Player 3 (Teal) Current lumber to 40
          • Player - Set Player 3 (Teal) Food cap to 15
          • Unit - Create 1 Human for Player 3 (Teal) at (Player 3 (Teal) start location) facing Default building facing degrees
          • Selection - Add (Last created unit) to selection for Player 3 (Teal)
        • Else - Actions
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
I think that's a common behavior coming from Warcraft 3 - It always requires an opponent for starting a match whenever players do not have a fixed team. I mean, you should check "Fixed Player Settings" in "Scenario Properties" -> "Forces" tab.

Untitled-1.png
 
Status
Not open for further replies.
Top