Results 1 to 13 of 13
  1. #1
    Iron Guard
    Join Date
    Oct 2007
    Location
    Netherlands
    Posts
    673

    Default TUTORIAL: How to change the scoreboard

    Quote Originally Posted by Pfhoenix
    This may be asking much, but the community could really use even a single page walkthrough of modifying the scoreboards as you did with BattleMod. Good stuff, though, and we'll see how Epic fixes UI handling later on.
    I will try to do that.

    BattleMOD can be found here: http://www.onsrpg.com/ut3mods.php all source code is included a screenshot is there as well. One of the things it does is change the scoreboard to add PPH. I will try to make a step by step on how to do this with probably a few tiny mistakes.

    First it is necessary to understand how the PPH gets on the screen.
    - A player has a HUD
    - The HUD contains a UI Scene
    - The UI Scene refers to the scoreboard class
    - The scoreboard class puts the text on the screen

    So to get the PPH to the screen all those things have to be changed.

    STEP 1
    First you need to uncook UI_Scenes_Scoreboards.upk with the UT3 editor since this one contains the 5 (!) UI Scenes which need to be changed. Instructions on how to uncook can be found here: http://utforums.epicgames.com/showthread.php?t=585462

    STEP 2
    I copied the entire uncooked UI_Scenes_Scoreboards.upk and named it UI_Scenes_Scoreboards_BM.upk. Each UI Scene contains multiple panels. E.g. a VCTF UI Scene has a panel for RED and a panel for BLUE players. The panels refer to the scoreboard classes.

    STEP 3
    You need to create the custom scoreboard panels (e.g. BattleCTFScoreboardPanel as derived from UTCTFScoreboardPanel), compile them and publish them (unpublished doesn't work) BEFORE you start editing the UI_Scenes_Scoreboards_BM.upk. Otherwise you will refer to a non existing class which will make the UT3 Editor crash. You learn to save often very quickly. See my mod for the exact source code for the panels.

    STEP 4
    The simplest way to change the class the panel refers to is to copy the panel to the clipboard, paste in into notepad, replace the class, delete the original panel, copy the notepad version to the clipboard and paste it back into the UT3 Editor. It's a tad tricky to get the new panel to the exact same position the old one came from. I did this by copying the coordinates to the clipboard before I removed the old one and pasting them back for the new one. You will need to try this to completely understand. An example replacement is to replace UTCTFScoreboardPanel with BattleCTFScoreboardPanel (just like there are multiple UI Scenes there are also multiple scoreboard panels).

    STEP 5
    Now you need to make custom HUDs refering to the custom UI Scenes. Like BattleCTFHUD derived from UTCTFHUD containing a property like ScoreboardSceneTemplate=Scoreboard_CTF'UI_Scenes_S coreboards_BM.sbCTF' to make it refer to the new scoreboard. Just like you needed a bunch of scoreboard panels and a bunch of UI Scenes, you need a bunch of HUDs.

    STEP 6
    Now you need to get the game to actually use the HUD. In the ModifyPlayer of the mutator you call things like PC.ClientSetHUD (Class'BattleOnslaughtHUD', Worldinfo.Game.Scoreboardtype); to replace the HUD. Again you need to do this for all those different HUDs for all different gametypes. For details see the source code.

    You also need to call UTPC.LoadSettingsFromProfile (True); to make it all work properly, without that the HUD will do funny things. I am not entirely sure but I figure this properly initializes your brand new HUD. It was one of those try everything until it works things.

    STEP 7
    The funny thing is STEP 1 - STEP 6 only prepared for the real thing. Now you can start hacking nice things into your custom scoreboards (e.g. BattleCTFScoreboardPanel) to do things like adding PPH.

    WARNING: There is a bug in UT3 (which I reported and Epic promised to fix: http://utforums.epicgames.com/showthread.php?p=25126917) which prevents proper usage of a autodownloaded custom UI Scene.

  2. #2
    MSgt. Shooter Person
    Join Date
    Aug 2007
    Posts
    223

    Default

    +1




    (all i wanted to say, but it's not long enough)
    Played Since UT99 Demo
    I <3 UT3 EPIC
    Scripting/Mapping for 2 Years
    UT3 Name = XighaX (VerteX was stolen )

  3. #3
    MSgt. Shooter Person
    Join Date
    Oct 2007
    Posts
    64

    Default

    Thanks! If this had been around yesterday I wouldn't've have had to discover the same painful process myself .


    Quote Originally Posted by BattleMode View Post
    STEP 1
    First you need to uncook UI_Scenes_Scoreboards.upk with the UT3 editor since this one contains the 5 (!) UI Scenes which need to be changed. Instructions on how to uncook can be found here: http://utforums.epicgames.com/showthread.php?t=585462
    I do not believe you have to uncook a package before you can copy components from the UIScene of it. I can quite happily open a cooked UIScene, select a single component, and copy it. I've been doing this from the safe panel component, which pulls all the subcomponents with it.


    Quote Originally Posted by BattleMode View Post
    STEP 3
    You need to create the custom scoreboard panels (e.g. BattleCTFScoreboardPanel as derived from UTCTFScoreboardPanel), compile them and publish them (unpublished doesn't work) BEFORE you start editing the UI_Scenes_Scoreboards_BM.upk. Otherwise you will refer to a non existing class which will make the UT3 Editor crash. You learn to save often very quickly. See my mod for the exact source code for the panels.
    Are you using the UnrealFrontend to compile? If so, it doesn't pass the -useunpublished flag to "ut3 make" - I found that my code couldn't find the .upk package in unpublished for this reason, but when I added the command line flag in cmd.exe, it worked.

    I've also found that abusing the Test defaultproperty can have disasterous results - having changed the number of players to -1, UEd crashed. I've managed to crash it several other times as well, but I guess this is one of those instances where saving often is your saviour . It's also worth noting that you have to save the *package*, not the UIScene itself (which you can't do individually).

    Again, thanks for the tutorial, it's much appreciated!

  4. #4
    Iron Guard
    Join Date
    Oct 2007
    Location
    Netherlands
    Posts
    673

    Default

    Quote Originally Posted by Catalyst View Post
    Thanks! If this had been around yesterday I wouldn't've have had to discover the same painful process myself .
    You're welcome.

    Quote Originally Posted by Catalyst View Post
    I do not believe you have to uncook a package before you can copy components from the UIScene of it. I can quite happily open a cooked UIScene, select a single component, and copy it. I've been doing this from the safe panel component, which pulls all the subcomponents with it.
    I wanted (and needed) copies of the entire UI Scenes, not just of the panels inside the UI Scenes. So far I have not been able to find a way to transfer an entire UI Scene from one upk to another upk, so I decided to copy the entire upk instead (and therefore needed to uncook it). I have been able to export an entire UI Scene to some text file, but have not been able to find an import for entire UI Scenes, it's either not there or I have been looking in the wrong places.

  5. #5

  6. #6
    Redeemer
    Join Date
    Apr 2007
    Posts
    1,384

    Default

    STEP 1
    First you need to uncook UI_Scenes_Scoreboards.upk with the UT3 editor since this one contains the 5 (!) UI Scenes which need to be changed. Instructions on how to uncook can be found here: http://utforums.epicgames.com/showthread.php?t=585462
    Open with UE editor right? And where do I find UI_Scenes_Scoreboards.upk?
    You can discover more about a person in an hour of play than in a year of conversation.

  7. #7
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Location
    North of Boston, MA
    Posts
    109

    Default

    Quote Originally Posted by BattleMode View Post
    Is there some way to request a sticky for tutorials?
    I have no idea, but this thread definitely should be stickied.

  8. #8
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Location
    North of Boston, MA
    Posts
    109

    Default

    I don't know why they made it such a bear to create custom scoreboards.

    I think in most cases (mine included), a mod author just wants to subclass one of the stock UTScoreBoardPanels and draw custom scores onto the lower area of the existing UI_Scene. This is basically how it worked in all previous versions of UT.

    I think that it's crazy that they've created this system where you have to make a copy of a whole package just to change some text that's written on the screen. Not only is it a lot more work for the mod author but it creates an unnecessary download for users connecting to servers running the mods.

    Even if you look at the stock team gametypes, all of the UI_Scenes are freaking identical. In fact, most of the code in the corresponding UTScoreboardPanel classes is also identical!

    The right way to do this would have been to provide a way to just derive a new class from the UTScoreboardPanel associated with the ScoreboardSceneTemplate that you select.

  9. #9
    Iron Guard
    Join Date
    Oct 2007
    Location
    Netherlands
    Posts
    673

    Default

    Quote Originally Posted by agentq_71 View Post
    I don't know why they made it such a bear to create custom scoreboards.
    I couldn't agree more. The biggest problem is not just how hard it is to change the scoreboard, but that you can not have multiple mutators running together which do that.

    There should indeed be some chain of classes allowing you to add some simple text to the scoreboard. Preferably something that works with all 4 different ways it has to show information (took me some time to figure out how to show RPG levels no matter what mode the scoreboard was in, needed 15 methods to achieve it).

  10. #10
    MSgt. Shooter Person
    Join Date
    Jul 2006
    Posts
    59

    Default

    As an update to this article, you do NOT need to replace the hud in order to change the scoreboardclass.

    You can simply create an intance of your scoreboard scoreboard and change the reference at runtime.

    Here is example code where I replaced the tdm scoreboard:

    Code:
    if(PC.myHud.class == class'UTTeamHud')
     {
                  UTHud(PC.myHud).ScoreBoardSceneTemplate = UTUIScene_Scoreboard(DynamicLoadObject("MyScoreboardPackage.MyScoreboardClass", class'UTUIScene_ScoreBoard'));
    }
    Where PC is the local playercontroller.

  11. #11
    MSgt. Shooter Person
    Join Date
    Aug 2006
    Location
    I came from earth
    Posts
    347

    Default

    hmm, i have been playing your mutator a lot on instant action and i didnt see the scoreboard change nor the mana indicator, i though i was broken, but the character gain more life with the levels

    later i put a multipleyer lan with bots and a saw everithing,

    are you working to make this mod usable in instant action?

  12. #12
    Iron Guard
    Join Date
    Oct 2007
    Location
    Netherlands
    Posts
    673

    Default

    Quote Originally Posted by r1esG0 View Post
    hmm, i have been playing your mutator a lot on instant action and i didnt see the scoreboard change nor the mana indicator, i though i was broken, but the character gain more life with the levels

    later i put a multipleyer lan with bots and a saw everithing,

    are you working to make this mod usable in instant action?
    It sounds like you are using BattleRPG P1, which does not support instant action. BattleRPG P2 supports instant action. You can find it at: http://www.onsrpg.com/ut3mods.php

  13. #13
    Iron Guard
    Join Date
    Mar 2008
    Location
    Poland
    Posts
    626

    Default

    Hey, a bit offtopic maybe but it's hard to find an answer anywhere.
    Maybe you know something about this.
    I got multiple uiscene/huds (some are simple text an others are actual huds)
    the problem is, when the texts show up, the hud is getting half-transparent,and when the text dissapear its going back to normal...

    I hope somebody knows how to fix that, i'd be a verry happy man
    *sorry for my poor english if i'm not clear enough


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.