Fred1988 18 Posted August 6, 2023 Is there any simple trigger script that can end a scenario with a faction victory? I've used this code to end previous scenarios SCR_BaseGameMode gameMode = SCR_BaseGameMode.Cast(GetGame().GetGameMode()); Faction faction = GetGame().GetFactionManager().GetFactionByKey("US"); int usIndex = GetGame().GetFactionManager().GetFactionIndex(faction); gameMode.EndGameMode(SCR_GameModeEndData.CreateSimple(SCR_GameModeEndData.ENDREASON_EDITOR_FACTION_VICTORY, -1, usIndex)); But now the workbench refuses to work with it Share this post Link to post Share on other sites
[evo] dan 79 Posted August 10, 2023 On 8/6/2023 at 8:03 PM, Fred1988 said: Is there any simple trigger script that can end a scenario with a faction victory? I've used this code to end previous scenarios SCR_BaseGameMode gameMode = SCR_BaseGameMode.Cast(GetGame().GetGameMode()); Faction faction = GetGame().GetFactionManager().GetFactionByKey("US"); int usIndex = GetGame().GetFactionManager().GetFactionIndex(faction); gameMode.EndGameMode(SCR_GameModeEndData.CreateSimple(SCR_GameModeEndData.ENDREASON_EDITOR_FACTION_VICTORY, -1, usIndex)); But now the workbench refuses to work with it I had a quick look at this as I was looking at how to do it. On the last line, you cannot use the SCR_GameModeEndData, it has been moved into an enum - see my below code for something that works. SCR_BaseGameMode gameMode = SCR_BaseGameMode.Cast(GetGame().GetGameMode()); Faction faction = GetGame().GetFactionManager().GetFactionByKey("US"); int usIndex = GetGame().GetFactionManager().GetFactionIndex(faction); gameMode.EndGameMode(SCR_GameModeEndData.CreateSimple(EGameOverTypes.COMBATPATROL_VICTORY, -1, usIndex)); Once you type in the EGameOverTypes and then press the "." key, you'll see a list of the available types - I picked COMBATPATROL_VICTORY. I hope this helps you out. 1 Share this post Link to post Share on other sites
Fred1988 18 Posted August 14, 2023 On 8/10/2023 at 8:56 PM, [evo] dan said: I had a quick look at this as I was looking at how to do it. On the last line, you cannot use the SCR_GameModeEndData, it has been moved into an enum - see my below code for something that works. SCR_BaseGameMode gameMode = SCR_BaseGameMode.Cast(GetGame().GetGameMode()); Faction faction = GetGame().GetFactionManager().GetFactionByKey("US"); int usIndex = GetGame().GetFactionManager().GetFactionIndex(faction); gameMode.EndGameMode(SCR_GameModeEndData.CreateSimple(EGameOverTypes.COMBATPATROL_VICTORY, -1, usIndex)); Once you type in the EGameOverTypes and then press the "." key, you'll see a list of the available types - I picked COMBATPATROL_VICTORY. I hope this helps you out. Thanks! Will test it out now! Share this post Link to post Share on other sites
Fred1988 18 Posted August 14, 2023 On 8/10/2023 at 8:56 PM, [evo] dan said: I had a quick look at this as I was looking at how to do it. On the last line, you cannot use the SCR_GameModeEndData, it has been moved into an enum - see my below code for something that works. SCR_BaseGameMode gameMode = SCR_BaseGameMode.Cast(GetGame().GetGameMode()); Faction faction = GetGame().GetFactionManager().GetFactionByKey("US"); int usIndex = GetGame().GetFactionManager().GetFactionIndex(faction); gameMode.EndGameMode(SCR_GameModeEndData.CreateSimple(EGameOverTypes.COMBATPATROL_VICTORY, -1, usIndex)); Once you type in the EGameOverTypes and then press the "." key, you'll see a list of the available types - I picked COMBATPATROL_VICTORY. I hope this helps you out. Worked perfectly! And thanks for the tip on looking up the different endgame types, thanks to this i've been able to reupload my Counter Strike Reforged mod with a proper deathmatch mode! 1 Share this post Link to post Share on other sites