Posted by: klingondragon - Wednesday, January 11, 2017 11:48:57 AM
I've decided to start mapping again.
I'm starting by getting my old maps up to scratch.
I have a map which has the player as the boss general VS vanilla USA, GLA, and China.
The AI builds and attacks as I want them to. Except my aircraft teams.
Neither helicopters nor planes build.
The script used is the same as for my other units:
[code]
[S A nd] [E N H]UScreate:
*** IF ***
True.
*AND* Team '' all exit area 'US Base' (Surfaces Allowed: Ground or Air).
*** THEN ***
Start building team Team ''
[/code]
Once they're created they should move off:
[code]
[S A nd] [E N ]oncreateair:
*** IF ***
True.
*** THEN ***
Team '' change their attitude to Aggressive
Have Team '' wander along Waypoint Path 'Air'
[/code]
Posted by: zero hour mad map maker - Wednesday, January 11, 2017 12:06:16 PM
Are the aircraft that you are building in the Team's building list? (Where teams are named and created).
I don't have my WB on hand (as I am using different computer and am out at the moment), but I know there's a better way to create teams and such than those scripts there.
Posted by: klingondragon - Wednesday, January 11, 2017 12:10:58 PM
Yes.
Posted by: zero hour mad map maker - Wednesday, January 11, 2017 12:18:32 PM
Well, I know if you're making a Generals' challenge sortish of map, one of the ways that makes the AI flow easily is creating a generic wave counter.
But, I should really have my World Builder instead of misleading you. I'll have to assist a bit later; unless someone else does or you figure out the problem.
Posted by: zero hour mad map maker - Wednesday, January 11, 2017 6:00:32 PM
[quote=klingondragon;142779]
I have a map which has the player as the boss general VS vanilla USA, GLA, and China.
[/quote]
This is pretty generic. So, may I ask, is this similar to a General's Challenge map in which the AI send waves of enemies at you and has their own base defenses. Or is this like an AOD map where the AI send waves of moving enemies. (Some AOD maps even have an AI base). So I'd like more of a feel as to what this mission is before I spend some time on the issue at hand.
And if it is a General's Challenge type of map, then I assumed correctly.
Posted by: klingondragon - Wednesday, January 11, 2017 6:43:42 PM
It's neither. It's like the campaign missions. It shouldn't matter what kind of map of is. Only that I'm trying to build the team rather than spawn it.
Posted by: zero hour mad map maker - Wednesday, January 11, 2017 7:00:06 PM
Just upload the map for me to take a look at it. It'll be quicker that way [wink]
Posted by: klingondragon - Wednesday, January 11, 2017 7:04:30 PM
I'll upload in the morning. My laptop is off and I shouldn't even be awake now.
Posted by: zero hour mad map maker - Wednesday, January 11, 2017 7:16:55 PM
Okay! Yeah it's like past midnight in UK..... only 6:16pm here lol xD.
Posted by: klingondragon - Thursday, January 12, 2017 8:43:37 AM
Here you go:
Posted by: zero hour mad map maker - Thursday, January 12, 2017 10:03:13 AM
Alright! I found the problem(s).
[img]https://s20.postimg.org/9a0mu8yd9/Null_scipt.png[/img]
The reason the USA AI wasn't building the Aircraft was that this script basically said:
"This Team must exit the USA's exit area US Base"
Well, this script is telling the game that the USA Aircraft team must exit the area then create the team once the Aircraft have left the US Base. Well, this simply will never happen because the Aircraft team cannot leave the area if they haven't even been created yet.
So to fix the issue on the script delete the *AND* statement. I wasn't even quite sure why it was in there in the first place. I've never seen a True and an AND in the same condition xD.
I also changed the Oncreate script to say this:
*** IF ***
[b]Team 'USA Air' has been created.[/b]
*** THEN ***
Team '' change their attitude to Aggressive
Have Team '' wander along Waypoint Path 'Air'
The next issue was on your edit teams list.
[img]https://s20.postimg.org/9bakno071/Check_mark_it.png[/img]
You just simply forgot to check "Team members are AI Recruitable."
And with these changes the USA AI now builds them and attacks with them! [wink]
[img]https://s20.postimg.org/65pyxghkt/Being_Built.png[/img]
[img]https://s20.postimg.org/txza8zjlp/Attacking.png[/img]
I have also attached the fixed map for ya. [+1] [ATTACH]2000[/Attach]
Posted by: klingondragon - Thursday, January 12, 2017 10:45:29 AM
Your first thing shouldn't be a problem (one of the Humvees starts on that team and as soon as the game starts it leaves the area).
That second one, I'll give it a try on my own version.
Posted by: zero hour mad map maker - Thursday, January 12, 2017 1:09:05 PM
It [b]is[/b] actually. Only checking the AI Recruitable will NOT fix it. Trust me I tried that before I looked at the scripts. Nothing.
It'll be a waste of time if I try to explain it to you because you'll just deny it. Besides that's why I much prefer in WB to set scripts like these:
(Set Waves counter)
*** IF ***
Flag named '_GAME_ON' IS TRUE
*** THEN ***
Add 1 to counter '_ESCALATION'
(First Wave)
*** IF ***
Counter '_ESCALATION' IS Greater Than or Equal To 60
*** THEN ***
Null operation. (Does nothing.)
(Second Wave)
*** IF ***
Counter '_ESCALATION' IS Greater Than or Equal To 120
*** THEN ***
Null operation. (Does nothing.)
Then put the teams production condition script to "Second Wave" or "First Wave"
Then have them follow these actions:
** IF ***
True.
*** THEN ***
Team '' executes Script 'GLA Attack Center Orders' sequentially.
*** IF ***
True.
*** THEN ***
Team '' load into transports.
Have Team '' move to the start of enemy path 'Center'.
Have Team '' approach the enemy using path 'Center', as a team is TRUE
Team '' unload.
Team '' attack anything in area 'PlayerArea'
You can also set priorities on the team list too, and also add in some attack priorities as well:
*** IF ***
True.
*** THEN ***
For Attack priority set 'GLA Default Priority' set the priority of object type 'Base Defenses' to 50
For Attack priority set 'GLA Default Priority' set the priority of object type 'Tanks' to 45
For Attack priority set 'GLA Default Priority' set the priority of object type 'Aircraft' to 40
For Attack priority set 'GLA Default Priority' set the priority of object type 'Infantry' to 40
For Attack priority set 'GLA Default Priority' set the priority of object type 'AmericaWarFactory' to 30
For Attack priority set 'GLA Default Priority' set the priority of object type 'AmericaAirfield' to 30
For Attack priority set 'GLA Default Priority' set the priority of object type 'AmericaBarracks' to 30
For Attack priority set 'GLA Default Priority' set the priority of object type 'AmericaStrategyCenter' to 30
For Attack priority set 'GLA Default Priority' set the priority of object type 'AmericaParticleCannonUplink' to 55
For Attack priority set 'GLA Default Priority' set the priority of object type 'AmericaCommandCenter' to 10
This helps give the AI some strategy rather than "running and gunning" so to speak. But, I digress.
You know, it's ok to admit that you're not right all the time ;).
Posted by: klingondragon - Thursday, January 12, 2017 1:20:03 PM
Well it worked for me. And I've had enough time to test it to my satisfaction and release it.
Posted by: zero hour mad map maker - Thursday, January 12, 2017 1:55:50 PM
Good for you ;)
Posted by: AdrianeMapMaker - Friday, January 13, 2017 2:20:32 AM
[b]This is a Good Thread ,i Got Something New Knowledge Here Thanks.[/b]
[b]
By The way in Zero hour MMM Said[/b]
[quote=Zero Hour Mad Map Maker;142834]So to fix the issue on the script delete the *AND* statement. I wasn't even quite sure why it was in there in the first place. I've never seen a True and an AND in the same condition xD. [/quote]
The [b]WorldBuilder[/b] Scripts add this 'And' Statement Because The Script Assume those Scripts will be feasible or Will Be done ,InOrder or Not.
And Also The [b]WorlBuilder[/b] Scripts Using 'Or' Statement... This Is Self explanatory ,This Will Cut The Relation about The other Scripts.