New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Game Interface / AC Callbacks + support for T5ZM, T6MP and T6ZM for the Game Interface. #288
Conversation
Same issue on IW4, IW5 and T5 game modules.
* Fix deploy.bat * Change paths inside the gsc scripts used to call functions in other scripts * Remove mp includes from base gsc file. #include maps\mp\_utility; #include maps\mp\gametypes\_hud_util; * Define GetXuid as overrideMethod as t5zm doesn't have it. * Define GetPlayerFromClientNum as getting all players is slightly different on t5zm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should removed the compiled T6 plugin. There should not be a reason to encourage loading scripts that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should removed the compiled T6 plugin. There should not be a reason t encourage loading scripts that way.
@@ -199,6 +199,11 @@ Log2Console( logLevel, message ) | |||
PrintConsole( "[" + logLevel + "] " + message + "\n" ); | |||
} | |||
|
|||
_GetXUID() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No this is wrong. See how ISTestClient
function is called in the same file.
You need to use the call
keyword.
@@ -109,6 +109,11 @@ Log2Console( logLevel, message ) | |||
Print( "[" + logLevel + "] " + message + "\n" ); | |||
} | |||
|
|||
_GetXUID() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as iw4 engine
|
||
self IPrintLnBold( "NoClip enabled" );*/ | ||
|
||
scripts\_integration_base::LogWarning( "NoClip is not supported on T6!" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noclip should be a built-in on t6 iirc
level waittill( "connected", player ); | ||
|
||
if ( scripts\_integration_base::_IsBot( player ) ) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use istestclient as it is a built-in
level waittill( "connected", player ); | ||
|
||
if ( scripts\_integration_base::_IsBot( player ) ) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
@@ -129,6 +129,11 @@ God() | |||
} | |||
} | |||
|
|||
_GetXUID() | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the 3arc engine you do not need the call keyword to call a built-in by reference but it should be attempted anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of my comments can be discarded.
At the end because of the 3arc engine the call keyword can't be used so it forces us to use wrapper function.
I confirmed noclip is not supported on t5/t6 yet.
but I could be added to iw5 if it's not already done.
@@ -22,6 +20,8 @@ Setup() | |||
level.commonFunctions = spawnstruct(); | |||
level.commonFunctions.setDvar = "SetDvarIfUninitialized"; | |||
level.commonFunctions.isBot = "IsBot"; | |||
level.commonFunctions.getXuid = "GetXuid"; | |||
level.commonFunctions.GetPlayerFromClientNum = "GetPlayerFromClientNum"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: use camelCase for functionName
level.commonFunctions.getPlayerFromClientNum
guid = self GetXuid(); | ||
guid = self [[level.overrideMethods[level.commonFunctions.getXuid]]](); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So after thinking about this, I think we should move the GenerateJoinTeamString
into the _integration_shared.gsc
I added this in here before I created the shared functionality file.
Philosophically the _integration_base,gsc should really only be responsible for facilitating the game interface data transfer/notifications. No direct game interaction or action on game events.
That should put the above registration of the overrideMethods more in line with what's already done in the shared gsc
What's the reason for defining an entirely new set of methods for T5ZM? Could we not check a dvar to see if it's zm vs mp and then register the GetXuid and GetPlayerFromClientNum respectively? Edit: Actually I just realized it might complain about referencing the method even if you aren't calling it.. Which if so is annoying. |
use camelCase for functionName
Base -> shared -> game Otherwise we might write to structs before they are created.
GetPlayerFromClientNum OnPlayerJoinedTeam OnPlayerJoinedSpectators GenerateJoinTeamString PlayerTrackingOnInterval SaveTrackingMetrics
Block _shared execution until the game specific file finished. This allows the game specific file to override the events in _shared.
Move check of sv_iw4madmin_integration_enabled dvar after waittill in _shared so _base has a chance to set it to 1. Move check of sv_iw4madmin_autobalance dvar to OnPlayerConnect in _shared so the game specific script has a chance to set the dvar.
@@ -23,6 +23,8 @@ Setup() | |||
|
|||
RegisterClientCommands(); | |||
|
|||
_SetDvarIfUninitialized("sv_iw4madmin_autobalance",0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor complaint here but could you leave a space after the comma and also space out the parameters like in the rest of the file?
Your guess regarding t5zm is dead on, unlike on t6 it will complain about any and all mp scripts. |
001e322
to
976e6e4
Compare
Fixes the following:
On IW4, IW5 and T5 it was possible that
level.eventBus.gamename
was being set beforelevel.eventBus
was initialized as both happened through the init method in 2 different gsc files.Paths in
_integration_shared.gsc
pointing to_integration_base.gsc
did not account for the different paths caused by deploy.bat moving the files to mp only folders for IW5 and T5.T6's _customcallbacks.gsc did not compile with the new compiler.
Adds the following:
_integration_base
.GetXuid
asoverrideMethod
as T5ZM doesn't have it.GetPlayerFromClientNum
asoverrideMethod
since getting all players is slightly different on T5ZM._integration_t6zm_helper.gsc
to support the same hud messages as MP._integration_t6.gsc
Other changes:
_customcallbacks.gsc
for T6 as it can now load uncompiled GSC and the compiler used by Pluto is much better than the old one.