Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-30-2012, 07:27 AM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 15,053
draugluin is on a distinguished road
Default

Quote:
How can I make an item that switches the adoptable's gender?
its a very interesting question. I've tried a item, which makes an adoptable male, but

PHP Code:
function items_male($item$adopt){
  
// Update the gender info.
  
$GLOBALS['adopts']->update("owned_adoptables", array("gender" => 'm'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");    
  
$note "Its male now<br>";
  
//Update item quantity...
  
$delitem $item->removeitem(1$item->owner);  
  return 
$note;

does'nt work. I've copied it from "breed1" which changes the "lastbred to 0" modified to "gender = m"

where is the fault???
Reply With Quote
  #2  
Old 10-30-2012, 07:45 AM
Hedgen's Avatar
Hedgen Hedgen is offline
Member
 
Join Date: Oct 2012
Posts: 36
Gender: Male
Credits: 7,400
Hedgen is on a distinguished road
Default

Quote:
Originally Posted by draugluin View Post
its a very interesting question. I've tried a item, which makes an adoptable male, but

PHP Code:
function items_male($item$adopt){
  
// Update the gender info.
  
$GLOBALS['adopts']->update("owned_adoptables", array("gender" => 'm'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");    
  
$note "Its male now<br>";
  
//Update item quantity...
  
$delitem $item->removeitem(1$item->owner);  
  return 
$note;

does'nt work. I've copied it from "breed1" which changes the "lastbred to 0" modified to "gender = m"

where is the fault???
I'll look into it a little when I get to school, have to leave in 20 minutes and need to get Math done I was suppose to last night ^^'

Unless of course you figure it out first :)

Edit: I have been messing with the code a bit and I can't seem to get it to work :( Sorry
__________________
I have some small tutorials Here that show things such as re-arranging the SIDEFEED and LINKSBAR, and redirecting people after login.

Last edited by Hedgen; 10-30-2012 at 10:42 AM.
Reply With Quote
  #3  
Old 10-30-2012, 11:12 AM
draugluin's Avatar
draugluin draugluin is offline
Member
 
Join Date: Oct 2011
Location: germany
Posts: 120
Gender: Unknown/Other
Credits: 15,053
draugluin is on a distinguished road
Default

okay, I fixed it

this is the code for useful gender-swap

PHP Code:
function items_alts1($item$adopt){
  
// First lets check if alternative image exists for an adoptable at this level.
  
$lev $GLOBALS['adopts']->select("levels", array(), "adoptiename='{$adopt->type}' and thisislevel ='{$adopt->currentlevel}'")->fetchObject();
  if(
$lev->alternateimage == ""){
      
// The alternate image does not exist, cannot convert adoptable into its alternate form
    
$note "It appears that your adoptable could not swap its gender...<br>";
  }
  else{
      
// The alternate image exists, conversion between primary and alternate image is possible.
    
switch($adopt->usealternates){
      case 
"yes"
        
$GLOBALS['adopts']->update("owned_adoptables", array("usealternates" => 'no'"gender" => 'm'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");        
        
$note "{$adopt->name} is male.";
        break;
      default:
        
$GLOBALS['adopts']->update("owned_adoptables", array("usealternates" => 'yes'"gender" => 'f'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");       
        
$note "  {$adopt->name} is female";
    }
      
//Update item quantity...
      
$delitem $item->removeitem(1$item->owner);    
  }
  return 
$note;    

You only have to modify your text and have alternate images female.
I've the primary image for male and alternates for female.

much fun - I will have fun too - or better : my user
Reply With Quote
  #4  
Old 10-30-2012, 11:23 AM
Hedgen's Avatar
Hedgen Hedgen is offline
Member
 
Join Date: Oct 2012
Posts: 36
Gender: Male
Credits: 7,400
Hedgen is on a distinguished road
Default

Quote:
Originally Posted by draugluin View Post
okay, I fixed it

this is the code for useful gender-swap

PHP Code:
function items_alts1($item$adopt){
  
// First lets check if alternative image exists for an adoptable at this level.
  
$lev $GLOBALS['adopts']->select("levels", array(), "adoptiename='{$adopt->type}' and thisislevel ='{$adopt->currentlevel}'")->fetchObject();
  if(
$lev->alternateimage == ""){
      
// The alternate image does not exist, cannot convert adoptable into its alternate form
    
$note "It appears that your adoptable could not swap its gender...<br>";
  }
  else{
      
// The alternate image exists, conversion between primary and alternate image is possible.
    
switch($adopt->usealternates){
      case 
"yes"
        
$GLOBALS['adopts']->update("owned_adoptables", array("usealternates" => 'no'"gender" => 'm'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");        
        
$note "{$adopt->name} is male.";
        break;
      default:
        
$GLOBALS['adopts']->update("owned_adoptables", array("usealternates" => 'yes'"gender" => 'f'), "aid ='{$adopt->aid}' and owner='{$item->owner}'");       
        
$note "  {$adopt->name} is female";
    }
      
//Update item quantity...
      
$delitem $item->removeitem(1$item->owner);    
  }
  return 
$note;    

You only have to modify your text and have alternate images female.
I've the primary image for male and alternates for female.

much fun - I will have fun too - or better : my user
That actually gives me an idea (more work for the artist I find to do art for the site also XD)
basically male and female versions of my adoptables, and certain adoptables that have normal alt images I can just add a check in that code so that if used on certain characters it doesn't allow you to gender swap xD. (for characters that must be female, and/or characters that have alternate forms, like one of my adoptables will have an alt form of a chimera. )

Anyways, thanks for the code! I probably never would have been able to write that xD (well I probably would if I knew more PHP xD)
__________________
I have some small tutorials Here that show things such as re-arranging the SIDEFEED and LINKSBAR, and redirecting people after login.

Last edited by Hedgen; 10-30-2012 at 11:41 AM.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mys v1.3.3 Gender Ratio Mod for Mys v1.3.3 Hall of Famer Mys v1.3.x Mods 17 05-23-2019 03:34 PM
Gender superdude44 Questions and Supports 5 07-11-2013 01:17 AM
different images for gender MA 1.3.3 draugluin Questions and Supports 3 06-18-2013 01:30 AM
Mys v1.3.2 Gender Ratio Mod for Mys v1.3.2 Hall of Famer Mys v1.3.x Mods 6 01-08-2013 02:02 PM
Gender? [answered] Arianna Questions and Supports 4 11-19-2009 06:33 AM


All times are GMT -5. The time now is 04:22 PM.

Currently Active Users: 1057 (0 members and 1057 guests)
Threads: 4,081, Posts: 32,043, 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 - 2025, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636