Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   How to remove gender from breeding? (http://www.mysidiaadoptables.com/forum/showthread.php?t=5299)

bisexuowl 12-17-2016 01:34 AM

How to remove gender from breeding?
 
I want to make it so that my adoptables can breed regardless of their gender, as I plan to make gender a non-required field for pets that users can enter and keep track of strictly for role-playing purposes.

I've tried switching "female" to "parent1" and male to "parent2" in most places, and in places where the breeding checks for it being a male and female I've tried switching it to check "sex" which is only "omni", so both parents would be omnis anyway and it'd work out. However, it kept telling me "parent1" and "parent2" and told me there was an error in class_language.php, which is something I don't want to mess with ^^'

I'm a beginner in PHP so I was wondering if anyone could point me in the right direction?

Dinocanid 12-17-2016 10:01 AM

I believe the only files you'll have to edit would be breeding.php, breedingview.php, lang_breeding, and class_breeding.php. I doubt you'll ever have to edit class_language, for any script really. You were on the right track already, with changing female to parent1 and male to parent2. You may have been getting the error message because you forgot to edit lang_breeding, which you would need to change these two lines:
PHP Code:

$lang['female'] = "None of your female adoptables can breed at the time.<br>";
$lang['male'] = "None of your male adoptables can breed at the time.<br>"

to:

PHP Code:

$lang['parent1'] = "None of your female adoptables can breed at the time.<br>";
$lang['parent2'] = "None of your male adoptables can breed at the time.<br>"

In order for the dropdown on the breeding page to not be restricted on only male adopts and female adopts, you would change the last few lines of breeding.php like so:

PHP Code:

$stmt $mysidia->db->select("owned_adoptables", array("name""aid"), "owner = '{$mysidia->user->username}' AND currentlevel >= {$settings->level} AND lastbred <= '{$lasttime}'");
        
$female = ($stmt->rowcount() == 0)?new Null:$mysidia->db->fetchMap($stmt);
        
$this->setField("parent1Map"$parent1);
  
        
$stmt $mysidia->db->select("owned_adoptables", array("name""aid"), "owner = '{$mysidia->user->username}' AND currentlevel >= {$settings->level} AND lastbred <= '{$lasttime}'");
        
$male = ($stmt->rowcount() == 0)?new Null:$mysidia->db->fetchMap($stmt);
        
$this->setField("parent1Map"$parent1); 

You also wouldn't want users to be able to breed by choosing the same adopt in both dropdowns (I assume), so you would change this line in breeding.php:

PHP Code:

if($mysidia->input->post("female") == "none" or $mysidia->input->post("male") == "none"){ 

to this:

PHP Code:

if($mysidia->input->post("female") == "none" or $mysidia->input->post("male") == "none" or $mysidia->input->post("female") == $mysidia->input->post("male")){ 

This is just off the top of my head and I haven't tested it, but it should point you in the right direction. I also haven't properly changed every line that includes "female" and "male" to "parent1" and "parent2", so you'll have to do that on your own.

bisexuowl 12-17-2016 01:59 PM

thank you! i'll try this after i finish playing D&D with the family. :D

edit: it worked! thanks again


All times are GMT -5. The time now is 01:44 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.