specialvictoryconditions() cannot work separately without StandardVictoryConditions()?
Moderator: rbodleyscott
-
- Senior Corporal - Destroyer
- Posts: 117
- Joined: Fri Mar 05, 2021 11:33 am
specialvictoryconditions() cannot work separately without StandardVictoryConditions()?
Modded VictoryConditions(),adding an if(blahblah) outside StandardVictoryCondition(),then specialvictorycondition() ceased to function. Typed the modded part out,SpecialVic works fine again.
-
- Senior Corporal - Destroyer
- Posts: 117
- Joined: Fri Mar 05, 2021 11:33 am
Re: specialvictoryconditions() cannot work separately without StandardVictoryConditions()?
I see
SpecialScenarioVictoryConditions will not be executed unless called by FUNCTION VictoryConditions()
Add an else segment to fix it
But Why? I've checked the FUNCTION SpecialScenarioVictoryConditions(),there are no UniversalVars gotten from VictoryConditions().
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)
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.
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.
}
-
- Field of Glory 2
- Posts: 28273
- Joined: Sun Dec 04, 2005 6:25 pm
Re: specialvictoryconditions() cannot work separately without StandardVictoryConditions()?
I am not enitrely sure, but it is designed to work that way.
Richard Bodley Scott


-
- Field of Glory 2
- Posts: 28273
- Joined: Sun Dec 04, 2005 6:25 pm
Re: specialvictoryconditions() cannot work separately without StandardVictoryConditions()?
I am not entirely sure, but it is designed to work that way. Best go with the flow.
Richard Bodley Scott

