Scripting

Download scenarios and talk about scenario design.
Moderators: Slitherine Core, BA Moderators

Moderators: Slitherine Core, BA Moderators

Post Reply
MikeAP
Master Sergeant - U-boat
Master Sergeant - U-boat
Posts: 543
Joined: Fri Sep 03, 2010 3:14 pm

Scripting

Post by MikeAP »

I'm still here - still trying to learn the BA2 editor.

This time I'm trying to understand scripting and how the developer/scenario designers were able to script things.

I'm looking at Mission 5 from the Barbarossa Campaign - at one point you take a counter-attack from a group of soviet tanks and I'm just wondering how it was done. I checked the mission in the editor and see that the units in question are on TEAM 7.

Code: Select all

//Move TEAM 7
	if( (side==1) && (GetTurn() >= 4) && (GetGlobal("team7_act") == 0) )
	{
		SetGlobal("team7_act",1);
		SetTeamOrder(1, 7, 0, MakeAIOrderAIPoint(5, 0));
		SetTeamOrder(1, 7, 1, MakeAIOrderAIPoint(2, 0));
	}
It looks like they will initiate movement on TURN 4, but what does SetTeamOrder mean? 1 = side? 7 = team? 0 = turn?

And then MakeAIOrderAIPoint - are they being ordered to move to point 5 on turn 0?

I wish we had a Scripting plugin to make this easier.

Any help would be appreciated. BA2 is still the best tactical turn-based game out there.
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Scripting

Post by pipfromslitherine »

SetTeamOrder is documented (along with all the internal commands) in the file Documents/My Games/BA2/AUTODOCS/battlescript.txt

MakeAIOrderAIPoint is a script command (that is, defined in the scripting somewhere) - if you are using Notepad++ (which you should be) it's pretty easy to find in files and take a look at the code itself for the function.

Cheers

Pip
follow me on Twitter here
Post Reply

Return to “Battle Academy 2: Scenario Design”