• 🏆 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!

How to start an AI ? Detect Player slots controlled by computer

Status
Not open for further replies.
Level 4
Joined
Apr 15, 2016
Messages
61
I'm starting to create an AI. Well I didn't start yet, but I know what I'll do to command them (it's a simply deathmatch map, just order them to move around, etc, detect enemy cast skills, etc). I just don't know where to start, how to detect players that are in game and those who aren't and those who are Computer. The game starts (starts for REAL) after a dialog box button is clicked (choosing the stage). Then players will take control of a wisp (which is used to enter a circle of power, to then, choose the Hero). But the problem is to make a computer controlled slot take control of its wisp and order it to do the stuff.
 
Pick all players.
If player is controlled by computer set CPU_int = CPU_int+1 (integer variable)
Set AIplayer[CPU_int] = (picked player)

Then whenever you want to order all AI players to do something loop for integer A from 1 to CPU_int. And do actions.

Or if you want to order just one AI player to do something you can find it by number. Loop for A again, but this time set a condition owner of triggering unit = integer A. If true then do actions fot that player.

There is also just a condition Player controller = computer. Why not do that?
 
Status
Not open for further replies.
Top