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
  #11  
Old 09-29-2014, 06:42 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,039
kristhasirah
Default

the code will change your adopt to other type: like for example, you change where it say "moonlight fairy dragon" for one of your type of adopt, lets say a cat, so you now have a item that transforms any adopt in a cat, unless you have limited the types in the item creation, then only the selected adopts can be changed in a cat

but it can be used in the way you say, probably you need to change this:
array("type" => 'Moonlight Fairy Dragon')... maybe change it for array("imageurl"=> 'the image url of the adopt') or something like that, im not sure, havent tried that way...in theory it will only change the image of your adopt and you wont need to create X amount of adopt just to change the color of 1 adopt... but theres also the alt item, wich changes your adopt in his/her alt version, unless you are not adding the alternate image for your adopts.
but i have no idea how to code it or edit it so you can only add the function once... right now you need to copy and paste as many time you want for each adopt you want to change in to another type or color and you will end whit a very large item_functions file, unless you dont mind that.

sorry if i dont make sense >_>
__________________
Reply With Quote
  #12  
Old 09-30-2014, 01:54 AM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,086
parayna is on a distinguished road
Default

Oh, no, you do make sense. So in the item functions file, for every, say, 'skin', you would need to create a new item function? Seems a complicated way of doing things, but I have been waiting for something like this to come out for years! (Ever since I first found the script XD) I might mess about with it on my test site later. Just make a few adoptables and that item then mess around with them :P
Reply With Quote
  #13  
Old 09-30-2014, 09:55 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,039
kristhasirah
Default

decided to go and test my theory and here is the working code:

PHP Code:
function items_Skin($item$adopt){
          
$mysidia Registry:: get("mysidia"); 
        
        
$imageurl $adopt->imageurl;
        
$currentLevel $adopt->currentlevel;
           
        
//Let's check if the adoptable is using this custom skin. 
        
if($imageurl == "http://yoursite.com/picuploads/png/nameorcodeoftheimage.png") { 
            
//The adoptable is already using this custom skin
            
$note "Your adoptable is using this custom skin."
        } 
        
//Let's check if the adoptable is below level 10. 
        
else if($currentLevel 10){
            
$note "Your adoptable is not at level 10 yet.";
        }
        
//Adoptable has all the requirements, let's update it 
        
else{              
            
$mysidia -> db -> update("owned_adoptables", array("imageurl" => 'http://yoursite.com/picuploads/png/nameorcodeoftheimage.png'),"aid='{$adopt->aid}' and owner ='{$item->owner}'"); 
            
$note "Your adoptable {$adopt->name} is now using a new custom skin."
            
//Update item quantity... 
            
$delitem $item->remove();  
        } 
        return 
$note


I changed all the $type in the code because you already can chose who will use the item at the Item creation page, also to make sure the user wont be using the item twice in the same adopt by mistake and loose the item.
the only problem i see is that if for some reason the user want the adopt to have their original skin(don't know why someone would want to do that) they cant... so i would post a warning in the description of the adopt saying that all changes are permanent XD Unless you can code something to make them return to their original form =)

you can still use the code that intoRain edited, if you want to exclude a special type of adopt, just change the part that start from "else{"
__________________
Reply With Quote
  #14  
Old 09-30-2014, 10:36 AM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,086
parayna is on a distinguished road
Default

Ooh, so if I used that one I could create custom skins?? :D Yay! Thank you ^_^ (I can use it right? :P I'll be making a credit page anyway so I can give you a shout out!)

So, to use it, do you just copy and paste the code for every custom skin? Or is that a seperate item function that you can then use on items and when they are put on your adopts it changes them?

If so, coool :D What you could do is, as well as the warning, make people pay a certain amount of virtual money (or real, if you wanted to) to have their adopts reverted back to their original state? And only admins can do it. Just throwing ideas out there XD
Reply With Quote
  #15  
Old 09-30-2014, 10:55 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,039
kristhasirah
Default

well the code is the function for the items... in this case for 1 Item, you must open the function/function_items.php and just copy/paste the code before the "?>" and replace the imageurl with the image you want, not forget to change the: function items_Skin($item, $adopt){ by replacing the _Skin with the name of each custom, that way you wont be confused. also remember to edit the class_privateitem.php to add the new case for each code you create and replace "Skin" with the name of custom:
case "itemsSkin":
$message = items_Skin($this, $owned_adoptable);
break;

and add them to your database in the table adopts_items_function by adding a new row for each custom skin =)

well is a nice idea you have for reverting back the adopt, but if you cant be online all the time, members can start complaining... i know there should be a way to edit the code and revert the adopts back to their original image, but cant figure out how to update the imageurl table back to "NULL"... because for now it just write null as the url and give an x image for the adopt >_>
__________________

Last edited by kristhasirah; 09-30-2014 at 12:36 PM.
Reply With Quote
  #16  
Old 09-30-2014, 12:08 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,086
parayna is on a distinguished road
Default

Yeah, I can see how they would start complaining XD And for the code, I might have to play around on my test site.. (it's the only way I'll be able to learn how to do it properly XD) but thanks for telling me how, as I would have had no idea o.O
Reply With Quote
  #17  
Old 09-30-2014, 12:39 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,039
kristhasirah
Default

i will try and see if i can find anything to make the code revert the image =)
also fixed the case...
i copied one of the ones i had and forgot to change 1 part: = items_Type it should be: = items_Skin and you just do the same and replace the Skin whit the name of the custom
sorry about that >_>
__________________
Reply With Quote
  #18  
Old 09-30-2014, 01:07 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,086
parayna is on a distinguished road
Default

That's fine XD I am just happy that you bothered enough to attempt to write a code! (And succeed) I suck at coding XD I need to practise or take some sort of online class/school thing... hmm. There's a thought!
Reply With Quote
  #19  
Old 09-30-2014, 02:40 PM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,039
kristhasirah
Default

manage to make the reverting code work ^^

here is the finished one:
functions/functions_items.php
PHP Code:
function items_originalS($item$adopt){
          
$mysidia Registry:: get("mysidia"); 
        
        
$imageurl $adopt->imageurl;
        
$currentLevel $adopt->currentlevel;
        
                   
//Let's check if the adoptable is using his/her original color. 
        
if($imageurl == NULL) { 
            
//The adoptable is already using his/her original color
            
$note "Your adoptable is using his/her original color."
        } 
        
//Let's check if the adoptable is below level 10. 
        
else if($currentLevel 10){
            
$note "Your adoptable is not at level 10 yet.";
        }
        
//Adoptable has all the requirements, let's update it 
        
else{               
                    
$mysidia -> db -> update("owned_adoptables", array("imageurl" => NULL),"aid='{$adopt->aid}' and owner ='{$item->owner}'");
            
$note "Your adoptable {$adopt->name} is now using his/her original color."
            
//Update item quantity... 
            
$delitem $item->remove();  
        } 
        return 
$note


class/class_privateitem.php
case
PHP Code:
case "itemsoriginalS":
$message items_originalS($this$owned_adoptable);
break; 
it was so simple... i just had to remove the cotes '' from NULL to make it work o_O it was the only change i made to the code, this will revert back the adopt to his/her original image or alternate image depending which one was using before the change of skin.
by the way you can change what it says in the $note= to anything you want or you think it will go with your site =)
__________________

Last edited by kristhasirah; 10-01-2014 at 12:53 PM.
Reply With Quote
  #20  
Old 10-01-2014, 12:03 PM
parayna's Avatar
parayna parayna is offline
Member
 
Join Date: May 2013
Location: Devon, UK
Posts: 342
Gender: Female
Credits: 16,086
parayna is on a distinguished road
Default

Oh, my... thanks so much!! :D yay ^_^
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
Mys v1.3.4 Item Function: Gender Change Potion Kyttias Mys v1.3.x Mods 21 10-12-2016 07:52 PM
Calling a function in a function from the same class page Hwona Questions and Supports 2 04-25-2015 08:41 AM
Item Function Is Invalid Hwona Questions and Supports 31 09-27-2014 09:27 PM
Item Function Suggestions NobodysHero Suggestions and Feature Requests 5 06-23-2014 03:45 AM


All times are GMT -5. The time now is 07:27 AM.

Currently Active Users: 451 (0 members and 451 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