Can't get AI to work for cat and mouse map.

OuTLawZ-GoSu

New Member
Reaction score
0
I'm working on a cat and mouse map. Everything is working exept the computer. I need the computer to chase the mice, but I always get this weird problem. When ever I order the computer to attack a unit, the the computer's units move a little bit, then go back to their spawn points.

Someone suggested this trigger to fix the problem:
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Order (Units in (Playable map area) owned by Player 12 (Brown)) to Attack (Random unit from MouseGroup)

Player 12 is the computer
Players 1-8's units are in the group MouseGroup.

But when the cats try to attack, they keep picking random units too fast and end up running back and fourth, looking confused. They never attack, just run back and forth.

I couldn't find any refrences that would help me, there are no unprotected cat and mouse type games with ai available, or I just didn't look hard enough.

I spent alot of time on this, and I'm still stuck.

What can I do to make the cats attack like they do in Starcraft cat and mouse maps? Help?
 

Bonzo

New Member
Reaction score
4
Your cats are running forwards and backwards, becaus every 0.1 seconds they get the order to attack another mouse.
So you either need another event to run this trigger (like a unit(mouse) dies or a unit(cat) enters region or anything like that.
Or you set the custom variable of a cat to 1 after you have ordered it and add a condition that says if the custom variable of picked unit is equal to 0 then do <attack> else do nothing. Then you make a new trigger that runs when a unit(mouse) dies pick every cat and do if orderstring = <empty string> then set custom variable of picked unit = 0.

Greets Bonzo
 

OuTLawZ-GoSu

New Member
Reaction score
0
The part with custom values sounds complicated as hell for me. I'm gonna try the first suggestion. Then if it dont work, I'll try to figure out how to do the second part.
 

saw792

Is known to say things. That is all.
Reaction score
280
Increase the timer on that trigger to something like 4 seconds. That way the cats will only change targets every 4 seconds, so they will have time to actually run. The thing with that is, all the cats will run for the same mouse each time. Is that what you want? Otherwise you will need a different trigger, so let us know.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top