Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Suggestions and Feature Requests (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=21)
-   -   Alternate Images for Genders (http://www.mysidiaadoptables.com/forum/showthread.php?t=2296)

Con 08-13-2011 07:08 AM

Alternate Images for Genders
 
Instead of the alternates being set by a random factor, being set by the gender of the pet.

I'm new so please don't kick me for something that already exists.

Hall of Famer 08-20-2011 04:30 PM

I am sorry that I havent gotten back to you regarding your request yet. And yes, this is definitely doable. You will need to manually edit the line that generates alternative forms of adoptables. I can show you an example of how to do that later if I have time.

Con 08-23-2011 04:56 AM

That would be awesome thanks :)

Hall of Famer 08-24-2011 01:57 AM

Here is a possible way to have alternates set by gender:

Find these lines in doadopt.php:

PHP Code:

                        $alts getaltstatus($id00);

                        
// We need a unique code for the adoptable so we can show it to the user when we're done here...

                        
$code rand(120000);
                        
$genders = array('f''m');
                        
$rand rand(0,1);
                        
                        
runquery("INSERT INTO {$prefix}owned_adoptables VALUES ('', '{$row['type']}', '$name','$loggedinname','0','0', '$code', '','$alts','fortrade','no', '$genders[$rand]','0')");

                        
// Adoption complete, show the user a confirmation screen... 

Replace with something like this(the code may be different depending on the structure of your table prefix_owned_adoptables):

PHP Code:

                        // We need a unique code for the adoptable so we can show it to the user when we're done here...

                        
$code rand(120000);
                        
$genders = array('f''m');
                        
$rand rand(0,1);
                        
$petgender $genders[$rand];
                        switch(
$petgender){
                          case 
"m"
                          
$alts "yes";
                          break;
                          default: 
                          
$alts "no";
                        }                        

                        
runquery("INSERT INTO {$prefix}owned_adoptables  VALUES ('', '{$row['type']}', '$name','$loggedinname','0','0', '$code',  '','$alts','fortrade','no', '$petgender','0')");

                        
// Adoption complete, show the user a confirmation screen... 

This will set female sprite to be primary and male sprite to be alternate. Lemme know if this code wont work for you, and take a screenshot of your prefix_owned_adoptables so I can assist you further.

SilverDragonTears 08-24-2011 01:25 PM

So if it's male it will show the male image and female vice versa?

Hall of Famer 08-24-2011 01:41 PM

Yes, it should. It will generate a pet gender first and then decide which image to use based on whether its male or female. In my script above the female image is primary, while male image is alternate.

SilverDragonTears 08-24-2011 01:48 PM

ooo very nice! I'm going to try this out today!

SilverDragonTears 08-24-2011 02:46 PM

do i delete

Code:

$alts = getaltstatus($id, 0, 0);
I'm guessing no b/c it worked =) Cool! I switched it to "f" instead of "m" though so my male image will be primary. Very cool!

Hall of Famer 08-24-2011 09:15 PM

Well its better to delete that line since it wont do anything after you've changed the method alternate form of adoptables is defined.

SilverDragonTears 08-24-2011 09:50 PM

Oh ok I'll delete it then! I'm loving this so much I'm going back and making male and female images of all of the adopts. Sucks though that the ones already adopted won't have that feature implemented with them though.


All times are GMT -5. The time now is 01:57 AM.

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