• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[Tutorial] FPS and PING in HUD game

Junior Spellweaver
Joined
Jan 19, 2014
Messages
136
Reaction score
126
Hello RageZone! First of all sorry if you have any English errors I'm using google translator.

In this tutorial you will learn about that FPS and PING in the style of src UNITED...

In 3 steps src game, flash game and script game...


Step 1

WarZ.sln

Search for:

Code:
if(NetworkLocal && gClientLogic().localPlayer_)
      {
Change all code for this:
Code:
if(NetworkLocal && gClientLogic().localPlayer_) // TheLiciaZ CORP
      {
            if(gClientLogic().net_->lastPing_ > 0)
            Font_Label->PrintF((r3dRenderer->ScreenW) / 2, 0, r3dColor(255,0,0), "PING: %i", gClientLogic().net_->lastPing_);
            if (r_render_in_game_HUD->GetBool()  && hudPause && !hudPause->isActive())//do not show FPS: and PING: if HUD disabled 
            {
                  float fps = r3dGetAvgFPS();
                  hudMain->showPingFPS(gClientLogic().net_->lastPing_, int(fps));
            }
      }

Search for this now:
Code:
void HUDDisplay::addChatMessage(int tabIndex, const char* user, const char* text, uint32_t flags)

Add above:
Code:
void HUDDisplay::showPingFPS(int valueping, int valuefps) // TheLiciaZ CORP
{
      if (!Inited) return;
 
      //PING
      int Ping = valueping;
      bool pingnormal = Ping < 100;
      bool pinglow = (Ping > 100 && Ping < 200);
      bool pinghight = Ping > 200;
      char PingStr[64] = { 0 };
 
      if (pingnormal)
            sprintf(PingStr, "<font color=\"#FFFFFF\">%d</font>", valueping);
      else if (pinglow)
            sprintf(PingStr, "<font color=\"#FF9900\">%d</font>", valueping);
      else if (pinghight)
            sprintf(PingStr, "<font color=\"#CC0000\">%d</font>", valueping);
 
      //FPS
      float fps = r3dGetAvgFPS();
      bool fpsvaluemax = fps > 40.0f;
      bool fpsvaluemed = (fps > 20.0f && fps < 40.0f);
      bool fpsvaluemin = fps < 20.0f;
      char FpsStr[64] = { 0 };
 
      if (fpsvaluemax)
            sprintf(FpsStr, "<font color=\"#FFFFFF\">%d</font>", valuefps);
      else if (fpsvaluemed)
            sprintf(FpsStr, "<font color=\"#FF9900\">%d</font>", valuefps);
      else if (fpsvaluemin)
            sprintf(FpsStr, "<font color=\"#CC0000\">%d</font>", valuefps);  // TheLiciaZ CORP
     
      Scaleform::GFx::Value var[2];
      var[0].SetString(PingStr);
      var[1].SetString(FpsStr);
      gfxHUD.Invoke("_root.api.showPingFPS", var, 2);
}

now search for:
Code:
void  setBloodAlpha(float alpha);

Add above
Code:
void  showPingFPS(int valueping, int valuefps); // TheLiciaZ CORP

FLASH PART

HUD.as

Search for:
Code:
public function setPlayerListContextMenuButton(id:int, name:String, actionID:int)

Add before:
Code:
public function showPingFPS(PingStr:String, FpsStr:String) // TheLiciaZ CORP
                                  {
                                                Main.PingFps.PING.htmlText = "PING: " + PingStr;
                                                Main.PingFps.FPS.htmlText = "FPS: " + FpsStr;
                                 }

In Main.as
Now search for
Code:
public    var api:warz.hud.HUD = null;

Add before
Code:
public var PingFps:MovieClip; // TheLiciaZ CORP



Create action script in WARZ_HUD.fla




Credits create CODE Alexx VERMELHO

Credits decode HUD and SCRIPTs ME!!!

TheLiciaZ FOREVER!!!
 
Newbie Spellweaver
Joined
Dec 26, 2014
Messages
16
Reaction score
9
I have to say its good for the guys who doesnt know how to make that but pls why you guys only do easy things... this is done in 2 minutes no joke...
 
Junior Spellweaver
Joined
Mar 29, 2014
Messages
101
Reaction score
12
I have problem with my flash part



And he have more folders etc. how to do it ???



And how to make this HUD.as script ? i am new in Flash xD
 
Back
Top