Jump to content


Photo

AI controlled teams


  • Please log in to reply
8 replies to this topic

#1 Ruthrelad

Ruthrelad
  • Members
  • 22 posts

Posted 31 May 2015 - 04:23 AM

I am trying make my spawned teams be controlled by an AI. The AI controls units that are created but he ignores the teams. I tried setting the the option 'team member are AI recruitable' but it didn't work. Is there any way to achieve this or will I have to spawn the units 1 by 1?



#2 Ridder Geel

Ridder Geel

    Master Yelloh

  • T3A Staff
  • 10,852 posts
  • Location:The Netherlands (AKA: Holland)
  • Projects:RC Mod + SEE + RTS Engine
  •  The Dangerous T3A Team Chamber Member
  • Division:BFME
  • Job:T3A Staff

Posted 01 June 2015 - 07:28 AM

How so he ignores the team?

You usually just control the team via scripts, other than that the AI would treat them as a unit created normally, and it might not keep that team together, since I'll assume they are not in a horde :p


Ridder Geel

#3 Ruthrelad

Ruthrelad
  • Members
  • 22 posts

Posted 01 June 2015 - 03:13 PM

I had some weird issues with it.

I was making a normal map with a few edits before and when I scripted a horde to spawn for the AI it controlled the horde without fail. However, when I scripted a team to spawn it ignored the spawned team completely.

Now, however, I am having even more issues. I am working on a hero defense map and enemies are supposed to send waves to attack the players. I really don't know how to get the waves to attack the players adequately. At first I thought that if I simply give the units to the AI he will control them to attack by that didn't work, even when I spawned only hordes (the method that worked for me on another map) the AI did absolutely nothing even as a brutal.

I tried using the attack-move but that way the enemies ignore the buildings on the players which is not good at all - player can just spam 200 towers and troll the mentally-handicapped enemies. I then tried to make the teams attack the team of the player directly. This looked promising but soon I found that it too was not adequte since some teams ignored every player team other than the one they were ordered to attack.

Is there a way to make those teams 'smart-attack' those players so they move and attack everything including buildings?



#4 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

Posted 01 June 2015 - 03:31 PM

Yes. When they enter your area of structures, units and whatnot, order them to start attacking

*** IF ***
     Team 'your AI team here' is all inside  area 'your base' (Surfaces Allowed: GROUND).
*** THEN ***
   Team 'your AI team here' attack anything in  area 'your base'

This is pretty simple.

 

@About your first problem, this is probably because the AI controls units by teams aswell, so if you give them a new team you would need to rescript the AI stuff (wich is very complex) for that team.

Did you spawn single units for a different team or just the basic player_x team?


Edited by -SilverBane-, 01 June 2015 - 03:37 PM.

2qm3dd5.jpg


#5 Ruthrelad

Ruthrelad
  • Members
  • 22 posts

Posted 01 June 2015 - 04:42 PM

I spawned the single hordes for the same player team as the original. I didn't test much when it didn't work on the hero map so as far as I know it could be a fluke not worth taking note off. 

I will try attack units in area command and update the post soon. Thanks for the suggestion.



#6 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

Posted 01 June 2015 - 05:04 PM

Yeah, thats what i was thinking. They do behave when belonging to normal team, but stand idle when having a custom teams because there are no scripts for that team. Thats likely the only way to spawn units and to have them be controlled by AI (sorry for bad english im in hurry)


2qm3dd5.jpg


#7 Ruthrelad

Ruthrelad
  • Members
  • 22 posts

Posted 01 June 2015 - 05:48 PM

The method of making them attack anything in area seems to work but since I am using 4 copies of 1 team in a wave in poses a problem. I can deactivate the script that tells them to go attack anything so it will work for only one of the groups (the first who gets there) but if I don't deactivate it then it seems for every moment the team is in the area it is given an order and as a result it stops in its movement every second.

I'll either have to make 3 more copies of each team or make a new script for every group and have a copy of the attack anything script after it turning what was once 2 scripts into 8. Is there an easier way around this?



#8 -SilverBane-

-SilverBane-

    Inactive Noob

  • Project Team
  • 474 posts
  • Location:Bucharest
  • Projects:Life
  •  Mapper & Coder

Posted 01 June 2015 - 06:55 PM

name the teams different and make for each of it. If your new to scripting, welcome to EA scripts :p there's no easier way


2qm3dd5.jpg


#9 Ruthrelad

Ruthrelad
  • Members
  • 22 posts

Posted 01 June 2015 - 09:15 PM

Fuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu--- Oh well, looks like I will have to create 80 teams >.<






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users