-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds utility function and method to be able to enact a load of subsce…
…nes at a specific world position Adds loadIf conditional logic to evaluate if a subscene is 'allowed' to load when tested Adds isAlwaysActive to GameMode to be able to flag a gamemode as being defaulted to on and used automatically Updated GetGameModesList function to return an arrayObject of the gamemodes found Overhauled CallGameModeFunction to utilize the gamemodes list with active/alwaysActive modes being called against, rather than level-scanning Updated ChooseLevelMenu to be able to toggle on/off multiple gamemodes with an image indicator if it's active or not
- Loading branch information
Showing
14 changed files
with
258 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 14 additions & 44 deletions
58
Templates/BaseGame/game/core/utility/scripts/scene.tscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,22 @@ | ||
function callGamemodeFunction(%gameModeFuncName, %arg0, %arg1, %arg2, %arg3, %arg4, %arg5, %arg6) | ||
{ | ||
%activeSceneCount = getSceneCount(); | ||
%hasGameMode = 0; | ||
for(%i=0; %i < %activeSceneCount; %i++) | ||
%validGameModeCall = false; | ||
%gamemodeList = getGameModesList(); | ||
%gameModeCount = %gamemodeList.count(); | ||
for(%i=0; %i < %gameModeCount; %i++) | ||
{ | ||
%gamemodeName = getScene(%i).gameModeName; | ||
if(%gamemodeName !$= "") | ||
%gameModeObj = %gamemodeList.getKey(%i); | ||
%active = %gamemodeList.getValue(%i); | ||
|
||
if(!isObject(%gameModeObj) || !%active) | ||
continue; | ||
|
||
if(%gameModeObj.isMethod(%gameModeFuncName)) | ||
{ | ||
//if the scene defines a game mode, go ahead and envoke it here | ||
if(isObject(%gamemodeName) && %gamemodeName.isMethod(%gameModeFuncName)) | ||
{ | ||
eval(%gamemodeName @ "."@%gameModeFuncName@"(\""@%arg0@"\", \""@%arg1@"\", \""@%arg2@"\", \""@%arg3@"\", \""@%arg4@"\", \""@%arg5@"\", \""@%arg6@"\");" ); | ||
%hasGameMode = 1; | ||
} | ||
else | ||
{ | ||
//if we don't have an object, attempt the static call | ||
if(isMethod(%gamemodeName, %gameModeFuncName)) | ||
{ | ||
eval(%gamemodeName @ "::"@%gameModeFuncName@"(\""@%arg0@"\", \""@%arg1@"\", \""@%arg2@"\", \""@%arg3@"\", \""@%arg4@"\", \""@%arg5@"\", \""@%arg6@"\");" ); | ||
%hasGameMode = 1; | ||
} | ||
} | ||
eval(%gameModeObj @ "."@%gameModeFuncName@"(\""@%arg0@"\", \""@%arg1@"\", \""@%arg2@"\", \""@%arg3@"\", \""@%arg4@"\", \""@%arg5@"\", \""@%arg6@"\");" ); | ||
%validGameModeCall = true; | ||
} | ||
} | ||
|
||
//if none of our scenes have gamemodes, we need to kick off a default | ||
if(%hasGameMode == 0) | ||
{ | ||
%defaultModeName = ProjectSettings.value("Gameplay/GameModes/defaultModeName"); | ||
if(%defaultModeName !$= "") | ||
{ | ||
if(isObject(%defaultModeName) && %defaultModeName.isMethod(%gameModeFuncName)) | ||
{ | ||
eval(%defaultModeName @ "."@%gameModeFuncName@"(\""@%arg0@"\", \""@%arg1@"\", \""@%arg2@"\", \""@%arg3@"\", \""@%arg4@"\", \""@%arg5@"\", \""@%arg6@"\");" ); | ||
%hasGameMode = 1; | ||
} | ||
else | ||
{ | ||
if(isMethod(%defaultModeName, %gameModeFuncName)) | ||
{ | ||
eval(%defaultModeName @ "::"@%gameModeFuncName@"(\""@%arg0@"\", \""@%arg1@"\", \""@%arg2@"\", \""@%arg3@"\", \""@%arg4@"\", \""@%arg5@"\", \""@%arg6@"\");" ); | ||
%hasGameMode = 1; | ||
} | ||
} | ||
} | ||
} | ||
|
||
return %hasGameMode; | ||
return %validGameModeCall; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.