Defending a line

Post Reply
Odenathus
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 287
Joined: Sat Jun 27, 2009 10:02 pm

Defending a line

Post by Odenathus »

Hi again

I want side 1,Team 5 to defend a line of wagons, so initially set them to 64. The line runs from 39,47 to 39,26.

After (if) the line is breached by any of Side 0 except light troops, Team 5 needs to be released to attack them wherever they are on general attack 16, + ignoring light troops 128: is this...

{
if(side==0)
{IfPlayerUnitIn(39,47,39,26,1)==1)
{MoveTeamCoord(1,5,-1-1,144);
}
}
}

Cheers
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28052
Joined: Sun Dec 04, 2005 6:25 pm

Re: Defending a line

Post by rbodleyscott »

Odenathus wrote:Hi again

I want side 1,Team 5 to defend a line of wagons, so initially set them to 64. The line runs from 39,47 to 39,26.

After (if) the line is breached by any of Side 0 except light troops, Team 5 needs to be released to attack them wherever they are on general attack 16, + ignoring light troops 128: is this...

{
if(side==0)
{IfPlayerUnitIn(39,47,39,26,1)==1)
{MoveTeamCoord(1,5,-1-1,144);
}
}
}

Cheers
Looks about right to me. Try it and let me know if it doesn't work as you wish.
Richard Bodley Scott

Image
Odenathus
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 287
Joined: Sat Jun 27, 2009 10:02 pm

Re: Defending a line

Post by Odenathus »

No joy unfortunately, the BSF accepted the script after some wrestling with the right number of {, but it didn't affect Team 5's actions in the battle, they weren't triggered by Side 0's units entering that area..

Do I dimly remember from our P&S days that these areas can't be single lines, but have to be a box, i.e. at least one square wide/deep? I may be making that up.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28052
Joined: Sun Dec 04, 2005 6:25 pm

Re: Defending a line

Post by rbodleyscott »

Odenathus wrote:No joy unfortunately, the BSF accepted the script after some wrestling with the right number of {, but it didn't affect Team 5's actions in the battle, they weren't triggered by Side 0's units entering that area..
Best email me the scenario and let me try it. Or at least the scripts.
Richard Bodley Scott

Image
Paul59
General - King Tiger
General - King Tiger
Posts: 3808
Joined: Tue Jul 21, 2015 11:26 pm

Re: Defending a line

Post by Paul59 »

Odenathus wrote:Hi again

I want side 1,Team 5 to defend a line of wagons, so initially set them to 64. The line runs from 39,47 to 39,26.

After (if) the line is breached by any of Side 0 except light troops, Team 5 needs to be released to attack them wherever they are on general attack 16, + ignoring light troops 128: is this...

{
if(side==0)
{IfPlayerUnitIn(39,47,39,26,1)==1)
{MoveTeamCoord(1,5,-1-1,144);
}
}
}

Cheers
I think "if(side==0)" should actually read "if(side==1)". That might be the problem?
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
Odenathus
Staff Sergeant - StuG IIIF
Staff Sergeant - StuG IIIF
Posts: 287
Joined: Sat Jun 27, 2009 10:02 pm

Re: Defending a line

Post by Odenathus »

That was it Paul, Richard solved via a direct e-mail. Ta.
Post Reply

Return to “Field of Glory II: Scenario Design”