Page 1 of 8 123 ... LastLast
Results 1 to 10 of 76
  1. #1
    Plugin Developer
    Join Date
    Jan 2012
    Location
    Saarland
    Posts
    915

    Insane Limits: Service Stars / Ingame Stats

    These limits can show ingame weapon service stars or stats from the person who killed you.


    Idea:
    Since Battlefield 4 doesn't show you weapon service stars in kill cam, I wrote this limit that can write some stats into the chat as a private message.

    This limit also works with Battlefield 3 and it could be also useful there since the ingame service stars are limited to 100 but there are a lot of players with more than 100 service stars with one weapon.

    The limit takes the information from Battlelog, so it generates some traffic on your layer. I don't know yet whether this could cause some problems especially because Battlelog cache isn't supported for BF4 at the moment.
    But basically it shouldn't be a problem because this limit only takes the weapon stats when someone wants to know it.

    Quote Originally Posted by PapaCharlie9 View Post
    Not correct. Stats are fetched on player join or plugin enable for existing players. The function assumes the stats are already there.
    Quote Originally Posted by PapaCharlie9 View Post
    Full weapon stats are fetched for every player in the server, whether they are used or not. This is particularly expensive for BF3, since the weapon stats are huge, several megabytes of text per player.
    Usage option 1: Battlefield 3 + Battlefield 4

    You have been killed and you want to know how many service stars your killer has with that weapon.

    Write !stars into the chat and you'll see the service stats, the usage percentage of this weapons and the total kills:




    First limit:

    On Death
    Code
    Code:
    player.Data.setString("LastDeathWeapon", kill.Weapon);
    player.Data.setString("LastKiller", killer.Name);
    return false;
    Second limit:

    OnAnyChat
    Expression
    Code:
    player.LastChat.StartsWith("!stars")
    Code
    Code:
    if (player.Data.issetString("LastKiller")) {
    String LastKiller = player.Data.getString("LastKiller");
    String LastDeathWeapon = player.Data.getString("LastDeathWeapon");
    PlayerInfoInterface LastKillerInterface = plugin.GetPlayer(LastKiller, false);
    
    if (LastKillerInterface != null) {
    BattlelogWeaponStatsInterface WeaponStats = LastKillerInterface.GetBattlelog(LastDeathWeapon);
        
    if (WeaponStats != null) {
    double WeaponTotalKills = WeaponStats.Kills; 
    if (WeaponTotalKills > 0) {
    double WeaponUsagePercentage = Convert.ToInt32(WeaponTotalKills/LastKillerInterface.Kills*100);
    double ServiceStars = Convert.ToInt32(WeaponTotalKills/100);
    plugin.SendPlayerMessage(player.Name, plugin.R ("\nKiller: " +LastKiller+ " with " + (plugin.FriendlyWeaponName(LastDeathWeapon).Name) + " || ServSt: " + ServiceStars + "\nUsage percentage: " + WeaponUsagePercentage + "% || Kills with all weapons: " + LastKillerInterface.Kills));
    }
    else
    plugin.SendPlayerMessage(player.Name, plugin.R ("No weapon stats available yet."));
    }
    }
    }
    else
    plugin.SendPlayerMessage(player.Name, plugin.R ("Nobody has killed you yet."));
    
    return false;
    If you dont't use Battlelog Cache, you should set use_slow_weapon_stats to true.

    Usage option 2: Battlefield 4

    V10cIPX.jpgmessagesOff.png

    Players can enable/disable messages with @servicestars command. If it's enabled it shows service stars on every death.

    First limit
    OnAnyChat
    Expression
    Code:
    player.LastChat.StartsWith("@servicestars")
    Code
    Code:
    if (!player.Data.issetBool("NoYell")) {
    player.Data.setBool("NoYell", false);
    plugin.SendPlayerYell(player.Name, plugin.R ("\nMessages on"),5);
    return false;
    }
    
    if(player.Data.getBool("NoYell")) {
    player.Data.setBool("NoYell", false);
    plugin.SendPlayerYell(player.Name, plugin.R ("\nMessages on"),5);
    }
    else {
    player.Data.setBool("NoYell", true);
    plugin.SendPlayerYell(player.Name, plugin.R ("\nMessages off"),5);
    }
    return false;
    Second Limit

    OnDeath
    Code
    Code:
    if (!player.Data.issetBool("NoYell"))
    player.Data.setBool("NoYell", true);
    
    if (player.Data.getBool("NoYell")) 
    return false;
    else {
    if (killer.Name != null) {
    BattlelogWeaponStatsInterface WeaponStats = killer.GetBattlelog(kill.Weapon);
    if (WeaponStats != null) {
    double WeaponTotalKills = WeaponStats.Kills; 
    if (WeaponTotalKills > 0) {
    double WeaponUsagePercentage = Convert.ToInt32(WeaponTotalKills/killer.Kills*100);
    double ServiceStars = Convert.ToInt32(WeaponTotalKills/100);
    plugin.SendPlayerYell(player.Name, plugin.R ("\nKiller: " +killer.Name+ " with " + (plugin.FriendlyWeaponName(kill.Weapon).Name) + "\nService Stars: " + ServiceStars + "\n" + WeaponUsagePercentage + "% of all "  + killer.Kills + " kills."), 6);
    }
    }
    }
    }
    
    return false;

    Usage option 3: Battlefield 4 - Show round stats: Headshots, Kills, Deaths, KDR [...]

    Players can enable/disable messages with @servicestars command. If it's enabled it shows service stars on every death.

    First limit
    OnAnyChat
    Expression
    Code:
    player.LastChat.StartsWith("@killerstats")
    Code
    Code:
    if (!player.Data.issetBool("NoYell")) {
    player.Data.setBool("NoYell", false);
    plugin.SendPlayerYell(player.Name, plugin.R ("\nMessages on"),5);
    return false;
    }
    
    if(player.Data.getBool("NoYell")) {
    player.Data.setBool("NoYell", false);
    plugin.SendPlayerYell(player.Name, plugin.R ("\nMessages on"),5);
    }
    else {
    player.Data.setBool("NoYell", true);
    plugin.SendPlayerYell(player.Name, plugin.R ("\nMessages off"),5);
    }
    return false;
    Second Limit
    OnDeath
    Code
    Code:
    if (!player.Data.issetBool("NoYell"))
    player.Data.setBool("NoYell", true);
    
    if (player.Data.getBool("NoYell")) 
    return false;
    else {
    if (killer.Name != null) {
    plugin.SendPlayerYell(player.Name, plugin.R ("Stats for " + killer.Name + ": \nHeadshots: " + killer.HeadshotsRound + " Kills: " + killer.KillsRound + "\nDeaths "  + killer.DeathsRound + " KDR: " + Math.Round(killer.KdrRound, 2) ), 6);
    }
    }
    return false;
    Attached Images Attached Images
    Last edited by LumPenPacK; 16-12-2014 at 07:55.
    64 slots mixed Classic mode BF4
    32 slots rush mode BF3

  2. #2
    Cool! That's a handy limit to have.

    Quote Originally Posted by LumPenPacK View Post
    The limit takes the information from Battlelog, so it generates some traffic on your layer. I don't know yet whether this could cause some problems especially because Battlelog cache isn't supported for BF4 at the moment.
    But basically it shouldn't be a problem because this limit only takes the weapon stats when someone wants to know it.
    That's not correct. Full weapon stats are fetched for every player in the server, whether they are used or not. This is particularly expensive for BF3, since the weapon stats are huge, several megabytes of text per player.

    If you dont't use Battlelog Cache, you should set use_slow_weapon_stats to true.
    That setting is required to be True whether you use BattlelogCache or not.
    Don't send me private messages (PMs) unless you really need privacy, like your game server password. If you just have a question or need help, post in one of the threads. It's extra work for me to answer questions and give help in private messages and no one else gets the benefit of the answer.

  3. #3
    Plugin Developer
    Join Date
    Jan 2012
    Location
    Saarland
    Posts
    915
    Quote Originally Posted by PapaCharlie9 View Post
    That's not correct. Full weapon stats are fetched for every player in the server, whether they are used or not. This is particularly expensive for BF3, since the weapon stats are huge, several megabytes of text per player.
    Good to know. I thought IL only pick up the needed stats.

    But in this case, IL should only fetches the stats when the player.GetBattlelog-function is called and not when a player is joining, or is that also not correct?


    Quote Originally Posted by PapaCharlie9 View Post
    That setting is required to be True whether you use BattlelogCache or not.
    When I disable use_direct_fetch in order to use BL-Cache there is no option to enable or disable use_slow_weapon_stats

    64 slots mixed Classic mode BF4
    32 slots rush mode BF3

  4. #4
    Quote Originally Posted by LumPenPacK View Post
    Good to know. I thought IL only pick up the needed stats.

    But in this case, IL should only fetches the stats when the player.GetBattlelog-function is called and not when a player is joining, or is that also not correct?
    Not correct. Stats are fetched on player join or plugin enable for existing players. The function assumes the stats are already there.


    When I disable use_direct_fetch in order to use BL-Cache there is no option to enable or disable use_slow_weapon_stats
    I know, those settings are confusing. I'll try to explain.

    Start be remembering this: If BattlelogCache is available, Insane Limits always uses it. There's no setting, it just uses it.

    If BattlelogCache is not available, you can decide whether to fetch stats directly (use_direct_fetch is True) or not fetch stats at all (use_direct_fetch is False). Though note that even if you set use_direct_fetch to false, clan tags are still fetched directly, because IL requires clan tags to work properly.

    Whether using direct fetch or BattlelogCache, weapon stats fetching is controlled by use_slow_weapon_stats, so that setting has to be true for both BattlelogCache and direct fetch for your limit to work.
    Don't send me private messages (PMs) unless you really need privacy, like your game server password. If you just have a question or need help, post in one of the threads. It's extra work for me to answer questions and give help in private messages and no one else gets the benefit of the answer.

  5. #5
    Plugin Developer
    Join Date
    Jan 2012
    Location
    Saarland
    Posts
    915
    Quote Originally Posted by PapaCharlie9 View Post
    Not correct. Stats are fetched on player join or plugin enable for existing players. The function assumes the stats are already there.
    Okay, I didn't know that. In this case it was a little bit useless to split it into two limits with the intention of keeping the BL request on a minimum. Instead this limit could also show the service stars to everyone on every death with a yell message (with an option to enable or disable it)

    V10cIPX.jpg

    BTW: Funny fact: I took this random screenshot and it was exactly the same player as on the random screenshot I took hours ago...


    Quote Originally Posted by PapaCharlie9 View Post
    I know, those settings are confusing. I'll try to explain.

    Start be remembering this: If BattlelogCache is available, Insane Limits always uses it. There's no setting, it just uses it.

    If BattlelogCache is not available, you can decide whether to fetch stats directly (use_direct_fetch is True) or not fetch stats at all (use_direct_fetch is False). Though note that even if you set use_direct_fetch to false, clan tags are still fetched directly, because IL requires clan tags to work properly.

    Whether using direct fetch or BattlelogCache, weapon stats fetching is controlled by use_slow_weapon_stats, so that setting has to be true for both BattlelogCache and direct fetch for your limit to work.
    All clear, thanks for the clarification.
    Last edited by LumPenPacK; 01-02-2014 at 18:49.
    64 slots mixed Classic mode BF4
    32 slots rush mode BF3

  6. #6
    Quote Originally Posted by LumPenPacK View Post
    Okay, I didn't know that. In this case it was a little bit useless to split it into two limits with the intention of keeping the BL request on a minimum. Instead this limit could also show the service stars to everyone on every death with a yell message (with an option to enable or disable it)

    V10cIPX.jpg

    BTW: Funny fact: I took this random screenshot and it was exactly the same player as on the random screenshot I took hours ago...
    Sweet! I didn't realize that yells are visible during killcam. That wasn't true in BF3.
    Don't send me private messages (PMs) unless you really need privacy, like your game server password. If you just have a question or need help, post in one of the threads. It's extra work for me to answer questions and give help in private messages and no one else gets the benefit of the answer.

  7. #7
    Plugin Developer
    Join Date
    Jan 2012
    Location
    Saarland
    Posts
    915
    Quote Originally Posted by PapaCharlie9 View Post
    Sweet! I didn't realize that yells are visible during killcam. That wasn't true in BF3.
    yup, that's something new.
    64 slots mixed Classic mode BF4
    32 slots rush mode BF3

  8. #8
    Senior Member
    Join Date
    Nov 2010
    Location
    United Kingdom
    Posts
    391
    could this be edited with the following info please

    Round Information:
    Headshot %:
    Kills:
    Deaths:
    K/D Ratio:
    Score:

    Thanks
    Last edited by Tomgun; 15-04-2014 at 09:37.

  9. #9
    Plugin Developer
    Join Date
    Jan 2012
    Location
    Saarland
    Posts
    915
    Try this one with usage option 2 as second limit: (not tested)

    Code:
    if (!player.Data.issetBool("NoYell"))
    	player.Data.setBool("NoYell", true);
    
    if (player.Data.getBool("NoYell")) 
    	return false;
    else {
    	if (killer.Name != null) {
    		BattlelogWeaponStatsInterface WeaponStats = killer.GetBattlelog(kill.Weapon);			
    		if (WeaponStats != null) {
    		double WeaponTotalKills = WeaponStats.Kills; 
    			if (WeaponTotalKills > 0) {
    			double WeaponUsagePercentage = Convert.ToInt32(WeaponTotalKills/killer.Kills*100);
    			double ServiceStars = Convert.ToInt32(WeaponTotalKills/100);
    			plugin.SendPlayerYell(player.Name, plugin.R ("\nHeadshot %: " + Math.Round((player.HeadshotsTotal/player.KillsTotal)*100, 2)+ " Kills: " + player.KillsTotal + " Deaths: " + player.DeathsTotal + "\nK/D Ratio:" + player.KdrTotal + " Score: "  + killer.Kills + " player.ScoreTotal"), 6);
    			}
    		}
    	}				
    }
    
    return false;
    Last edited by LumPenPacK; 15-04-2014 at 20:06.
    64 slots mixed Classic mode BF4
    32 slots rush mode BF3

  10. #10
    Member
    Join Date
    Jan 2013
    Location
    United Kingdom
    Posts
    71
    is there a way for it just to give the totalkills for the select weapon....
    or does it have to be all kills across all weapons ?
    Last edited by FLirtY-3D; 27-04-2014 at 17:02.
    prefer to lose with honor than win by cheating << http://metabans.com/flirty >>

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •