Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Suggestions and Feature Requests

Notices

Reply
 
Thread Tools Display Modes
  #21  
Old 11-01-2012, 01:38 PM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 10,747
draugluin is on a distinguished road
Default

@ HoF

aaaaah, that's it. I've got it. Cool... thank you
Reply With Quote
  #22  
Old 06-03-2013, 03:46 AM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 10,747
draugluin is on a distinguished road
Default

Is it possible, to write this function for Mys 1.3.3 ?
This would be very, very nice :)

I think, I have to study this new (cyrillic ) version

Thanks a lot

Last edited by draugluin; 06-18-2013 at 03:29 AM.
Reply With Quote
  #23  
Old 11-11-2014, 05:45 PM
AndromedaKerova's Avatar
AndromedaKerova AndromedaKerova is offline
ChibiFur Queen
 
Join Date: Nov 2014
Location: England
Posts: 83
Gender: Female
Credits: 3,685
AndromedaKerova is on a distinguished road
Default

Is this modification compatible with 1.3.4?
__________________
Failing at being normal since 1990.
Reply With Quote
  #24  
Old 11-12-2014, 10:23 PM
AndromedaKerova's Avatar
AndromedaKerova AndromedaKerova is offline
ChibiFur Queen
 
Join Date: Nov 2014
Location: England
Posts: 83
Gender: Female
Credits: 3,685
AndromedaKerova is on a distinguished road
Default

I had a go at this but there seems to be no doadopt.php in 1.3.4.

I found something similar to the code inside classes/class_adoptable.php

PHP Code:
    public function getGender(){
        
$genders = array('f''m');
        
$rand rand(0,1);
        return 
$genders[$rand];
    } 
But there was no:
// Adoption complete, show the user a confirmation screen...

I kept looking and finally found something close to that line in view/adoptview.php

I'm not sure if the code should go here or in class_adoptable.
__________________
Failing at being normal since 1990.
Reply With Quote
  #25  
Old 11-23-2014, 02:21 PM
AndromedaKerova's Avatar
AndromedaKerova AndromedaKerova is offline
ChibiFur Queen
 
Join Date: Nov 2014
Location: England
Posts: 83
Gender: Female
Credits: 3,685
AndromedaKerova is on a distinguished road
Default

Ok, I've given up after over a week of failing. If someone could get this working for 1.3.4, that would be awesome.
__________________
Failing at being normal since 1990.
Reply With Quote
  #26  
Old 12-07-2014, 09:43 PM
Kyttias's Avatar
Kyttias Kyttias is offline
Premium Member
 
Join Date: Jan 2014
Posts: 857
Gender: Unknown/Other
Credits: 86,978
Kyttias is on a distinguished road
Default

Well looking for $genders = array('f', 'm'); was definitely key, still! It's also in classes/class_promocode.php and classes/class_stockadopt.php, of course, for adoptables acquired through promo codes and shops. Take note, where you found it in classes/class_adoptables.php has it inside a function. This function is being run in adopt.php - and this is where we'll have to implement the changes for this particular type of acquiring a pet (from the /adopts page, where available pets are shown).

So let's get started!

Alternate Gender Mod for Mysidia v1.3.4
We're going to opening up adopt.php first. Inside the index function, after $gender = $adopt->getGender(); add:
PHP Code:
switch($gender){
                case 
"m"
                    
$alts "yes";
                    break;
                default: 
                    
$alts "no";
            } 
That's all you need to do here, since it's using the function in classes/class_adoptables.php. However, these next two pages don't, so they'll require an extra couple steps.

Now in classes/class_stockadopt.php, inside function append($owner = ""), find $rand = rand(0,1), and afterward add in -
PHP Code:
$petgender $genders[$rand];
    switch(
$petgender){
                case 
"m"
                  
$alts "yes";
                    break;
                default: 
                    
$alts "no";
            } 
Immediately after this is where the data is being entered into the database. Find inside this $mysidia->db->insert query "gender" => $genders[$rand] and change it to:
PHP Code:
"gender" => $petgender 
Of course, make sure there is still a comma after it. Wouldn't want any errors, would we? ^^;

Now go do exactly the same thing you just did above inside classes/class_promocode.php as well! This time you can find the $rand to add code after inside function execute().

All done.

But please pay attention to two details, as seen here when creating an adoptable:


Changing this number will not change the gender ratio, as the gender is determined at birth with a random generator. There is no 'chance' of alternates happening now, they will only happen based on gender at the pet's creation.

If you make a gender changing potion, this will not change the pet's image. So if you plan on making a function for such an item, remember to change the alt image, not just the gender marker. Check out this mod for further instructions.

Keep in mind that this gender alternate image mod cannot affect the EGG or LEVEL 0 image. My pets do not hatch from eggs, so I must keep this in mind and supply a neutral, gender-less image for tiny baby pets, that will last at least until their first click/visit.

Lastly, the code is currently set for the "default" gender to be female. So, if female, use the base image. If male, use the alternate image. If you want this to be the other way around, change case "m": to case "f": in all three switch statements. This is universal for all pets!

ALSO!!!! Hey HoF/IntoRain, if you stop by this thread -- what would have to be done to make these changes go through immediately at egg/0 level?
__________________
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; 12-09-2014 at 11:38 PM.
Reply With Quote
  #27  
Old 12-08-2014, 07:23 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 327,522
Hall of Famer is on a distinguished road
Default

Oh so Kyttias is giving a try on this idea, sounds intriguing. ^^ I replied to your message on AIM, it will be easy and possible to edit the alternate image system so it will start to work at lv.0. I think there is a method in class Adoptable that generates an owned adoptable's primary or alternate form, you can try applying this method when an owned adoptable is adopted at the first place, rather than when it hits lv.1.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Genders/More Alternate Images Clessidra Suggestions and Feature Requests 3 02-27-2014 10:42 AM
Multi Alternate Images Taintedkitten Questions and Supports 3 01-10-2013 07:44 PM
Adoptable genders Silvercivet Questions and Supports 2 02-12-2012 10:35 AM
How do I completely disable/delete Breeding and genders? D.A.T.A. Questions and Supports 5 08-29-2011 01:34 AM
Alternate images, how do they work? Shikari Questions and Supports 4 08-06-2011 08:17 PM


All times are GMT -5. The time now is 03:26 PM.

Currently Active Users: 454 (0 members and 454 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636