Page 1 of 1

specialvictoryconditions() cannot work separately without StandardVictoryConditions()?

Posted: Mon Feb 13, 2023 8:56 am
by locustmustdie
Modded VictoryConditions(),adding an if(blahblah) outside StandardVictoryCondition(),then specialvictorycondition() ceased to function. Typed the modded part out,SpecialVic works fine again.

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

Posted: Mon Feb 13, 2023 12:17 pm
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().

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

Posted: Tue Feb 14, 2023 7:20 am
by rbodleyscott
I am not enitrely sure, but it is designed to work that way.

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

Posted: Tue Feb 14, 2023 7:20 am
by rbodleyscott
I am not entirely sure, but it is designed to work that way. Best go with the flow.