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

Problem with Trigger...

Status
Not open for further replies.
Level 5
Joined
May 12, 2013
Messages
70
I was trying to make a really simple AI for my map in which the AI heroes just moved around the map rather Attack-Moved around the map, but I'm not sure why, they aren't moving. Once they did, I don't know how. Now they don't. I'm confused. :S See this Trigger.
  • Untitled Trigger 018
    • Events
      • Time - Elapsed game time is 2.00 seconds
    • Conditions
      • (Player 2 (Blue) controller) Equal to Computer
    • Actions
      • Wait 1.00 seconds
      • Unit - Order (Random unit from (Units owned by Player 2 (Blue) matching (((Matching unit) is A Hero) Equal to True))) to Attack-Move To (Center of Region 001 <gen>)
  • Untitled Trigger 019
    • Events
      • Unit - A unit enters Region 001 <gen>
    • Conditions
      • ((Owner of (Entering unit)) controller) Equal to Computer
    • Actions
      • Unit - Order (Entering unit) to Attack-Move To (Center of Region 002 <gen>)
Anything wrong with these ? And also, I think they worked when I set the Computer to Computer(Normal) and didn't work when it was for easy or Insane or it was something like that. Please clarify, when the condition is set like above "Unit X is controlled by Computer" - Is that for all the Computers or a specific One ?
Thankyou.
 
Level 17
Joined
Mar 21, 2011
Messages
1,611
it doenst have to do anything with the computer difficulty. Under "Scenario -> Player Properties" you can change between User and Computer.


Here is an example:
you have 5 units owned by player 2, now, 1 of them gets randomed and get the order to move to the target location. Now the second one gets randomed, BUT! if it is the first one again, he gets the same order again and nothing really changes. if there is only 1 unit left on the start location, the chances are really low that it will start moving.
Solution: As you leak a group anyway, create a Group variable and store all your units owned by player 2 in there. now, random a unit and let it move, and while that, remove it from the group that it cannot be selected anymore

and i dont understand why youre using that "wait 1 seconds"
 
Level 5
Joined
May 12, 2013
Messages
70
it doenst have to do anything with the computer difficulty. Under "Scenario -> Player Properties" you can change between User and Computer.
I've selected all of them to User.

Here is an example:
you have 5 units owned by player 2, now, 1 of them gets randomed and get the order to move to the target location. Now the second one gets randomed, BUT! if it is the first one again, he gets the same order again and nothing really changes. if there is only 1 unit left on the start location, the chances are really low that it will start moving.
Solution: As you leak a group anyway, create a Group variable and store all your units owned by player 2 in there. now, random a unit and let it move, and while that, remove it from the group that it cannot be selected anymore
I know that. The thing is, all players i.e, Player 1, Player 2, etc. have just 1 Hero Player, so there's nothing to worry if some other unit gets selected since there is just one.
and i dont understand why youre using that "wait 1 seconds"
Ahaha, I thought so someone would point that out. I added that when I made the Event to be Map Initialization. Forgot to remove that.

Anyways, I just removed all the Triggers for the AI and remade them, and seems working now !
 
Status
Not open for further replies.
Top