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)
-   -   Problem with Adding Dimorphism? (http://www.mysidiaadoptables.com/forum/showthread.php?t=4001)

Infernette 02-09-2013 05:11 PM

Problem with Adding Dimorphism?
 
Okay, I got it to work with alternates only showing with a specified gender, but for some reason it's making the type "NULL" in the mysql database, causing the adopt not to show up in the person's myadopts. So yeah... this is the edited part:

Code:

$petgender = $genders[$rand];
                switch($petgender){
                          case "m":
                          $alts = "yes";
                          break;
                          default:
                          $alts = "no";
                        }                       

        $mysidia->user->changecash(-$row->cost);
                $mysidia->page->settitle("{$name} adopted successfully");
                $mysidia->db->insert("owned_adoptables", array("aid" => NULL, "type" => $row->type, "name" => $name, "owner" => $mysidia->user->username, "currentlevel" => 0, "totalclicks" => 0, "code" => $code,
                                                                    "imageurl" => NULL, "usealternates" => $alts, "tradestatus" => 'fortrade', "isfrozen" => 'no', "gender" => $genders[$rand], "lastbred" => 0));

What am I doing wrong? I knew it was too good to be true to work the first time around :p

Hall of Famer 02-09-2013 05:54 PM

the property $row->type does not exist, which will be holding a default Null value if you attempt to use it. You need to define what the adoptables type is, and replace $row->type by the appropriate variable name.

Infernette 02-09-2013 06:14 PM

Oh. Derp. That fixed it, thanks xD Should of realized that :p

Also is it possible to remove showing gender from a level until you level it up?

Hall of Famer 02-10-2013 12:03 PM

Yeah, its possible, the issue is how complicated you want it to be. If all you need is to show the gender after a global level set for all adoptables, it can be done in a few secs. If you want this to be species-specific, it can take much longer as you need to create a new field in table prefix_adoptables to store this level for each adoptable.

Infernette 02-10-2013 12:41 PM

It would be global, so it's good to know it can be easily done :)

But um... Where do I place the code; sorry once again.

SilverDragonTears 02-13-2013 07:32 AM

Anywhere where you show the gender. Something like

if level == '#'{
echo a blank or something
}else{
show the gender
}

Infernette 02-13-2013 04:55 PM

Okay, I edited the script you posted Silver to work with my current version and it works just fine. Thanks :)


All times are GMT -5. The time now is 02:48 AM.

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