specialvictoryconditions() cannot work separately without StandardVictoryConditions()?

Moderator: rbodleyscott

Post Reply
locustmustdie
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Fri Mar 05, 2021 11:33 am

specialvictoryconditions() cannot work separately without StandardVictoryConditions()?

Post by locustmustdie »

Modded VictoryConditions(),adding an if(blahblah) outside StandardVictoryCondition(),then specialvictorycondition() ceased to function. Typed the modded part out,SpecialVic works fine again.
locustmustdie
Senior Corporal - Destroyer
Senior Corporal - Destroyer
Posts: 117
Joined: Fri Mar 05, 2021 11:33 am

Re: specialvictoryconditions() cannot work separately without StandardVictoryConditions()?

Post by locustmustdie »

I see

Code: Select all

	
	if ((side0lost == 0) && (side1lost == 0))  // neither side "defeated".
		{
			done = TryToCallScenarioFunction("SpecialScenarioVictoryConditions"); // Any special scenario victory conditions that end the battle (and report to player)
SpecialScenarioVictoryConditions will not be executed unless called by FUNCTION VictoryConditions()

Code: Select all

// Special victory conditions can be applied using SpecialScenarioVictoryConditions() - see Lostwithiel.BSF for an example of this. If present in the scenario .bsf file,
// this function is run by StandardVictoryConditions() if neither army is broken.
Add an else segment to fix it

Code: Select all

FUNCTION VictoryConditions()
{
     if((GetGlobal("vp6") == 0) && (GetGlobal("vp7") == 0))  //can not win without taken Les Tourelles and Augustins
          {
	StandardVictoryConditions(60, 40, 60, 40, 1, IsMultiplayer());
          }	
     else
         {
           TryToCallScenarioFunction("SpecialScenarioVictoryConditions"); 
         }
	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.
}
But Why? I've checked the FUNCTION SpecialScenarioVictoryConditions(),there are no UniversalVars gotten from VictoryConditions().
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28273
Joined: Sun Dec 04, 2005 6:25 pm

Re: specialvictoryconditions() cannot work separately without StandardVictoryConditions()?

Post by rbodleyscott »

I am not enitrely sure, but it is designed to work that way.
Richard Bodley Scott

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

Re: specialvictoryconditions() cannot work separately without StandardVictoryConditions()?

Post by rbodleyscott »

I am not entirely sure, but it is designed to work that way. Best go with the flow.
Richard Bodley Scott

Image
Post Reply

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