Page 1 of 1

OBBLM team tiering?

Posted: Thu Jul 14, 2016 1:49 pm
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;
}
}"

Re: OBBLM team tiering?

Posted: Thu Jul 14, 2016 2:10 pm
by howlinggriffon
Would it be easier to manually boost their treasury when they create their teams using the admin option?

Posted: Thu Jul 14, 2016 6:00 pm
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.

Re:

Posted: Thu Jul 14, 2016 11:49 pm
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.

Re: OBBLM team tiering?

Posted: Fri Jul 15, 2016 11:14 am
by Vanguard
I'm doing some OBBLM fiddling today - if I can see a quick fix, I'll put something together.

Re: OBBLM team tiering?

Posted: Fri Jul 15, 2016 2:37 pm
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.

Re: OBBLM team tiering?

Posted: Fri Jul 15, 2016 2:43 pm
by J_Bone
I am wondering if there is something I can insert into lib/game_data.php to sort it...

Re: OBBLM team tiering?

Posted: Fri Jul 15, 2016 4:00 pm
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;
}

Posted: Fri Jul 15, 2016 4:40 pm
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)

Re: OBBLM team tiering?

Posted: Sat Jul 16, 2016 11:34 am
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.