Home | Forum | Downloads | Videos | Artikel | Server-Stats | Impressum

Zurück   UTzone.de > UT > UnrealEd & Mapping

UnrealEd & Mapping Auf Unrealed.info findet Ihr noch mehr Info´s übers Mappen

Antwort
 
Teilen Themen-Optionen Thema durchsuchen
Alt 10.06.2013, 18:47   #1
Dec|$h0cKw@V€|
Gast
 
Beiträge: n/a
Beigetretene Cups:
Cup Siege:
Downloads:
Uploads:
Unglücklich Scrolling Banner Bombing Run

Hallo Leute,

ich hab ein kleines Problem

Ich habe eine BombingRun Map erstellt und bin gerade bei den Feineinstellungen. Da ich ein Fußballverrückter bin, wollte ich wie in vielen Fußballstadien ein Scoreanzeige einbauen.
Da das ja so nicht möglich ist, muss ich wohl einen Scrolling Text nehmen, sowie in DM-Morpheus3, nur mit Teams statt Player.

Ich hab ein englisches Tutorial gefunden und herausgefunden, dass das auch funktioniert, aber ich muss laut dem Tutorial das Script editieren und habe keine Ahnung davon. Folgend kommt das Script:
+/- Klappen
Zitat:
Writing the BasicScrollingCTFMessage class

For the CTF message we need to use the team info rather than the players, so we need to get the information from the Teams[] array in TournamentGameReplicationInfo instead. Also, a message will be needed for when the teams scores are tied.

The scrolling message will need 2 macros, one for the leading teams name, and one for the leading teams score. These will be %t for the team name and %s for the teams score. Having the score displayed when the teams are tied will also be useful, but the %s macro can be used for this too as it doesn't matter which teams score is used when the teams are tied.

Here's the complete code for the class:


Code:
class BasicScrollingCTFMessage extends ScrollingMessageTexture;

// message used when both teams are tied
var() localized string ScoresTiedMessage; 

/* parameters for ScrollingMessage:
   %t - leading team
   %s - leading team's score (also used for when teams are tied)
*/

simulated event RenderTexture(ScriptedTexture Tex)
{
  local string Text;
  local PlayerReplicationInfo Leading, PRI;
  local TournamentGameReplicationInfo GRI;
  local int i;
  local TeamInfo RedTeam, BlueTeam, LeadingTeam;
  local bool bTeamsTied;

  // get a reference to the GRI
  if(Player == None)
    FindPlayer();

  if(Player == None || Player.PlayerReplicationInfo == None 
    || Player.GameReplicationInfo == None)
    return;

  if (!Player.GameReplicationInfo.bTeamGame)
    return;

  GRI = TournamentGameReplicationInfo(Player.GameReplicationInfo);

  // calculated the position of the message
  if(LastDrawTime == 0)
    Position = Tex.USize;
  else
    Position -= (Level.TimeSeconds-LastDrawTime) * PixelsPerSecond;

  if(Position < -ScrollWidth)
    Position = Tex.USize;

  LastDrawTime = Level.TimeSeconds;

  // parse the ScrollingMessage
  Text = ScrollingMessage;

  if(InStr(Text, "%t") != -1 || InStr(Text, "%s") != -1)
  {
    // find the leading team
    LeadingTeam = None;

    RedTeam = GRI.Teams[0];
    BlueTeam = GRI.Teams[1];

    if ((RedTeam == None) || (BlueTeam == None))
      return;

    if (RedTeam.Score > BlueTeam.Score)
      LeadingTeam = RedTeam;
    else if (RedTeam.Score < BlueTeam.Score)
      LeadingTeam = BlueTeam;
    else
    {
      // doesn't matter which team when scores are tied
      LeadingTeam = RedTeam;
       bTeamsTied = true;
    }

    if (bTeamsTied)
    {
      // use the ScoresTiedMessage instead if teams are tied
      Text = ScoresTiedMessage;
      Text = Replace(Text, "%s", string(int(LeadingTeam.Score)));
    }
    else
    {
      Text = Replace(Text, "%t",
        class'TeamScoreBoard'.default.TeamName[LeadingTeam.TeamIndex]);
      Text = Replace(Text, "%s", string(int(LeadingTeam.Score)));
    }
  }

  if(bCaps)
    Text = Caps(Text);

  if(Text != OldText && bResetPosOnTextChange)
  {
    Position = Tex.USize;
    OldText = Text;
  }

  // draw the message
  Tex.DrawColoredText( Position, YPos, Text, Font, FontColor );
}
Importing the new class

Ok, now that we have the code for the new scrolling message, its time to add it to a map.

There are two ways that you can do this. You can either compile the class as a separate package and add it to the map that way, or you can import the class directly in to a map.

If you compile it as a separate package, the map will need to load the package when the map is loaded and it will probably have to be listed on the server packages list to work. By importing it to the map, you remove the need for an external package. I'll cover this method first.

Both of these methods use UnrealEd2.

Importing the class in to the map

Ok, firt things first: Make a backup of your map.

Now open up the class browser (the one used for selecting an actor to add to a map) and select Actor->Info->ClientScriptedTexture->ScrollingMessageTexture. Right click on the ScrollingMessageTexture class and select "New...". Now fill in the boxes as the following:

Package: MyLevel
Class: BasicScrollingCTFMessage

Then click on "OK".

When the code window pops up, replace *all* the code in the window with the code for the BasicScrollingCTFMessage class from above. After this is done, select: Tools | Compile changed to compile the script.

If there are any errors, check that you have:
1) Sub-classed ScrollingMessageTexture. If you sub-classed the wrong class, restart UnrealEd and reload the backup (you did make a backup, right?).
2) Replaced *all* the text with the BasicScrollingCTFMessage code. Make sure that you replace all the code in the code window with the code for the custom CTF banner.

If it compiled ok, save the map. The class is now embedded in your CTF map.

Importing the class in to a .u package

If you'd rather not import the class in to your map, you can import it in to regular .u package and add it to your map from there. This will mean that the package has to be distributed with the map, and may cause complications if trying to download the map off a server.

Open up the class browser (the one used for selecting an actor to add to a map) and select Actor->Info->ClientScriptedTexture->ScrollingMessageTexture. Right click on the ScrollingMessageTexture class and select "New...". Now fill in the boxes as the following:

Package: name_of_package
Class: BasicScrollingCTFMessage

Where name_of_package is what you want the new package to be called.

When the code window pops up, replace *all* the code in the window with the code for the BasicScrollingCTFMessage class from above. After this is done, select: Tools | Compile changed to compile the script.

If there are any errors, check that you have:
1) Sub-classed ScrollingMessageTexture. If you sub-classed the wrong one, restart UnrealEd and sub-class ScrollingMessageTexture.
2) Replaced *all* the text with the BasicScrollingCTFMessage code. Make sure that you replace all the code in the code window with the code for the custom CTF banner.

If it compiled ok, select the new package from the package list in the class browser (if no packages are listed, select "View | Show packages" to display them) and then select "File | Save selected packages" to save the package.

Setting it up for use

I don't really want to go over how to set up a scrolling message banner, so I'll assume that you already know how and continue from there. Check out the UnrealEd sites for tutorials on it if you are unsure of how to set one up, or check out some of the maps that use them like DM-Morhpeus, etc.

Once you've set up the map surface with the scripted texture you want to use, add the custom BasicScrollingCTFMessage to the map instead of a ScrollingMessageTexture. Set up the properties just as you would a regular message banner, except set up the ScrollingMessage and ScoresTiedMessage to use the CTF macros instead, eg. "%t leads with %s captures." for ScrollingMessage, and "Both teams are tied with %s captures." for the ScoresTiedMessage.


Kann mir jemand helfen und mir sagen wie ich das am Besten mache?

Vielen Dank im Voraus.

Euer Dec|$h0cKw@V€|.


PS: Hier ist noch der Link:

http://koregaming.com/downloads/Unre...F%20Banner.htm
  Mit Zitat antworten
Alt 10.06.2013, 18:48   #2
Donzi.UTzone
Der oberste Chaf
 
Benutzerbild von Donzi
 
Registriert seit: 13.11.2009
Ort: Wiesbaden
Alter: 48
Beiträge: 8.719
Beigetretene Cups: 10
Cup Siege: 2
Downloads: 1398
Uploads: 2697
Donzi eine Nachricht über ICQ schicken
Standard

Bitte benutz BBCODE

Ums kurz zu machen:

Du musst das ganze per Notepad oder einem besseren Plaintextprogramm vorschreiben
Danach musst Du es in den Ed importieren, bzw in Deine Map.
Du kannst allerdings das ganze auch aus u-Datei machen (was allerdings blöd is, mmn.)
__________________
•• Alle Letsplays: https://wiki.Donzi.tv
• Discord: https://chat.Donzi.tv
• Twitch: https://Donzi.TV
• Youtube: https://Donzi.YT
• Twitter: https://Donzi.tv/twitter
• Steam: https://Donzi.tv/steam


• Mein Liebling: https://UTzone.de
• Twitter: https://twitter.com/UTzone
• Games kaufen: https://UTzone.de/shop/games
Donzi ist offline   Mit Zitat antworten
Alt 10.06.2013, 19:03   #3
Dec|$h0cKw@V€|
Gast
 
Beiträge: n/a
Beigetretene Cups:
Cup Siege:
Downloads:
Uploads:
Standard

Oke...ähm ich hab keine Ahnung.

So wie ich das jetzt lese, muss ich praktisch die vorlage in ein nodepad hauen und dann in den editor.
Was meinst du mit vorschreiben. Nur zu Info ich hab wirklich null ahnung vom script editieren.
  Mit Zitat antworten
Alt 11.06.2013, 08:00   #4
Donzi.UTzone
Der oberste Chaf
 
Benutzerbild von Donzi
 
Registriert seit: 13.11.2009
Ort: Wiesbaden
Alter: 48
Beiträge: 8.719
Beigetretene Cups: 10
Cup Siege: 2
Downloads: 1398
Uploads: 2697
Donzi eine Nachricht über ICQ schicken
Standard

learning by doing
so hab ichs auch gemacht, aber nie gelernt

und genau so, wie du es jetzt beschrieben hast, genau so ist es auch.
notepad, rumtippen, importieren.
versuch es erst garnicht zu verstehen, mach einfach nach anweisung des howtos, um erstma voran zu kommen und erste fehler und/oder ergebnisse zu sehen
__________________
•• Alle Letsplays: https://wiki.Donzi.tv
• Discord: https://chat.Donzi.tv
• Twitch: https://Donzi.TV
• Youtube: https://Donzi.YT
• Twitter: https://Donzi.tv/twitter
• Steam: https://Donzi.tv/steam


• Mein Liebling: https://UTzone.de
• Twitter: https://twitter.com/UTzone
• Games kaufen: https://UTzone.de/shop/games
Donzi ist offline   Mit Zitat antworten
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:43 Uhr.

Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
CopyRight-Licence © 1999 - 2024 by UTzone.de