Customization

From OBBLM wiki
Jump to: navigation, search

This page discusses the customization of your OBBLM installation.

Contents

Global settings

The league IDs used in this settings file can be found at the bottom of the page in AdminImport team.

House ranking systems/rules

In the case of the already implemented ranking systems not fitting the needs of your league, you may define house ranking systems.

The fields which you may sort teams against are:

mvp 
cp
td
intcpt
bh
si
ki
cas (sum of PLAYER cas)
tdcas ("td" + "cas")
tcasf (total TEAM cas by this team)
tcasa (total TEAM cas against this team)
tcdiff (equals to the arithmetic value of "tcasf" - "tcasa")
gf (total score made by this team)
ga (total score made against this team)
sdiff (equals to the arithmetic value of "gf" - "ga")
played
won
lost
draw
win_pct
elo
smp (sportsmanship points)
pts (points)

When making a house ranking rule you must define two fields in the settings.php file.
These take the following form (in this case, we define house ranking system number 5):

$hrs[5]['rule']   = array('+field1', '-field2', '+field3');
$hrs[5]['points'] = 'X*[field4] + Y*[field5] + [field6]'

These two lines should be interpreted like so:

$hrs[5]['rule']

This field must take the form of:

array('+field1', '-field2', '+field3')

This should be interpreted as:

  1. Sort first by least of field1
  2. Sort secondly by most of field2
  3. Sort at last by least of field3

Note: "+" prefix indicates least of (ascending) and "-" most of (descending). You may NOT omit the +/- prefixes. They are required for every field!

Note: You may define as many entries in the rule you want. It's not limited to 3, like in this example.

$hrs[5]['points']

This field must take the form of:

'X*[field4] + Y*[field5] + [field6]'

Where X and Y may by either integers, floating point numbers or another field itself — e.g. [field7]

A points definition does not have to be a linear combination of fields, e.g.

'[field4]/([field5]*[field6])'

is 100% valid.

However, combining in-game specific results to form points is not possible. For example, getting points for a difference of 3 in cas or TD in a game is not possible.

PLEASE NOTE: If you do not need the points field, because it is not included in the rule field of your ranking system, then simply leave the "points" definition be equal to "" (i.e. two quotes only).

E.g. (for house ranking system 3):

$hrs[3]['rule']   = array('-sdiff', '-smp'); 
$hrs[3]['points'] = '';

... sorts teams against: largest score difference, then most sportsmanship points. But does not use the pts field in the rule, and thus we don't need to define points (i.e. we leave it empty).

Saving the changes

IMPORTANT!!!

Once you have changed/added/removed ranking system definitions you must notify OBBLM.
This is done via the admin menu AdminOBBLM core panel

Here you must:

  • ALWAYS select the Re-install DB back-end procedures and functions under DB maintenance.
  • IF changes have been made to a points definition which is used in a tournament, you must also run syncAll() under DB synchronisation procedures.

ALSO:

  • IF changing/deleting rule numbers you must always make sure tournaments are up-to-date with the correct ranking system. This may be done via. the admin menu AdminManagement: Tournaments.

Local settings files

Every box MUST have a UNIQUE 'box_ID' number.
The box IDs are used to determine the order in which the boxes are shown on the front page.
The box with 'box_ID' = 1 is shown at the top of the page, the box with 'box_ID' = 2 is displayed underneath it and so forth.

Every box displays information/stats for either a league, division or tournament. The type field should equal one of these.
The specific league/division/tournament for the box is selected by setting the id value equal to the OBBLM league/division/tournament ID.
A list of the IDs for your league(s)/division(s)/tournament(s) can be found at the bottom of the page in AdminImport team.

Standings boxes

E.g.:

$settings['fp_standings'] = array(
    array(
        'type'   => 'league',    # This sets the node to be a LEAGUE.
        'id'     => 2,           # LEAGUE with ID = 2

        'box_ID' => 2,           # Display as 2nd box when ordering the boxes
        'infocus' => false,      # If true a random team from the standings will be selected and its top players displayed.
        'HRS'    => 1,           # Ranking rule for standings
        'title'  => 'Standings', # Box title
        'length' => 6,           # Number of entries in box
        'fields' => array('Name' => 'name', 'PTS' => 'pts', 'TV' => 'tv', 'CAS' => 'cas', 'W' => 'won', 'L' => 'lost', 'D' => 'draw', 'GF' => 'gf', 'GA' => 'ga',),
    ),
);

HRS: The house ranking system NUMBER to sort the table against.
Note, this is ignored for "type = tournament", since tours have an assigned HRS.
Also note that using HRSs with fields such as points (pts) for leagues/divisions standings makes no sense as they are tournament specific fields (i.e. it makes no sense to sum the points for teams across different tours to get the teams' "league/division points", as the points definitions for tours may vary).

Leaders boxes

E.g.:

$settings['fp_leaders'] = array(
    array(
        'type'      => 'tournament',      # This sets the node to be a TOURNAMENT
        'id'        => 1,                 # TOURNAMENT with ID = 1

        'box_ID'    => 3,                 # Display as 3rd box when ordering the boxes
        'title'     => 'Most casualties', # Box title
        'field'     => 'cas',             # Casualties
        'length'    => 5,                 # Number of entries in box
        'show_team' => true,              # Show player's team name?
    ),
);

Event boxes

The event tables display player events. The events available are

dead        - recent dead players
sold        - recent sold players
hired       - recent hired players
skills      - recent player skill picks

Notice: Characteristic increases, or "stat increases", are not regarded as skills in OBBLM and are handled differently. This means it's not possible to get these displayed.

The local settings should otherwise be self-documented enough to understand the rest.

Fields available for standings and leaders tables

explainations will come soon.

Team standings

elo             ELO value -- NOTE: this field can only be used for tournament standings
swon            Largest Win streak -- NOTE: this field can only be used for tournament standings
sdraw           Largest Draw streak -- NOTE: this field can only be used for tournament standings
slost           Largest Loose streak -- NOTE: this field can only be used for tournament standings
pts             Points 
mvp             MVP
cp              CP
td              TD
intcpt          NT
bh              BH
ki              KI
si              SI
cas             CAS (player contributions only)
tdcas           Numeric value of "td+cas" fields
smp             Sportsmanship points
spp             SPP sum
ff              Fan Factor (total)
ff_bought       Fan factor bought
won             Won matches
lost            Lost matches
draw            Draw matches
played          Played matches
win_pct         Win percentages -- NOTE: this field can only be used for tournament standings
wt_cnt          Number of won tournaments
ga              Goals scores against team
gf              Goals scored by team
sdiff           Score/goal difference
tcasa           Total team CAS inflicted on team
tcasf           Total team CAS inflicted by team
tcdiff          Total team CAS difference
name            Team name
f_rname         Race name of team
f_cname         Coach name of team
tv              Team value
treasury        Treasury amount
apothecary      Has Apoth?
rerolls         Re-rolls
ass_coaches     Assistant coaches
cheerleaders    Cheerleaders
rdy             Is team marked ready by owning coach?
retired         Is team retired?
team_id         MySQL ID of team
owned_by_coach_id   MySQL ID of coach owning team
f_did           MySQL ID of division which the team is tied to
f_lid           MySQL ID of league which the team is tied to

Player standings (leaders)

mvp             MVP
cp              CP
td              TD
intcpt          INT
bh              Bh
ki              Ki
si              Si
cas             CAS
tdcas           Numeric value of "td+cas"
spp             SPP
won             Won matches
lost            Lost matches
draw            Draw matches
played          Played matches
win_pct         Win percentages -- NOTE: this field can only be used for tournament standings
ga              Goals scored against player's team
gf              Goals scored by player's team
sdiff           Goals scored difference
name            Player name
nr              Player number
date_bought     Date player was bought
date_sold       Date player was sold (if sold)
ma              MA
st              ST
ag              AG
av              AV
ach_ma          Achieved MA
ach_st          Achieved ST
ach_ag          Achieved AG
ach_av          Achieved AV
inj_ma          Injured MA
inj_st          Injured ST
inj_ag          Injured AG
inj_av          Injured AV
inj_ni          Injured Ni
extra_spp       Added extra SPP
extra_val       Added extra Value
f_tname         Name of owning team
f_rname         Name of race
f_cname         Name of owning coach
f_pos_name      Name of player position
value           Player Value
status          Player status
date_died       Date played dies (if dead)
player_id       MySQL ID of player
owned_by_team_id    MySQL ID of owning team


Add new races, teams, players, stars and modify general rulebook data

Before you proceed adding your own league's additions to OBBLM rulebook races, teams, players etc., you should note that removing these again might seriously damage the stats of those teams who used your customized/new races, teams players etc.

To change the rulebook data simply:

  1. Edit the lib/game_data_lrb6.php file to fit your needs.
  2. Run the Synchronise the PHP-stored BB game data from the DB maitenance group of OBBLM database operations, which are available in the admin menu OBBLM core panel.

Warming: If you decide to add your own race (which is perfectly fine), then make sure to use a race ID and position IDs (for the players) which are far above the current occupied. Otherwise you'll be in trouble when OBBLM in the futures includes new teams that overlap in race and position IDs! Use for examples race ID = 100.

Brettonians and Daemons of Khorne (Cyanide's)

To enable these races you do not need to manually edit the game data as stated above — files are also provided with these races.

Simply open the header.php file and change the line

require_once('lib/game_data_lrb6.php');

to (for Brettonians)

require_once('lib/game_data_brett.php');

or (for Daemons of Khorne — requires OBBLM version 0.95)

require_once('lib/game_data_cyanide.php');

..and then run through the second point from the above guide.

If you wish both races activated then use both of the above lines.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox