View Single Post
  #1  
Old 02-09-2016, 01:24 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 114,312
Abronsyth is on a distinguished road
Default Mys 1.3.4 Pet Lineages?

I understand, I think, the rough basics for how this would need to be done if I wanted to create lineages that could be displayed on a pets page...I know you'd need probably 2 new columns in the owned_adopts table, one for each parent. I know in the database the default could be set to "Unknown" so 1st gen pets simply have "unknown" parents...now my main issue that I don't know how to figure out is how to actually take the information, when two pets are bred, and record it in the database, and then display that information in a pedigree fashion on the pets page.

I imagine you'd need two new variables, such as $mother and $father...and then edit in class_breeding.php to insert the parental data into the database;
PHP Code:
$mysidia->db->insert("owned_adoptables", array("aid" => NULL"type" => $adopt->getType(), "name" => "Unnamed""owner" => $mysidia->user->username"currentlevel" => 0"totalclicks" => 0"code" => $code
                                                           
"imageurl" => NULL"usealternates" => $alts"tradestatus" => 'notfortrade'"isfrozen" => 'no'"gender" => $gender"offsprings" => 0"lastbred" => 0"originalowner" => $mysidia->user->username"birthday" => date("F jS, Y"), "mother" => $mother"father" => $father   )); 
Then of course you should be able to display the parents on the pet's page like so;
{$adopt->mother} or {$this->adopt->mother}, etc.

Now when defining the parent variables I want to include both the IDs of the parents, and the names. The ID is important because it can then be used to link to the parent's page (so then you can actually follow the family tree back to f0). So the database itself should store the parent's ID, not the name, and then we can just use the ID of the parent to find the name for the sake of displaying it.

So I think my main issue is actually recording the information of the parents. In the breeding files I see the variables $male and $female are used to determine the parents...which means that I can probably use this somehow, but I'm not sure how, because I don't see where the parent's data is summoned.

Now as for displaying an adoptable's offspring on it's profile...I have no idea. There's the getOffspring function, but does anyone know what that actually does?

I know this post is a big mess of my theories and rambling, but does anything think they could shed light on this a bit? In theory it really shouldn't be that difficult, I don't think.
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote