Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Addons and Modifications > Mys v1.3.x Mods

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2017, 07:34 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 78,314
Dinocanid is on a distinguished road
Default Multiple Alternate Images

(Warning: Under construction! It should work as is, but I have yet to cover the ACP portion)

Multiple Alternate Images Mod for v1.3.4
Description: I stumbled upon this today and decided to share it. It's how I turned my spaniel flan into a berry flan:
  Spoiler: Screenshot 

This works just fine with the Alternate Gender Image mod, though I don't cover how to make an alternate for each gender here.

-Step 1-
Go into phpMyAdmin and create a new column in owned_adoptables:
Quote:
name = userarealternates
type = VARCHAR
length/values = 10
default = NULL
collation = latin1_swedish_ci
check the null box
Now go to levels and create a new column:
Quote:
name = rarealternateimage
type = VARCHAR
length/values = 120
default = NULL
collation = latin1_swedish_ci
check the null box
Finally, go into adoptables and create a new column:
Quote:
name = rarealts
type = VARCHAR
length/values = 10
default = NULL
collation = latin1_swedish_ci
check the null box
-Step 2-
Go into class_adoptable.php and add this:
PHP Code:
protected $rarealts;

public function 
hasRareAlternates(){
        return 
$this->rarealts;
    } 
Now go into class_adoptlevel.php:
PHP Code:
protected $rarealternateimage;

public function 
getRareAlternateImage($fetchMode ""){
        if(
$fetchMode == Model::GUI) return new Image($this->rarealternateimage);
        return 
$this->rarealternateimage;
    } 
Now class_ownedadoptable...
PHP Code:
protected $userarealternates;

public function 
useRareAlternates(){
        return 
$this->userarealternates;
    }

public function 
getRareAltStatus(){
        if(
$this->rarealts == "enabled" and $this->currentlevel == $this->altoutlevel){
            
$rand mt_rand(1$this->altchance);
            if(
$rand == 1) return "yes";            
        }
        return 
"no";
    }

public function 
getRareAltImage($fetchMode ""){
        if(
$this->imageurl) return $this->getImageUrl($fetchMode);
        if(
$this->currentlevel == 0) return $this->getEggImage($fetchMode);
        
        
$mysidia Registry::get("mysidia");        
        
$level $this->getCurrentLevel("model");
         return 
$level->getRareAlternateImage($fetchMode);            
    } 
Replace public function getImage with this:
PHP Code:
public function getImage($fetchMode ""){
        if(
$this->imageurl) return $this->getImageUrl($fetchMode);
        if(
$this->currentlevel == 0) return $this->getEggImage($fetchMode);
        
        
$mysidia Registry::get("mysidia");        
        
$level $this->getCurrentLevel("model");
        
$type $this->getType();
        if(
$this->useAlternates() == "yes") return $level->getAlternateImage($fetchMode);
        elseif(
$this->useRareAlternates() == "yes") return $level->getRareAlternateImage($fetchMode);
        else return 
$level->getPrimaryImage($fetchMode);            
    } 
-Step 3-
ACP stuff goes here momentarily...

-Notes-
Now it should work if you fill in the rare alternate image value in phpMyAdmin. This method can be used however many times you want depending on how many alternate images you want. (For me I have the gender images, rare image, and gold image)
__________________

Last edited by Dinocanid; 06-11-2017 at 07:43 PM.
Reply With Quote
  #2  
Old 02-27-2018, 04:23 AM
goofyunicorn's Avatar
goofyunicorn goofyunicorn is offline
Kelpie
 
Join Date: Feb 2018
Location: Unicorn Land
Posts: 101
Gender: Female
Credits: 15,622
goofyunicorn is on a distinguished road
Default

Quote:
Originally Posted by Dinocanid View Post
(Warning: Under construction! It should work as is, but I have yet to cover the ACP portion)

Multiple Alternate Images Mod for v1.3.4
Description: I stumbled upon this today and decided to share it. It's how I turned my spaniel flan into a berry flan:
  Spoiler: Screenshot 

This works just fine with the Alternate Gender Image mod, though I don't cover how to make an alternate for each gender here.

-Step 1-
Go into phpMyAdmin and create a new column in owned_adoptables:


Now go to levels and create a new column:


Finally, go into adoptables and create a new column:


-Step 2-
Go into class_adoptable.php and add this:
PHP Code:
protected $rarealts;

public function 
hasRareAlternates(){
        return 
$this->rarealts;
    } 
Now go into class_adoptlevel.php:
PHP Code:
protected $rarealternateimage;

public function 
getRareAlternateImage($fetchMode ""){
        if(
$fetchMode == Model::GUI) return new Image($this->rarealternateimage);
        return 
$this->rarealternateimage;
    } 
Now class_ownedadoptable...
PHP Code:
protected $userarealternates;

public function 
useRareAlternates(){
        return 
$this->userarealternates;
    }

public function 
getRareAltStatus(){
        if(
$this->rarealts == "enabled" and $this->currentlevel == $this->altoutlevel){
            
$rand mt_rand(1$this->altchance);
            if(
$rand == 1) return "yes";            
        }
        return 
"no";
    }

public function 
getRareAltImage($fetchMode ""){
        if(
$this->imageurl) return $this->getImageUrl($fetchMode);
        if(
$this->currentlevel == 0) return $this->getEggImage($fetchMode);
        
        
$mysidia Registry::get("mysidia");        
        
$level $this->getCurrentLevel("model");
         return 
$level->getRareAlternateImage($fetchMode);            
    } 
Replace public function getImage with this:
PHP Code:
public function getImage($fetchMode ""){
        if(
$this->imageurl) return $this->getImageUrl($fetchMode);
        if(
$this->currentlevel == 0) return $this->getEggImage($fetchMode);
        
        
$mysidia Registry::get("mysidia");        
        
$level $this->getCurrentLevel("model");
        
$type $this->getType();
        if(
$this->useAlternates() == "yes") return $level->getAlternateImage($fetchMode);
        elseif(
$this->useRareAlternates() == "yes") return $level->getRareAlternateImage($fetchMode);
        else return 
$level->getPrimaryImage($fetchMode);            
    } 
-Step 3-
ACP stuff goes here momentarily...

-Notes-
Now it should work if you fill in the rare alternate image value in phpMyAdmin. This method can be used however many times you want depending on how many alternate images you want. (For me I have the gender images, rare image, and gold image)

Did you work an ACP version? :)
Reply With Quote
  #3  
Old 02-27-2018, 05:44 AM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 78,314
Dinocanid is on a distinguished road
Default

Actually I forgot about it ^^; I can though.
__________________
Reply With Quote
  #4  
Old 02-27-2018, 06:21 AM
goofyunicorn's Avatar
goofyunicorn goofyunicorn is offline
Kelpie
 
Join Date: Feb 2018
Location: Unicorn Land
Posts: 101
Gender: Female
Credits: 15,622
goofyunicorn is on a distinguished road
Default

Quote:
Originally Posted by Dinocanid View Post
Actually I forgot about it ^^; I can though.

That would be great :D
Reply With Quote
  #5  
Old 02-27-2018, 06:46 PM
Pear's Avatar
Pear Pear is offline
Woah man.
 
Join Date: Dec 2013
Location: The Underworld
Posts: 169
Gender: Female
Credits: 48,114
Pear is on a distinguished road
Default

!!! How in the world have I missed this??? :o Makes me wanna start working on my adopt site again x'D

Just to make sure, this mod means that you could have like... a baby, which grows into 1 of x# variations, which can grow into x# variations? :D (Kinda like Chickensmoothie)
__________________
Noot noot! Gotta get a new signooture. >->
Reply With Quote
  #6  
Old 02-27-2018, 07:17 PM
Dinocanid's Avatar
Dinocanid Dinocanid is offline
Member
 
Join Date: Aug 2016
Location: Maryland, USA
Posts: 516
Gender: Unknown/Other
Credits: 78,314
Dinocanid is on a distinguished road
Default

Quote:
Originally Posted by Pear View Post
!!! How in the world have I missed this??? :o Makes me wanna start working on my adopt site again x'D

Just to make sure, this mod means that you could have like... a baby, which grows into 1 of x# variations, which can grow into x# variations? :D (Kinda like Chickensmoothie)
It works the same way the current alternative images do; so if a pets gets, say, a rare rainbow variant, then it will keep that throughout all of it's levels (if that's what you mean).

If you were referring to having the variations change as the pet grows (a normal pet becoming a rainbow pet randomly), then that's something I would have to work on as an addon for this.
__________________
Reply With Quote
  #7  
Old 02-28-2018, 11:52 PM
Pear's Avatar
Pear Pear is offline
Woah man.
 
Join Date: Dec 2013
Location: The Underworld
Posts: 169
Gender: Female
Credits: 48,114
Pear is on a distinguished road
Default

Okay cool! :D Yeah, that first explanation is pretty much what I mean :D
__________________
Noot noot! Gotta get a new signooture. >->
Reply With Quote
Reply


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


All times are GMT -5. The time now is 07:33 PM.

Currently Active Users: 930 (0 members and 930 guests)
Threads: 4,081, Posts: 32,029, 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