OmniONSScoring

Discuss and provide feedback on Maps.
User avatar
captainsnarf
Posts: 2713
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

OmniONSScoring

Post by captainsnarf »

I made a few small changes, hoping to fix the unreg issue. Changes pushed to the github.


1. I updated the replacement so it only replaces MainCoreDestroyed for real powercores, not all the powernodes too.
2. Uncommented the code at the bottom which calls RoundEnded() for the controller. This is needed for the server and client round end states to match. Previously it was only getting set on client.

This is on the server. I backed up the old version in case it doesn't work.
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: OmniONSScoring

Post by pooty »

I rebuilt it, added 1.1 to build number.

Peeps are on so I can't install, have to turn off server, I'll get to it tomorrow
User avatar
captainsnarf
Posts: 2713
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: OmniONSScoring

Post by captainsnarf »

So there is some weirdness after the round ends, but at least the unregs issue is fixed.

I added this check, make sure 'other' is not a node, only a core

Code: Select all

PC = ONSPowerCore(Other)
if (PC!=None && ONSPowerNode(Other) == None && bCustomScoring)
        PC.OnCoreDestroyed = MainCoreDestroyedOmniScoring;
and uncommented this

Code: Select all

     if (!ONSGame.bGameEnded) 
           C.RoundHasEnded();
I think there is something up/wrong with the ONSPlus code that was copied over. Most is in UTComp_ONSGameRules. It sets the OnCoreDestroyed function for nodes (to give node isolation bonus), so I think there was a conflict above since it would have got overwritten in the original version.

C.RoundHasEnded() is a server function, while PC.ClientRoundEnded() is a client function. They both end up doing the same thing, GotoState('RoundEnded').

Either way, I'll take the after round stuff over unregs any day.
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: OmniONSScoring

Post by pooty »

Strange that function would affect shots/unregs? So it does create its own OnCoreDestoryed.... only thing that should have broke was node isolation bonus... but oh well.
C.RoundHasEnded() is a server function, while PC.ClientRoundEnded() is a client function. They both end up doing the same thing, GotoState('RoundEnded').
UTComp needs this? Its not in the original code. Its likely forcing/skipping PC.ClientRoundEnded() for some causing the issues.
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: OmniONSScoring

Post by pooty »

Code: Select all

    //round has ended
    for (C = Level.ControllerList; C != None; C = C.NextController)
    {
        PC = PlayerController(C);
        if (PC != None)
        {
            PC.ClientSetBehindView(true);
            PC.ClientSetViewTarget(ONSGame.PowerCores[ONSGame.FinalCore[T]]);
            PC.SetViewTarget(ONSGame.PowerCores[ONSGame.FinalCore[T]]);
            if (!ONSGame.bGameEnded) 
            {
                 PC.ClientRoundEnded();
                 if (bDebug) log("PC.ClientRoundEnded called for "$PC.PlayerReplicationInfo.PlayerName,'OmniONSScoring');
            } 
            else 
            { 
                // match/game ended
            	PC.ClientGameEnded();
            	if (bDebug) log("PC.ClientGameEnded called for "$PC.PlayerReplicationInfo.PlayerName,'OmniONSScoring');
            }    
        }

       // this does fix UTComp End game drama, but its a bandaid
       // this is needed to set controller to correct state on server 
       if (!ONSGame.bGameEnded) 
       {
           if (bDebug) log("C.RoundHasEnded called",'OmniONSScoring');
           C.RoundHasEnded();
       }    
    }
This block should be outside the for loop.

Code: Select all

 // this does fix UTComp End game drama, but its a bandaid
       // this is needed to set controller to correct state on server 
       if (!ONSGame.bGameEnded) 
       {
           if (bDebug) log("C.RoundHasEnded called",'OmniONSScoring');
           C.RoundHasEnded();
       }    
I'll change it and test it out.
User avatar
captainsnarf
Posts: 2713
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: OmniONSScoring

Post by captainsnarf »

Hmm, that needs to be in the for loop. That is where 'C' variable comes from. Each controller should call RoundHasEnded().
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: OmniONSScoring

Post by pooty »

Each controller should call RoundHasEnded().
Ah I see. That like that originally, my bad.

So something in UTComp isn't getting set at end of round. Is there another call there we need to add?
User avatar
captainsnarf
Posts: 2713
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: OmniONSScoring

Post by captainsnarf »

That's why I pushed the 1.55 version.

Code: Select all

class Controller;

function RoundHasEnded()
{
   GotoState('RoundEnded')
}
We had an override for that state in UTComp that came from ONSPlus. I removed it, so it uses the default code now.
User avatar
pooty
Posts: 4535
Joined: Sat Apr 03, 2021 10:22 am
Location: Michigan
Server Sponsor: Yes
Server Admin: Yes

Re: OmniONSScoring

Post by pooty »

Cool.. we will see today if there's any more end round shenanigans...
https://www.youtube.com/watch?v=JNPW2wZ4D2s
User avatar
captainsnarf
Posts: 2713
Joined: Tue Jul 06, 2021 1:51 pm
Location: Washington
Server Sponsor: Yes
Server Admin: Yes
Contact:

Re: OmniONSScoring

Post by captainsnarf »

It seems like it's fixed now? I didn't play enough to know for sure

Image
Post Reply