Ppgtjmad / SimpleShops

[HG] Simple Shops
27 stars 8 forks source link

Is it possible to add custom ranks? #63

Closed arbella closed 3 years ago

arbella commented 4 years ago

Title says all. Thanks.

Ppgtjmad commented 4 years ago

@arbella

If you're asking about making custom ranks that can be used along with A3 ranking system then the answer is no, it is not possible, ranks are hardcoded.

BUT you can make your own ranks in mission config and set it as a variable on the player (just like HG_MasterCfg in HG_Config.h).

class HG_MasterCfg
{
    class MyRankOne
    {
        paycheck = 2000;
        paycheckPeriod = 30;
        startCash = 5000;
        startBank = 50000;
        killedReward = 500;
        tkPenaltyPlayer = 500;
        tkPenaltyAI = 250;
        xpPenaltyPlayer = 10;
        xpPenaltyAI = 5;
        xpReward = 10;
        xpToLvlUp = 1000;
        iShopDiscount = 0;
        gShopDiscount = 0;
        vShopDiscount = 0;
    };
        class MyRankTwo
    {
                paycheck = 4000;
        paycheckPeriod = 30;
        startCash = 5000;
        startBank = 50000;
        killedReward = 1000;
        tkPenaltyPlayer = 1000;
        tkPenaltyAI = 500;
        xpPenaltyPlayer = 20;
        xpPenaltyAI = 10;
        xpReward = 20;
        xpToLvlUp = 1500;
        iShopDiscount = 2;
        gShopDiscount = 2;
        vShopDiscount = 2;
        };
        // Etc...
};

player setVariable["HG_Rank","MyRankTwo",true];

The downside to this method is that features that rely on hardcoded ranks won't make use of your custom ranks... like groups.

setRank and getRank commands will have to be replaced in the files to match your changes too.

It is also going to be problematic if AIs are spawned in your mission because you also have to set the variable on them for the killed rewards to work. Same with editor placed units.

arbella commented 4 years ago

@arbella

If you're asking about making custom ranks that can be used along with A3 ranking system then the answer is no, it is not possible, ranks are hardcoded.

BUT you can make your own ranks in mission config and set it as a variable on the player (just like HG_MasterCfg in HG_Config.h).

class HG_MasterCfg
{
  class MyRankOne
  {
      paycheck = 2000;
      paycheckPeriod = 30;
      startCash = 5000;
      startBank = 50000;
      killedReward = 500;
      tkPenaltyPlayer = 500;
      tkPenaltyAI = 250;
      xpPenaltyPlayer = 10;
      xpPenaltyAI = 5;
      xpReward = 10;
      xpToLvlUp = 1000;
      iShopDiscount = 0;
      gShopDiscount = 0;
      vShopDiscount = 0;
  };
        class MyRankTwo
  {
                paycheck = 4000;
      paycheckPeriod = 30;
      startCash = 5000;
      startBank = 50000;
      killedReward = 1000;
      tkPenaltyPlayer = 1000;
      tkPenaltyAI = 500;
      xpPenaltyPlayer = 20;
      xpPenaltyAI = 10;
      xpReward = 20;
      xpToLvlUp = 1500;
      iShopDiscount = 2;
      gShopDiscount = 2;
      vShopDiscount = 2;
        };
        // Etc...
};

player setVariable["HG_Rank","MyRankTwo",true];

The downside to this method is that features that rely on hardcoded ranks won't make use of your custom ranks... like groups.

setRank and getRank commands will have to be replaced in the files to match your changes too.

It is also going to be problematic if AIs are spawned in your mission because you also have to set the variable on them for the killed rewards to work. Same with editor placed units.

Thank you, i just wanted to add custom ranks for special units like Traders, for when the player looks at them instead of it saying private, or etc it would label them as a trader. There wont be any like having to set up kill rewards and stuff for these guys since they wont be killable anyway.

Ppgtjmad commented 4 years ago

@arbella

Have a look here -> https://github.com/Ppgtjmad/SimpleShops/blob/master/HG/Functions/Client/Tags/fn_playerTags.sqf

You can easily add a check for your custom variable and display that instead of rank.