CT ?

Moderator: rbodleyscott

Post Reply
Athos1660
Major-General - Jagdtiger
Major-General - Jagdtiger
Posts: 2761
Joined: Wed May 29, 2019 3:23 pm

CT ?

Post by Athos1660 »

In a Scenario, I'd like to have the AI army take a Cohesion Test (as in Ambush (own)) when the player's units (already on the battlefield) appear in line of sight. How can I do that ?
Athos1660
Major-General - Jagdtiger
Major-General - Jagdtiger
Posts: 2761
Joined: Wed May 29, 2019 3:23 pm

Re: CT ?

Post by Athos1660 »

What about CT triggered by friendly broken units appearing in line of sight ?
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28429
Joined: Sun Dec 04, 2005 6:25 pm

Re: CT ?

Post by rbodleyscott »

To make that happen immediately the event occurs, I can't think of a way to do it in a scenario script, so it would require some modding of other scripts.
Richard Bodley Scott

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

Re: CT ?

Post by Paul59 »

Athos1660 wrote: Thu Jan 13, 2022 3:25 pm In a Scenario, I'd like to have the AI army take a Cohesion Test (as in Ambush (own)) when the player's units (already on the battlefield) appear in line of sight. How can I do that ?
This is a script I constructed for a future scenario that imposes a Cohesion test on all AI units in turn 13 ((GetTurn() == 24) actually means AI turn 13):

Code: Select all

	if (GetTurn() == 24)
		{
	        for (i = 0; i < GetUnitCount(1); i++)  // for every unit in side
		        {
			        id = GetUnitID(1, i);
			        if (id != -1)
				        {
					        SetAttrib(id, "MoraleTestDue", 1);
				        }
		        }

          DoProximityMoraleTests(side);		
	    }
It goes into the FUNCTION StartTurnPost(side) section.

This could be adapted to trigger the Cohesion tests when a player unit enters a defined area, but like Richard, I cannot see how it can be triggered by units entering LOS.
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.
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28429
Joined: Sun Dec 04, 2005 6:25 pm

Re: CT ?

Post by rbodleyscott »

Paul59 wrote: Fri Jan 14, 2022 10:06 am
Athos1660 wrote: Thu Jan 13, 2022 3:25 pm In a Scenario, I'd like to have the AI army take a Cohesion Test (as in Ambush (own)) when the player's units (already on the battlefield) appear in line of sight. How can I do that ?
This is a script I constructed for a future scenario that imposes a Cohesion test on all AI units in turn 13 ((GetTurn() == 24) actually means AI turn 13):

Code: Select all

	if (GetTurn() == 24)
		{
	        for (i = 0; i < GetUnitCount(1); i++)  // for every unit in side
		        {
			        id = GetUnitID(1, i);
			        if (id != -1)
				        {
					        SetAttrib(id, "MoraleTestDue", 1);
				        }
		        }

          DoProximityMoraleTests(side);		
	    }
It goes into the FUNCTION StartTurnPost(side) section.

This could be adapted to trigger the Cohesion tests when a player unit enters a defined area, but like Richard, I cannot see how it can be triggered by units entering LOS.
And the other point is that it has to be in the StartTurnPost() function, and hence happens at the start of the turn after the event occurs, not immediately when the event occurs.
Richard Bodley Scott

Image
Athos1660
Major-General - Jagdtiger
Major-General - Jagdtiger
Posts: 2761
Joined: Wed May 29, 2019 3:23 pm

Re: CT ?

Post by Athos1660 »

Thank you, Richard and Paul, for your help.
Post Reply

Return to “Field of Glory II: Medieval - Scenario Design”