SBF in Compilations


This page is intended to show authors how to use SBF in their compilations.

SBF Saved Variables
SBF stores its settings in a mix of per-character and per-account saved variables. All settings are stored in the SatrinaBuffFrame.lua file in the .../World of Warcraft/WTF/Account/ACCOUNTNAME/SavedVariables directory. When a character without a SBF profile is first logged in, a new one is created for them based on the SBF defaults. In order to set up the buff frames as your compilation needs, users will need to copy a pre-defined profile containing the correct per-character settings for your compilation.

As of SBF 3.0, things are a little easier for you. Having moved SBF to Ace3, the profile system is a lot more sane. I've added a New Profile button to the Global Options tab, and a Use Profile dropdown as well. You can now make a specifically named profile from the start, and not have to muck around in the SBF saved variables file. Just tell your users to either use the Use Profile dropdown to select your compilation's SBF settings directly (you may want to recommend they delete the profile SBF created for their character, Name - Server). You can also have them use the Copy Profile dropdown to make a copy of them if they were going to tweak settings for themselves. That way they aren't changing the compilation settings and can always re-copy the original compilation settings if they don't like what they did. Oh yeah, you'll probably want to clear out the spell cache section either by using the Clear Data button on the Spells tab, or editing the saved variables as below.




In any case, the stuff from 2.8 is still valid, and is kept below for you

The process for getting a SBF saved variables file ready for inclusion with your compilation has two steps:

Open the SatrinaBuffFrame.lua file in a text editor. Any one will do, but an editor that supports bracket matching will help you see what is going on more easily. SciTE is a good choice.

Per-account saved variables
SBF tracks data about buffs and debuffs that you have had applied to your characters for various uses. You should clean this out and not ship your data with your compilation. The buffs you get aren't necessarily the buffs your user will be getting if they are lower level, are or are not a raider, etc. Search for ["account"] in your saved variables file:

["global"] = {
  ["spells"] = {
    ["Energy Storm"] = {
      ["buffType"] = 2,
      ["duration"] = 0,
      ["untilCancelled"] = true,
    },
    ["Seal of the Crusader"] = {
      ["buffType"] = 1,
      ["duration"] = 30,
      ["untilCancelled"] = false,
    },
    ["Shadow Word: Pain"] = {
      ["buffType"] = 2,
      ["duration"] = 18,
      ["untilCancelled"] = false,
    },
    ["Hardened Skin"] = {
      ["buffType"] = 1,
      ["duration"] = 20,
      ["untilCancelled"] = false,
    },
    ["Guard's Mark"] = {
      ["buffType"] = 2,
      ["duration"] = 30,
      ["untilCancelled"] = false,
    },
    ... (buffs and debuffs)
  },
},

Depending on how long you've been using SBF or if you participated in the 2.8 beta without resetting your saved variables between releases, you may have some of the fruits of my laziness in saved variables. Ultimately the account section of the saved variables you ship with your compilation should look like this:

["account"] = {
  ["spells"] = {
  },
},

or even like this:

["account"] = {
},
(SBF will create the safecall and spells entries when you next login if they are missing)

Per-character saved variables
Search for YOURNAME (e.g. Satrina) to get into the section containing the per-character settings you want to use as the pre-defined settings. For example:

["Satrina - Stormrage"] = {
  ["frames"] = {
    {
      ["sctColour"] = {
        ["b"] = 0.1,
        ["g"] = 1,
        ["r"] = 0.1,
      },
      ... (settings for frame 1)
    }, -- [1]
    {
      ["sctColour"] = {
        ["b"] = 0.1,
        ["g"] = 1,
        ["r"] = 0.1,
      },
      ... (settings for frame 2)
    }, -- [2]
    ... (other frames)
  },
  ... (other settings)
  ["filters"] = {
    "4:a", -- [1]
  },
},

Once you've located the settings you want to use as the pre-defined settings, change the label to something recognisable like the name of your compilation - but retain the "char" portion of the label. For example: ["Satrina - Stormrage"] -> ["MonkeyUI"]. (You should also delete any other ["Name- Realm"] sections for your own characters, but do not delete the ["profiles"] section parts that surround the char/Name sections.)

What this does is create your pre-defined settings under a name that is recognisable by your users and will not be changeable by them unless they get into the SatrinaBuffFrame.lua saved variables file and start mucking about. On the Global options tab, the Copy profile dropdown will show this:

As part of the the installation instructions for your compilation, instruct your users to open the SBF options, go to the Global tab, and copy the pre-defined profile. A side benefit of this is that users can mess around with the layout of their frames all they want and still be able to revert to the pre-defined layout for your compilation.

What it should look like
When done, your saved variables file should look something like this:

SBFDB = {
  ["account"] = {
    ["spells"] = {
    },
  },
  ["profiles"] = {
    ["char/MonkeyUI"] = {
      ["frames"] = {
        {
          ["sctColour"] = {
            ["b"] = 0.1,
            ["g"] = 1,
            ["r"] = 0.1,
          },
          ... (other frame 1 settings)
        }, -- [1]
        {
          ["sctColour"] = {
            ["b"] = 0.1,
            ["g"] = 1,
            ["r"] = 0.1,
          },
          ... (other frame 2 settings)
        }, -- [2]
        ... (other frames' settings)
      },
      ... (other settings)
      ["filters"] = {
        "4:a", -- [1]
      },
    },
  },
}

The "account" and "profiles" sections (and sections within them) may be in a different order; that's fine.

Hopefully this will help you get SBF into your compilations with minimum hassle. Questions or suggestions for making this more clear are welcome: satrina@evilempireguild.org