UE1 - UT How do I Replace a Scoreboard using a mutator?

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

FireFox-

New Member
Nov 2, 2005
16
0
0
Hi Everyone, Is there a way to replace a scoreboard using a mutator? Thanks in Advance for help :) Best Regards FireFox
 
Last edited:

FireFox-

New Member
Nov 2, 2005
16
0
0
No one has a clue or something to point me at? Thanks in advance for the help Best Reguards FireFox
 

FireFox-

New Member
Nov 2, 2005
16
0
0
Hi Wormbo sorry didn't see your post (i think we were posting at the same time) do you have any suggestion? Thanks in Advance
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Ok, here's a general guide for finding potential solutions to this type of problem:
  1. The answer to a "Can I?" question is "Yes." most of the time.
  2. You're looking for scoreboard-related information, so start with an UnCodeX full-text search for "Scoreboard" in all of UT's code.
  3. That search will tell you that GameInfo defines a variable "ScoreboardType", which is set to the game-specific scoreboards in subclasses.
  4. With that info, you can do another full-text search for "ScoreboardType" to filter out any unrelated results.
  5. Look where that variable is used (Should be only the declaration, some defprops and a few other places.) and trace how its value is used to create the scoreboard. (That's just to make sure it's a good place to do changes.)
  6. Modify the variable (or whatever other good place you found during your research) to use your own scoreboard type.
 

FireFox-

New Member
Nov 2, 2005
16
0
0
Hi Wormbo, this is the first place where i'm looking before posting on forum since it is my main reference to study how ut is coded in UnrealScript,and during the studies I arrived to the ScoreboardType variable which is set in the defaultproperties of the various GameTypes (e.g. DeathMatchPlus one of them),but something else caught my attention since i found something in PlayerPawn too: var ScoreBoard Scoring; and var classScoringType; and of course the ScoreboardType variable which resides in GameInfo now the point is how do i access it when i have to write a mutator? Thanks in Advance for Help Best Regards FireFox btw: i have a problem with my browser which seems to not like when i do press Enter to do a Carriage Return Line Feed how do i get to a new line without seeing the post as it has been written only on a line?
 
Last edited:

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
You'll preferably want to set the most central property you have access to or the one that involves the least amount of work to set it at the right time. As far as I can tell both options are really the ScoreboardType in GameInfo, as that value is assigned to the players and from there replicated to clients, where the scoreboard is eventually created.

The current GameInfo is always (at least offline and on the server, which is where your mutator also exists) accessible via the LevelInfo's Game property. And conveniently, all actors have a reference to the current LevelInfo object via their Level property. Access the GameInfo through that from a startup event of your mutator.
 

FireFox-

New Member
Nov 2, 2005
16
0
0
Hi Wormbo thanks for the hint :)
I did a little mutator to test this case separately from the project
and i came with this temporary solution:
Code:
class MyTestReplacer extends Mutator;

event PreBeginPlay()
{
    Level.Game.ScoreBoardType=class'MyTestReplacer.MyScoreBoard';
    PlayerPawn(Owner).ScoringType=Level.Game.ScoreBoardType;
}
What do you think about this possible solution?
Thanks in Advance for Help :)

Best Regards FireFox
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Players do not yet exist when the mutator's startup events are called. As a consequence, a mutator is not owned by any player. But you shouldn't need any access to players anyway, the PlayerPawn's PostBeginPlay() event will copy the game's ScoreboardType to its ScoringType property as soon as the new player is created.
 

FireFox-

New Member
Nov 2, 2005
16
0
0
Hi Wormbo,
yes you're right :), this is why i mentioned temporary solution,
due to later modification of the function being used from PreBeginPlay() to PostBeginPlay() :).
so you agree that this is the right way to do it
except for the function that should be modified from PreBeginPlay()
to PostBeginPlay(),am I right?
Thanks for the help and the replies wormbo :)
Best Regards FireFox
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
No, Pre/PostBeginPlay() in your mutator doesn't matter. I meant the place in another other class (PlayerPawn), where that happens.
Your code is actually slightly incorrect, because Owner will always be None. It'll work anyway because UnrealScript execution logs a warning and ignores the invalid operation instead of crashing or throwing exceptions.
 

FireFox-

New Member
Nov 2, 2005
16
0
0
Hi Wormbo,
in your opinion how do I replace the "Owner"parameter?
I mean with what?

Thanks in advance for the help
Best Regards FireFox
 
Last edited:

DannyMeister

UT3 Jailbreak Coder
Dec 11, 2002
1,275
1
38
40
Bolivar, Missouri
Players do not yet exist when the mutator's startup events are called. As a consequence, a mutator is not owned by any player. But you shouldn't need any access to players anyway, the PlayerPawn's PostBeginPlay() event will copy the game's ScoreboardType to its ScoringType property as soon as the new player is created.

Firefox-, what you should have gathered from this quote from Wormbo is basically:

"Everything is good as you wrote it, except that you should delete the second line of code in PreBeginPlay() because it is not needed!"
 

FireFox-

New Member
Nov 2, 2005
16
0
0
Hi Wormbo Hi Danny,
thanks for the clarification :)
sorry for not posting for so long but it wasn't intentional,
I had problems with my pc.
After a sleep I came to the solution too just after reasoning :)
and realized that the second line is in fact not needed
since it will be handled somewhere else in the game code :).

I just inserted that second line for testing purpose just to be sure
that the value of Level.Game.ScoreboardType would have been
taken and processed.

As for the Owner well...i thought it was the wrong parameter
because you told me that the code was slightly incorrect
so I thought i'd replace it with something else.

Sorry for misunderstanding :)

I consider this topic solved :)

Thanks for the help :)

if you don't mind i will put the final version of the code :)
it may help others in future :)

Best Regards FireFox :)