Skip to content
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

Merged
merged 12 commits into from May 29, 2023

Conversation

xerxes-at
Copy link
Contributor

Fixes the following:

  • On IW4, IW5 and T5 it was possible that level.eventBus.gamename was being set before level.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:

  • Support for T5ZM
    • Remove mp includes from _integration_base.
    • Define GetXuid as overrideMethod as T5ZM doesn't have it.
    • Define GetPlayerFromClientNum as overrideMethod since getting all players is slightly different on T5ZM.
  • Support for T6 (MP and ZM)
    • Add _integration_t6zm_helper.gsc to support the same hud messages as MP.
    • Add _integration_t6.gsc

Other changes:

  • Remove precompiled _customcallbacks.gsc for T6 as it can now load uncompiled GSC and the compiler used by Pluto is much better than the old one.
  • Changes to deploy.bat to support the other changes.

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.
Copy link
Collaborator

@diamante0018 diamante0018 left a 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.

Copy link
Collaborator

@diamante0018 diamante0018 left a 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()
Copy link
Collaborator

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()
Copy link
Collaborator

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!" );
Copy link
Collaborator

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 ) )
{
Copy link
Collaborator

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 ) )
{
Copy link
Collaborator

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()
{
Copy link
Collaborator

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

Copy link
Collaborator

@diamante0018 diamante0018 left a 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";
Copy link
Owner

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

Comment on lines 363 to 364
guid = self GetXuid();
guid = self [[level.overrideMethods[level.commonFunctions.getXuid]]]();
Copy link
Owner

@RaidMax RaidMax Apr 10, 2023

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

@RaidMax
Copy link
Owner

RaidMax commented Apr 10, 2023

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);
Copy link
Collaborator

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?

@xerxes-at
Copy link
Contributor Author

Your guess regarding t5zm is dead on, unlike on t6 it will complain about any and all mp scripts.

@RaidMax RaidMax changed the base branch from release/pre to develop May 7, 2023 14:28
@RaidMax RaidMax force-pushed the develop branch 2 times, most recently from 001e322 to 976e6e4 Compare May 27, 2023 02:21
@RaidMax RaidMax merged commit d0e39b2 into RaidMax:develop May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants