OBBLM team tiering?

Be it FUMBBL, PBeM, the Cyanide Computer Game, VASSAL or whatever - talk about online play here.

This is also the place for discussing the various tools for managing leagues, teams and so on.

Moderator: TFF Mods

Post Reply
User avatar
J_Bone
Super Star
Super Star
Posts: 926
Joined: Sun Feb 23, 2014 5:40 pm
Location: Derby, UK

OBBLM team tiering?

Post by J_Bone »

I am looking to add a little incentive for players in the DBBL to take certain lower tier teams.

I plan on simply adding a little boost to the treasury. Now, I think I have found a bit of code in the OBBLM system that will allow me to do this.

Has anybody else done this? The piece of code I think I need to alter is below.

"public function dtreasury($delta) {

/**
* Add a delta to team's treasury.
**/

$query = "UPDATE teams SET treasury = treasury + $delta WHERE team_id = $this->team_id";
if (mysql_query($query)) {
$this->treasury += $delta;
return true;
}
else {
return false;
}
}"

Reason: ''
The brains behind the Double Skulls Podcast http://doubleskulls.libsyn.com/

Beardman.
User avatar
howlinggriffon
Ex-Mega Star, now just a Super Star
Ex-Mega Star, now just a Super Star
Posts: 1455
Joined: Wed Dec 03, 2003 7:25 pm
Location: Chelmsford, Essex (UK)

Re: OBBLM team tiering?

Post by howlinggriffon »

Would it be easier to manually boost their treasury when they create their teams using the admin option?
You do not have the required permissions to view the files attached to this post.

Reason: ''
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Post by Shteve0 »

J_Bone, that code is an sql query that handles routine adjustment of an existing team's treasury - either as howlonggriffon has already screenshot, or in the match result report, or [potentially] both. I'd advise against tweaking it, personally!

If you want to manually alter a team's treasury, you can do that using the admin tools in the team's screen, as Hg said.

Another option maybe, you could change the starting treasury of teams to be dependent on their race id number? It'd mean adding an if statement in the team creation process.

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
User avatar
J_Bone
Super Star
Super Star
Posts: 926
Joined: Sun Feb 23, 2014 5:40 pm
Location: Derby, UK

Re:

Post by J_Bone »

Shteve0 wrote:J_Bone, that code is an sql query that handles routine adjustment of an existing team's treasury - either as howlonggriffon has already screenshot, or in the match result report, or [potentially] both. I'd advise against tweaking it, personally!

If you want to manually alter a team's treasury, you can do that using the admin tools in the team's screen, as Hg said.

Another option maybe, you could change the starting treasury of teams to be dependent on their race id number? It'd mean adding an if statement in the team creation process.
Yes, I realised that shortly after posting. I would rather set up a statement related to the race ID number but am not sure how to go about it.

I have to spent a fair amount of time herding the teams in the DBBL anyway so anything that would stop me having to ask people to set up a team so I can then add a treasury boost to it would be great. I know somebody would get confused / be a pain in my arse.

Reason: ''
The brains behind the Double Skulls Podcast http://doubleskulls.libsyn.com/

Beardman.
User avatar
Vanguard
Super Star
Super Star
Posts: 922
Joined: Sun Jun 08, 2008 8:27 am
Location: Glasgow
Contact:

Re: OBBLM team tiering?

Post by Vanguard »

I'm doing some OBBLM fiddling today - if I can see a quick fix, I'll put something together.

Reason: ''
User avatar
J_Bone
Super Star
Super Star
Posts: 926
Joined: Sun Feb 23, 2014 5:40 pm
Location: Derby, UK

Re: OBBLM team tiering?

Post by J_Bone »

Vanguard wrote:I'm doing some OBBLM fiddling today - if I can see a quick fix, I'll put something together.
Brilliant. Thanks mate. I've got the page all set up for next season so this is the very last piece of the puzzle. It's be great if you could help me out with it.

Reason: ''
The brains behind the Double Skulls Podcast http://doubleskulls.libsyn.com/

Beardman.
User avatar
J_Bone
Super Star
Super Star
Posts: 926
Joined: Sun Feb 23, 2014 5:40 pm
Location: Derby, UK

Re: OBBLM team tiering?

Post by J_Bone »

I am wondering if there is something I can insert into lib/game_data.php to sort it...

Reason: ''
The brains behind the Double Skulls Podcast http://doubleskulls.libsyn.com/

Beardman.
User avatar
J_Bone
Super Star
Super Star
Posts: 926
Joined: Sun Feb 23, 2014 5:40 pm
Location: Derby, UK

Re: OBBLM team tiering?

Post by J_Bone »

Essentially, I know the IF function for my tiers should look SOMETHING like this...

I'm just not sure how to integrate this kind of thing into the OBBLM site.

if (race_id=T_RACE_GOBLIN,T_RACE_HALFLING,T_RACE_OGRE) {
treasury = 1150000;
} else if (race_id==T_RACE_CHAOS_PACT,T_RACE_NURGLE,T_RACE_SLANN,T_RACE_UNDERWORLD,T_RACE_VAMPIRE) {
treasury = 1100000;
} else if (race_id=T_RACE_BRETONNIA,T_RACE_CHAOS,T_RACE_ELF,T_RACE_HIGH_ELF,T_RACE_HUMAN,T_RACE_KHEMRI,T_RACE_DKHORNE,T_RACE_LIZARDMAN,T_RACE_NECROMANTIC,T_RACE_NORSE) {
treasury = 1050000;
} else {
treasury = 1000000;
}

Reason: ''
The brains behind the Double Skulls Podcast http://doubleskulls.libsyn.com/

Beardman.
User avatar
Shteve0
Legend
Legend
Posts: 2479
Joined: Thu May 07, 2009 10:15 am
Location: Wellington, New Zealand

Post by Shteve0 »

I'm on vacation right now and miles away from a PC. If Vanguard can't sort you out I'll take a look (though I'd rate his php skills above mine)

Reason: ''
League and tournament hosting, blogging and individual forums - all totally free. For the most immersive tabletop sports community experience around, check out theendzone.co
User avatar
J_Bone
Super Star
Super Star
Posts: 926
Joined: Sun Feb 23, 2014 5:40 pm
Location: Derby, UK

Re: OBBLM team tiering?

Post by J_Bone »

I have spoken to William at OBBLM and he said the following:

"The game_data.php file does not control the treasury as it is not a race specific item. Also this file isn't read on every load. I believe it is used to build a table in the database.

https://github.com/TheNAF/naflm/blob/ma ... s_team.php has a create function that could be modified to do what you need. The treasury might be in the $input array there. You could try a switch statement there with each team that you want to do a check on and modify the $input['treasury'] right there. You might also find where the create method is called and then afterwards use the Team:dtreasury() method. Not sure if an object will be in that area of the code to make it easy or not.

It isn't something I will go into much further. It would take a bit of time to do and test, but as I said, the naflm project on GitHub has been making a lot of changes and probably would add in this request."

I have put in a request for the updated version of OBBLM but will have a look into class_team to see if I can find the function he mentioned.

Reason: ''
The brains behind the Double Skulls Podcast http://doubleskulls.libsyn.com/

Beardman.
Post Reply