Victory conditions

Moderators: rbodleyscott, Slitherine Core, Gothic Labs

Post Reply
Warlord156
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 86
Joined: Sun Oct 19, 2014 9:56 pm
Location: Sussex Weald, England.

Victory conditions

Post by Warlord156 »

Can anybody please tell me 'exactly' how to change the % in the scenario victory conditions. I have spent two days 'tinkering' with the scenario script, and achieved nothing (except for one time, when the enemy army lost heart at 33%, no idea how that happened). I have studied the scenario template and tools etc, but unfortunately my tiny brain does not speak hieroglyphs. Any help will be greatly appreciated, but keep in mind that I need to be explained to as if I were a 4 year old. A working example would be extremely helpful.
Thanks guys......
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28294
Joined: Sun Dec 04, 2005 6:25 pm

Re: Victory conditions

Post by rbodleyscott »

It is fairly straightforward. Look in ScenarioTemplate.BSF lines 88-93. The comments above those lines give instructions.
FUNCTION VictoryConditions()
{
StandardVictoryConditions(60, 40, 60, 40, 2, 0); // The last parameter should be 1 instead of 0 for Multiplayer scenarios.

return 1; // VictoryConditions() must return a non-zero value so that the main program knows it exists and therefore not to use the default version.
}
The red numbers are the numbers to change. They are the 1st and 2nd breakpoints for side0 and the 1st and 2nd breakpoints for side1.

The counterintuitive thing is that they are expressed in % of troops unrouted. (Because that was the way the UI reported the situation until it was changed late in the development process to report % routed)

So if you wanted side0's first Break point to be 33% routed, you would change the first 60 to 67. (Because 33% routed = 67% unrouted).
Richard Bodley Scott

Image
Warlord156
Senior Corporal - Ju 87G
Senior Corporal - Ju 87G
Posts: 86
Joined: Sun Oct 19, 2014 9:56 pm
Location: Sussex Weald, England.

Re: Victory conditions

Post by Warlord156 »

Thanks for the info Richard....
At least I was on the right track. The key word there was UNrouted, everything I did was backward, ie I was using routed %.
Thanks again.
Paul59
General - King Tiger
General - King Tiger
Posts: 3859
Joined: Tue Jul 21, 2015 11:26 pm

Re: Victory conditions

Post by Paul59 »

Sorry to resurrect an old thread, but once you have changed the Victory Conditions in the ScenarioTemplate.BSF, how do you get the new conditions to display on screen?
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: 28294
Joined: Sun Dec 04, 2005 6:25 pm

Re: Victory conditions

Post by rbodleyscott »

Paul59 wrote:Sorry to resurrect an old thread, but once you have changed the Victory Conditions in the ScenarioTemplate.BSF, how do you get the new conditions to display on screen?
You need to put the new victory conditions in a uniquely named IDS_ string in the campaign text1.txt or text9.txt and then replace the string parameter in

StandardScenarioUI("IDS_SCENUI_VC_STANDARD", 1);

in

DrawScenarioUI()

in

scenarioTemplate.BSF

with your string's name.

Change the second parameter to 0 if you don't want it to display the standard extensions. (You can check that out by trial and error).

Here is an example from the Lostwithiel scenario:

Code: Select all

FUNCTION DrawScenarioUI()
	{
		StandardScenarioUI("IDS_SCENUI_VC_LOSTWITHIEL_PARLIAMENT", 0);
		
		return 1; // DrawScenarioUI() must return a non-zero value so that the main program knows it exists and therefore not to use the default version.
	}
Richard Bodley Scott

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

Re: Victory conditions

Post by Paul59 »

Thanks for that Richard, I have got that working now.

Please can you also tell me how to implement a turn limit and how that is displayed on screen?

I have entered these values in the scenario.bsf, but to no effect;

FUNCTION PreBattleSetup()
{
// Set multiplier for unit strength reporting
SetUniversalVar("StrengthMultiplier", 100);

// Set counter for StartTurnPost AI routines
SetUniversalVar("TurnCounter", 1);

// Needs to be set if scenario uses deadline
SetUniversalVar("ScenarioDeadline", 26);


Regards

Paul
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: 28294
Joined: Sun Dec 04, 2005 6:25 pm

Re: Victory conditions

Post by rbodleyscott »

Paul59 wrote:Thanks for that Richard, I have got that working now.

Please can you also tell me how to implement a turn limit and how that is displayed on screen?

I have entered these values in the scenario.bsf, but to no effect;

FUNCTION PreBattleSetup()
{
// Set multiplier for unit strength reporting
SetUniversalVar("StrengthMultiplier", 100);

// Set counter for StartTurnPost AI routines
SetUniversalVar("TurnCounter", 1);

// Needs to be set if scenario uses deadline
SetUniversalVar("ScenarioDeadline", 26);


Regards

Paul
SetUniversalVar("ScenarioDeadline", 26) sets the turn limit. (Note that player turns are numbered 0 2 4 6 etc for side0 and 1 3 5 7 etc for side1. So IIRC if you want a turn limit of 26 turns each, you need to set ScenarioDeadline to 51 (or maybe 52).

If you use StandardScenarioUI() the turns remaining should be displayed on the left hand side of the screen if GetUniversalVar("ScenarioDeadline") > 0.

If you can't make it work, send me your scenario .BSF file and I will see if I can find what is wrong.
Richard Bodley Scott

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

Re: Victory conditions

Post by Paul59 »

Hi Richard,

I can't get it to work. I do want a scenario length of 26 turns, but I was trying lesser numbers because I wanted to see if the battle would end at the deadline without having to play through so many turns, it did not. The turns remaining counter does not display either. I am using a custom ScenarioUI text, but I tested it with the StandardScenarioUI and it still did not work.

I will send you the .bsf file, to see if you can help. I must be doing something wrong, but I cannot see it myself.

Many thanks.
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.
Post Reply

Return to “Scenario Design”