Page 7 of 8 FirstFirst ... 5678 LastLast
Results 121 to 140 of 144
  1. #121

    Re: BF4Stats.com Graphics coding

    I am looking to link the stats for the M320 Smk to track left center ,center ,right center - in this order:


    Left Center -
    M320 SMK World Ranking ,
    M320 SMK Kills,

    Center -
    M320 SMK Hits,
    M320 SMK Shots fired,
    M320 SMK Accuracy,

    Right Center -
    M320 SMK Headshots,
    M320 Headshot Percentage

    I am a noob coder familiar enough to edit once the basics are coded into proper place.

    I have read others having issues listing weapon specific stats and if it is possible I would like help with a basic template code showing the correct info I seek.

    Would someone help me by generating an editable template to fit a 400x150 banner ..I can handle the rest once the basics are in place.

    I would appreciate the help from whomever might be able to assist me.Web video player on my PC is not working properly so I am unable to watch the videos provided above.

    Thank You
    Last edited by KAPONYA_HOG; 2014-07-29 at 11:18. Reason: typographical error

  2. #122
    Administrator HigH_HawK's Avatar
    Join Date
    2006-03-15
    Location
    UK / GER
    Posts
    1,384

    Re: BF4Stats.com Graphics coding

    Hi KAPONYA_HOG,

    as soon as I'm home, I'll generate the very basics, for you to implement into your signature. It might however take another one or two hours.

    //EDIT: I shortened the titles a little, otherwise it would've not fit on the 400px width

    Code:
    /******Default settings******/
    defaults.text.size=9;
    defaults.text.color='000000';
    defaults.text.font='fonts/Vera.ttf';
    var bigFont='fonts/VeraBd.ttf';
    /******Default settings end******/
    
    // Background image
    //image({x:0,y:0,file:'insert_your_uploaded_background_image_here',w:400,h:150});
    
    if(!pd) {
      noPlayer();
    } 
    else if (pd.player.score == '0') {
      noPlayerData()
    }
    else {
      playerAvailable();
    }
    
    function noPlayer() {
      text({x:100,y:40,font:bigF,text:'Player not found',size:12});
    }
    
    function noPlayerData() {
      text({x:100,y:40,font:bigF,text:'No player data available',size:12});
    }
    
    function playerAvailable() {
      
    /******Scripts start******/
    function fn( number, decimals, dec_point, thousands_sep ) {
        
    var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
    var d = dec_point == undefined ? ',' : dec_point;
    var t = thousands_sep == undefined ? '.' : thousands_sep, s = n < 0 ? '-' : '';
    var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + '', j = (j = i.length) > 3 ? j % 3 : 0;
         
    return s + (j ? i.substr(0, j) + t : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, '$1' + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : '');
    }  
    
    function findWeapon(id) {
    if (!pd || !pd.weapons) return null;
    var i,w;
    for (i=0; i<pd.weapons.length; i++) {
    w=pd.weapons[i] ;
    if(w.stat.id==id) return w;
    }
    return null;
    }
    
    var weapon;
    weapon=findWeapon('m320-smk');
      
      
    function findWeaponRanking(id) {
    if (!pd || !playerRankings) return null;
    var i,wr;
    for (i=0; i<playerRankings.length; i++) {
    wr=playerRankings[i] ;
    if(wr.ident==id) return wr;
    }
    return null;
    }
      
    var weaponranking;
    weaponranking=findWeaponRanking('m320-smk');
      
    /******Scripts end********/
    
    // Box left
    text({x:10, y:60, text:'World Rnk:'});
    text({x:10, y:72, text:'Kills:'});
      
    // Data Box left
    text({x:120, y:60, align:'right', text:fn(weaponranking.rank,'','','.')});
    text({x:120, y:72, align:'right', text:fn(weapon.stat.kills,'','','.')});
      
    // Box center
    text({x:135, y:60, text:'Hits:'});
    text({x:135, y:72, text:'Shots fired:'});
    text({x:135, y:84, text:'Accuracy:'});
      
    // Data Box center
    text({x:255, y:60, align:'right', text:fn(weapon.stat.hits,'','','.')});
    text({x:255, y:72, align:'right', text:fn(weapon.stat.shots,'','','.')});
    text({x:255, y:84, align:'right', text:fn(weapon.extra.accuracy,'2',',','.')});
      
    // Box right
    text({x:268, y:60, text:'Headshots:'});
    text({x:268, y:72, text:'HS %:'});
    
    // Data box right
    text({x:368, y:60, align:'right', text:fn(weapon.stat.hs,'','','.')});
    text({x:380, y:72, align:'right', text:fn((weapon.stat.kills / weapon.stat.hs),'1',',','.') + ' %'});
    }
    Last edited by HigH_HawK; 2014-07-29 at 19:48.

  3. #123

    Re: BF4Stats.com Graphics coding

    The code you generated successfully applied the basic layout I am looking for .You rock Hawk! Thank you for your time and your assistance ! Much appreciated

  4. #124
    Administrator HigH_HawK's Avatar
    Join Date
    2006-03-15
    Location
    UK / GER
    Posts
    1,384

    Re: BF4Stats.com Graphics coding

    Glad to hear that this was, what you were looking for!

    Greets
    HigH_HawK

  5. #125

    Re: BF4Stats.com Graphics coding

    Is there a way to have the graphic in JPEG format? The PNG is too large of a file size, but JPEG should work if I can get it for my graphic.

  6. #126
    Administrator HigH_HawK's Avatar
    Join Date
    2006-03-15
    Location
    UK / GER
    Posts
    1,384

    Re: BF4Stats.com Graphics coding

    Quote Originally Posted by Battelman2 View Post
    Is there a way to have the graphic in JPEG format? The PNG is too large of a file size, but JPEG should work if I can get it for my graphic.
    You can use PNG or JPEG images for your graphic.

  7. #127

    Re: BF4Stats.com Graphics coding

    Quote Originally Posted by HigH_HawK View Post
    You can use PNG or JPEG images for your graphic.
    I mean having them exported, as in linked to, as JPEGs. The base graphic for it was JPEG, but that isn't relevant. I just want to be able to use the html link for the graphic as a JPEG to reduce file size on other websites where this is my signature.

  8. #128
    Administrator HigH_HawK's Avatar
    Join Date
    2006-03-15
    Location
    UK / GER
    Posts
    1,384

    Re: BF4Stats.com Graphics coding

    Quote Originally Posted by Battelman2 View Post
    I mean having them exported, as in linked to, as JPEGs. The base graphic for it was JPEG, but that isn't relevant. I just want to be able to use the html link for the graphic as a JPEG to reduce file size on other websites where this is my signature.
    Now I get what you are referring to! We however only provide the PNG file format as output image as this is already the smallest format, apart from GIF.

  9. #129

    Re: BF4Stats.com Graphics coding

    I'm not familiar with coding at all but I can make my own custom images with Photoshop. I watched the tutorials but just can't fully understand what to do. I would like to make a signature very similar to this one with the exact same layout only difference is that I want the weapon & vehicle icons to be to white outlined versions:

    Code:
    http://bf4stats.com/graphics/player?q=Silver2
    Could someone please provide me with the code to use to help me create my signature?

    Thanks in advanced!
    Last edited by Flava0ne; 2014-10-05 at 23:36.

  10. #130
    Administrator HigH_HawK's Avatar
    Join Date
    2006-03-15
    Location
    UK / GER
    Posts
    1,384

    Re: BF4Stats.com Graphics coding

    Hi Flava0ne,

    have a look at this one: http://bf4stats.com/graphics/player?q=mJNiSJvh

  11. #131

    Re: BF4Stats.com Graphics coding

    Sweet thanks man!

  12. #132
    New User
    Join Date
    2015-01-12
    Location
    Colombia
    Posts
    1
    Gamer IDs

    Steam ID: SanGlieR.

    Re: BF4Stats.com Graphics coding

    i need help
    i just want to change the background image
    but i don't know what code i should use
    or from where i can create that code pls, can you help me?
    i really need it.
    Thanks a lot.

  13. #133
    New User
    Join Date
    2014-01-01
    Posts
    19
    BFBC2 PC
    CQB-Vapulabis
    BF3 PC
    CQB-Vapulabis

    Re: BF4Stats.com Graphics coding

    Quote Originally Posted by KAR_DanixD View Post
    i need help
    i just want to change the background image
    but i don't know what code i should use
    or from where i can create that code pls, can you help me?
    i really need it.
    Thanks a lot.
    if you want the background image to rotate with the map that is being played at the time, which is what I do on one of my BF4 server graphics, then the line I have inmy image code is:-

    Code:
     // Map image
      image({x:0,y:0,file:sd.imgLarge,w:650,h:200});
    where sd.imgLarge is the server map image

  14. #134

    Re: BF4Stats.com Graphics coding

    I would like to make a small change or two to an existing signature: http://bf4stats.com/graphics/player?q=LotsOStats. Basically, I'd like to remove Kills and Deaths (since K/D ratio covers that) and add headshots and longest headshot.

    However, this graphic doesn't seem to be editable, unlike some of the others. I'm not wanting to "steal" someone's work, but like the basic layout of LotsOStats. Any guidance regarding either getting access to edit it, or another similar graphic that I can edit would be much appreciated. Thanks!

  15. #135
    Administrator HigH_HawK's Avatar
    Join Date
    2006-03-15
    Location
    UK / GER
    Posts
    1,384

    Re: BF4Stats.com Graphics coding

    Hi kgadams,

    unforunately the creator of this graphic has chosen not to publish his source code. As we have to respect that, you might want to look for another signature, where the creator does allow other people to edit it.

    I'm sorry for the inconvenience

  16. #136

    Displaying MVP-Medal or Ribbons and Weapon kills in graphics

    Code:
      shadowText({x:485,y:130,size:7,color:'FAA12A',text:'MVP-Ribbons'});
      shadowText({x:555,y:130,font:bigF,text:pd.awards[33].mCount,size:8});
    Am I doing something wrong? It is never displaying the right amount of ribbons/medals ...

    Where can I find a list of the right codes [33] for awards and also for weapons?

    I also would like to find a decent way to display pistol kills.

    Thanks

  17. #137
    Administrator 1ApRiL's Avatar
    Join Date
    2011-02-12
    Location
    Waiblingen, Germany
    Posts
    1,526
    BFBC2 PC
    1ApRiL
    NFS World
    1APRIL
    BF2
    1ApRiL
    BF3 PC
    1ApRiL

    Re: BF4Stats.com Graphics coding

    It is wrong to access a specific weapon or award by it's position in the corresponding list.
    So don't use the [number] to access that award, since the number can change anytime.

    You can use a helper functions to find the right award or right weapon.
    Code:
    function getAwardById(id) {
    	return pd.awards.filter(function(item){ 
    		return item.id==id;
    	})[0];
    }
    function getWeaponById(id) {
    	return pd.weapons.filter(function(item){ 
    		return item.stat.id==id;
    	})[0];
    }
    They can be used like that:
    Code:
    var award = getAwardById('m09');
    shadowText({x:485,y:130,size:7,color:'FAA12A',text:award.rName});
    shadowText({x:555,y:130,font:bigF,text:award.rCount,size:8});
    Admin of bfhstats.com / bf4stats.com / bf3stats.com | Twitter

  18. #138

    Re: BF4Stats.com Graphics coding

    Thanks for this thread! Was very helpful

    My first work: 600x200
    http://bf4stats.com/graphics/player?q=FifRPDvA

    700x200
    http://bf4stats.com/graphics/player?q=0c6sn3N4

  19. #139

    Re: BF4Stats.com Graphics coding

    I am having trouble processing all of the code for player stats. How exactly would I set it to where I can have the viewers name inside of the graphic. I am apart of a clan/community and am setting a signature up for them all to use and I want it to show their names, not just a singular name.

  20. #140
    Administrator HigH_HawK's Avatar
    Join Date
    2006-03-15
    Location
    UK / GER
    Posts
    1,384

    Re: BF4Stats.com Graphics coding

    Quote Originally Posted by TG_MuffinMan View Post
    I am having trouble processing all of the code for player stats. How exactly would I set it to where I can have the viewers name inside of the graphic. I am apart of a clan/community and am setting a signature up for them all to use and I want it to show their names, not just a singular name.
    You could look for an exisiting graphic where the creator did make his code publicly available. There are quite a few good ones where the creator did comment above each box/line what the box/line actually does.

    Otherwise, if you specify your question as to what you want to be shown in the graphic, we could probably help you to set up your own graphic.

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
  •  
P-STATS NETWORK FORUM LOGIN CREATE ACCOUNT