BR-Alexandre
14 years ago
I messed up with the AI's attack priority sistem with scripting, can someone explain me how that works? I've tried but can't understand that sistem myself...

thanks
"The Only Way To Have Peace is Prepare for War" <---I forgot who said this...
"Lasers make superior weapons!" <--- Townes
"Laser crusader ready for engagement" <--- Laser Crusader Tank
"Tactical lasers online" <--- Avenger Support Venhice
"Storm climbed mountain" <--- Pathfinder Elite Infantry
"Ready for covert mission" <--- Stealth Fighter Tactical Support
Sponsor
i^love^mixery
14 years ago
well.. its simple.

example:

1. For priority list "test" set the default priority to 1.

2. For priority list "test" set the priority to:
USA Avenger -> 4
USA Crusader -> 3
USA Humvee -> 2

3. Apply this set to any unit or team, then that team will first attack avengers, then crusaders, then humvees. if there are no avengers, crusaders or humvees they will attack any other unit they can see - because the "default priority" is 1.

If there is no prioritized unit and if the default priority is 0 then the units using this priority list will not shoot at all.
svarionare
14 years ago
i^love^mixery: where do i have to put the command of attack(or hunt)?I mean, at the begginning of the scripts (before to define priorities)or after "have use that priority attack" line?
i^love^mixery
14 years ago

i^love^mixery: where do i have to put the command of attack(or hunt)?I mean, at the begginning of the scripts (before to define priorities)or after "have use that priority attack" line?

svarionare wrote:



i think its better if you first set them to use a specific priority list and then let them attack/hunt.

for teams you can also use subroutines for this.

like

*IF*
true
*THEN*
Team use attack priority set "test".

(i hope you know how team subroutines work)
svarionare
14 years ago
can you make an example using subroutines,please? I don't understand very well how they work...
thanks
BR-Alexandre
14 years ago



for teams you can also use subroutines for this.

like

*IF*
true
*THEN*
Team use attack priority set "test".

(i hope you know how team subroutines work)

i^love^mixery wrote:



i have to put this somewhere on team's behavior tab or just make is [SAd] is enought?
if i do like your example, the team will first kill any avenger units on the map then go for crusaders or just priorize avenger when there are lots of units in range?

"The Only Way To Have Peace is Prepare for War" <---I forgot who said this...
"Lasers make superior weapons!" <--- Townes
"Laser crusader ready for engagement" <--- Laser Crusader Tank
"Tactical lasers online" <--- Avenger Support Venhice
"Storm climbed mountain" <--- Pathfinder Elite Infantry
"Ready for covert mission" <--- Stealth Fighter Tactical Support
i^love^mixery
14 years ago

can you make an example using subroutines,please? I don't understand very well how they work...
thanks

svarionare wrote:



just create a subroutine script (mark the "Script is Subroutine" option in the script) and then you can select this script in a dropdown menu in the teams window.

so you can make for example a script like:

*IF*
True

*THEN*
Move team "This team" to wayopint "test".

if you now attach this script to any team, they will use this script and move to the waypoint test.



for teams you can also use subroutines for this.

like

*IF*
true
*THEN*
Team use attack priority set "test".

(i hope you know how team subroutines work)

BR-Alexandre wrote:



i have to put this somewhere on team's behavior tab or just make is [SAd] is enought?
if i do like your example, the team will first kill any avenger units on the map then go for crusaders or just priorize avenger when there are lots of units in range?

i^love^mixery wrote:



you can either put it in a team subroutine or just make a [SAd]script. it doesnt matter.

once you attach this priority set to a team they will not forget it again so its enough if you do it once. but the team of course has to exist when you tell them to use the priority list. and im not sure if newly created team members will use it too. i guess its better to use subroutines.

if the default priority is 0 and if you set it only for avengers to 1 then they will hunt ONLY for avengers and completely ignore everything else.

if the default priority is 1 then they will only focus on avengers if there are any in range. if not they will attack something else or a lower priorized unit than the avenger.
BR-Alexandre
14 years ago
i've been trying to set attack priority for AI teams for a while but no success.
i think the problem is that i can't set the team to use the custom priorities.
i'll attach the map here so anyone can say where did i miss in the scripting process

EDIT: i don't know if its only in my computer but the zipped file shows as adoble stuff....and i neither know how do that works...   Alpine Assualt 2-Edited(multiplay).zip.zip (173kb) downloaded 20 time(s).
"The Only Way To Have Peace is Prepare for War" <---I forgot who said this...
"Lasers make superior weapons!" <--- Townes
"Laser crusader ready for engagement" <--- Laser Crusader Tank
"Tactical lasers online" <--- Avenger Support Venhice
"Storm climbed mountain" <--- Pathfinder Elite Infantry
"Ready for covert mission" <--- Stealth Fighter Tactical Support
i^love^mixery
14 years ago
not sure. it should work fine the way you scripted it.. maybe its because the same team exists multiple times so that the game failes to apply the set.

maybe try it with subroutines instead.

like

*** IF ***
True
*** THEN ***
Have Team '<This Team>' use Attack priority set 'Air_Stealth fighter'.

btw: that AI scripts are really awesome. well done.
BR-Alexandre
14 years ago
I'll try put the priority scripts in the team's behavior tab. you know the stuff with "on create, on unit destroied" and if it don't work i come back here. thanks.

btw: that AI scripts are really awesome. well done.

i^love^mixery wrote:


Happy to hear that, i've been working on them a while, wanna see if someone can defeat them. Thanks for CnC labs for the help and for the map.

EDIT:i've tried the map after the new sistem was used. i'm happy to report Success. i saw, for the first time, AI stealth figthers go for enemy artillery instead infantry. now the rest is up to me to chose which ones are the best targets. thnaks for the support people 😃
"The Only Way To Have Peace is Prepare for War" <---I forgot who said this...
"Lasers make superior weapons!" <--- Townes
"Laser crusader ready for engagement" <--- Laser Crusader Tank
"Tactical lasers online" <--- Avenger Support Venhice
"Storm climbed mountain" <--- Pathfinder Elite Infantry
"Ready for covert mission" <--- Stealth Fighter Tactical Support
i^love^mixery
14 years ago
im glad that it works now :D

i suppose ur AI is completly unbeatable now 🙂
businessphones
14 years ago
You have worked very well on your AI and it is now truly unbeatable...
BR-Alexandre
14 years ago
ok I'm posting the scripts here but i've been low on time so only some factions (USA, GLA, China, Laser and Airforce) have attack priority scripted. when its done i'll post the "full" version. i'll also post the map here but it is not mine, only the scripts are   Brutal AI Scripts ZH.zip (81kb) downloaded 25 time(s).   Alpine Assualt 2-Edited(multiplay).zip (174kb) downloaded 8 time(s).
"The Only Way To Have Peace is Prepare for War" <---I forgot who said this...
"Lasers make superior weapons!" <--- Townes
"Laser crusader ready for engagement" <--- Laser Crusader Tank
"Tactical lasers online" <--- Avenger Support Venhice
"Storm climbed mountain" <--- Pathfinder Elite Infantry
"Ready for covert mission" <--- Stealth Fighter Tactical Support