From 94b6749012ab8349eb845d8c12b95eb058906ea7 Mon Sep 17 00:00:00 2001 From: Areloch Date: Fri, 4 Oct 2019 21:00:58 -0500 Subject: [PATCH] Catches FPSGameplay module up to new gamemode and module paradigm Adds additional args for callGamemodeFunction Adds default Observer camera datablock --- .../core/gameObjects/datablocks/defaultDatablocks.cs | 5 +++++ Templates/BaseGame/game/core/utility/scripts/scene.cs | 10 +++++----- .../ExampleModule/scripts/ExampleGamemodeScript.cs | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs b/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs index b04a2c795..5d9f245aa 100644 --- a/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs +++ b/Templates/BaseGame/game/core/gameObjects/datablocks/defaultDatablocks.cs @@ -141,3 +141,8 @@ datablock MissionMarkerData(CameraBookmarkMarker) category = "Misc"; shapeFile = "core/gameObjects/shapes/camera.dts"; }; + +datablock CameraData(Observer) +{ + mode = "Observer"; +}; diff --git a/Templates/BaseGame/game/core/utility/scripts/scene.cs b/Templates/BaseGame/game/core/utility/scripts/scene.cs index 67fc35ad0..795d541f3 100644 --- a/Templates/BaseGame/game/core/utility/scripts/scene.cs +++ b/Templates/BaseGame/game/core/utility/scripts/scene.cs @@ -1,4 +1,4 @@ -function callGamemodeFunction(%gameModeFuncName, %data) +function callGamemodeFunction(%gameModeFuncName, %arg0, %arg1, %arg2, %arg3, %arg4, %arg5, %arg6) { if(%data !$= "") %data = "\""@%data@"\""; @@ -14,7 +14,7 @@ function callGamemodeFunction(%gameModeFuncName, %data) //if the scene defines a game mode, go ahead and envoke it here if(isObject(%gamemodeName) && %gamemodeName.isMethod(%gameModeFuncName)) { - eval(%gamemodeName @ "."@%gameModeFuncName@"("@%data@");" ); + eval(%gamemodeName @ "."@%gameModeFuncName@"(\""@%arg0@"\", \""@%arg1@"\", \""@%arg2@"\", \""@%arg3@"\", \""@%arg4@"\", \""@%arg5@"\", \""@%arg6@"\");" ); %hasGameMode = 1; } else @@ -22,7 +22,7 @@ function callGamemodeFunction(%gameModeFuncName, %data) //if we don't have an object, attempt the static call if(isMethod(%gamemodeName, %gameModeFuncName)) { - eval(%gamemodeName @ "::"@%gameModeFuncName@"("@%data@");" ); + eval(%gamemodeName @ "::"@%gameModeFuncName@"(\""@%arg0@"\", \""@%arg1@"\", \""@%arg2@"\", \""@%arg3@"\", \""@%arg4@"\", \""@%arg5@"\", \""@%arg6@"\");" ); %hasGameMode = 1; } } @@ -37,14 +37,14 @@ function callGamemodeFunction(%gameModeFuncName, %data) { if(isObject(%defaultModeName) && %defaultModeName.isMethod(%gameModeFuncName)) { - eval(%defaultModeName @ "."@%gameModeFuncName@"("@%data@");" ); + eval(%defaultModeName @ "."@%gameModeFuncName@"(\""@%arg0@"\", \""@%arg1@"\", \""@%arg2@"\", \""@%arg3@"\", \""@%arg4@"\", \""@%arg5@"\", \""@%arg6@"\");" ); %hasGameMode = 1; } else { if(isMethod(%defaultModeName, %gameModeFuncName)) { - eval(%defaultModeName @ "::"@%gameModeFuncName@"("@%data@");" ); + eval(%defaultModeName @ "::"@%gameModeFuncName@"(\""@%arg0@"\", \""@%arg1@"\", \""@%arg2@"\", \""@%arg3@"\", \""@%arg4@"\", \""@%arg5@"\", \""@%arg6@"\");" ); %hasGameMode = 1; } } diff --git a/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.cs b/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.cs index fc046e020..d24a5b715 100644 --- a/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.cs +++ b/Templates/BaseGame/game/data/ExampleModule/scripts/ExampleGamemodeScript.cs @@ -150,7 +150,7 @@ function ExampleGameMode::onClientLeaveGame(%this, %client) //This is called when the player has connected and finaly setup is done and control is handed //over to the client. It allows a point to special-case setting the client's canvas content //(Such as a gamemode-specific GUI) or setting up gamemode-specific keybinds/control schemes -function ExampleGameMode::onInitialControlSet() +function ExampleGameMode::onInitialControlSet(%this) { } \ No newline at end of file