How to remove gender from breeding?

Forum
Last Post
Threads / Messages

bisexuowl

x3 furry trash x3
Member
Joined
Sep 22, 2015
Messages
22
Points
0
Age
23
Location
California
Mysidian Dollar
3,169
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?
 
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:
$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:
$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:
$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:
if($mysidia->input->post("female") == "none" or $mysidia->input->post("male") == "none"){

to this:

PHP:
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.
 
thank you! i'll try this after i finish playing D&D with the family. :D

edit: it worked! thanks again
 
Last edited:
Just wanted to double check before i do this, but changing female and male to parent1 and parent2 is done on every live that says this in the breeding files? So every female will be parent1 and every male will be parent2?

from this:
$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);



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

Sorry for the silly question, im a beginner and want to make sure i do it right! <3
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,274
Messages
33,113
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top