#11
|
||||
|
||||
Okay, I sort of figured as much but when you said in the database that I was concerned, haha.
So I'm looking in owned_adoptables, but it seems that the Offsprings column is recording the number of offspring each adopt has produced, but not the actual IDs of the offspring...I'm not sure if this is the normal behavior, or how to alter it. I assume I could change something in class_breeding.php (maybe) to update that column each time a cat is bred to include the new offspring IDs, but I'm not sure how to make it then so that the new IDs are added as a list, and not replacing the data already there.
__________________
My Mods Site (1.3.4, 2020 Mods) |
#12
|
||||
|
||||
Hmmm!!! I might have changed something significant for my own site, haha... hang on.
Alright, I don't know what the default $offsprings field is actually used for. I re-purposed it. Since I don't feel comfortable asking you to do the same in case it breaks an Mysidia feature you're using but I'm not, we're going to make some tweaks. First, let's create a new column in adopts_owned_adoptables called descendants. We're going to have it be varchar 500, but even that may not be big enough if your site gets too large. Second, let's first go back to the code we were working on before. Instead of looking for the column offsprings, we'll change it to look for descendants. PHP Code:
In breeding.php find: PHP Code:
PHP Code:
Get back to me with the results? ...the long and the short of it is, I made this exact feature for myself six months ago but kind of just built it in while I was working on my new breeding system and never finished actually making the whole family tree visual part. x'D I was more than happy to help because I knew I was mostly done with mine and it was the push I needed to finish. Here's mine:
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 02-12-2016 at 11:53 PM. |
#13
|
||||
|
||||
OK, now the only issue I am encountering is for some reason it added +1 to the ID of the offspring (which causes it to not work). So the offspring ID should be 25422, but it's showing 25423 on the parent's page.
When I manually changed it in the database to the correct ID, it works perfectly, though! So that's a plus!
__________________
My Mods Site (1.3.4, 2020 Mods) |
#14
|
||||
|
||||
When your babies are born, you get to see them, right? It should be storing the IDs of the ones seen. Try combining for the foreach loops. (I have mine combined.)
Put $newbabies = array(); before the existing foreach loop above the mod. Add $newbabies[] = $offspringID; to the inside of the old foreach loop. Go ahead and delete the loop inside my mod (and $newbabies = array(); before it, of course). Basically, this function was already build a list of image links to your babies from their ID numbers. All I'm doing is taking the same list of IDs and putting them in the database. They should not be different! The pets seen at birth should be the same ones seen in their family tree.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 02-13-2016 at 02:57 PM. |
#15
|
||||
|
||||
OK, so I bred two pets and these are the offspring IDs;
25753, 25754, 25756 But this is what is in the descendants column; 25756,25757,25758, breeding.php; PHP Code:
__________________
My Mods Site (1.3.4, 2020 Mods) |
#16
|
||||
|
||||
Yes, that appears to be counting the next three exactly... yeah, just combine the foreach loops like I said in my last post. Here, I made the edit:
PHP Code:
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
#17
|
||||
|
||||
Okay, excellent, it seems to be fully functioning now!
Aaand one of my users just presented to me an error that occurs with direct inbreeding. If the parents of a pet are siblings, then the grandparents only show for the mother, and for the father it says both grandparents are Unknown. I have no idea why this is..? (Maybe the script is opposed to inbreeding, haha)
__________________
My Mods Site (1.3.4, 2020 Mods) |
#18
|
||||
|
||||
Hmmm... make sure all the numbers line up in the database? Can I see the kitties involved?
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
#19
|
||||
|
||||
Here's one of the cats whose parents are siblings (from the same litter):
http://catisserie.net/levelup/click/25715 It would seem that it did not add the grandparent B information in the database, only A.
__________________
My Mods Site (1.3.4, 2020 Mods) |
#20
|
||||
|
||||
*o* I might try to cop this if you guys don't mind... lol
|
|
|
What's New? |
What's Hot? |
What's Popular? |