Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.2.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=38)
-   -   Custom design pets (http://www.mysidiaadoptables.com/forum/showthread.php?t=2194)

Chibi_Chicken 06-11-2011 06:28 AM

Custom design pets
 
Custom Pet Mod for Mysidia Adoptables v1.2.1

This mod will allow users to pick the background color of the pet that they adopt, and as the adopt levels up their color choice will effect that level as well.

Demo: http://www.plumagedoom.com/cpet/petdemo.php?id=3
Download: http://www.plumagedoom.com/cpet/Cpet...stallation.zip

Installation Notes:
I have put this mod on to a fresh copy of Mysidia v1.2.1 after installing the basic script run the installer install.php in the main folder. You will need to be logged in as a admin to install it. This will add in the needed two tables and update the apc hooks; Remember to remove the install.php!

Now that you have installed Cpets create any adoptable like you would normally do however when making an adoptable do not use Alternate Outcomes Settings** after adding in adopts and any levels for it go to the Site Settings page and in the Plugin Settings use the Custom Pet Admin to add the needed layers for the adopt and its levels.
You have just added a new custom adopt for users to play with.
**Alternate Outcomes Settings has not been tested with this mod, I am not sure how it will handle it. what I think will happen is when any of the scripts call for the image of the pet it will find that alter images is on and will use that image instead of the one on the owned_adoptables.imageurl

Custom Pet Admin Notes:
At the moment you have two choices; add in a new image and delete an image (manage image layer.)
When you chose to upload an image you will need:

Layer name: This can be a readable name used when you want to manage the image at a latter time
Body or Lines: This will set up what type of layer it will be. If you were to add in more than one of either type the likely thing that would happen is the script will grab them and what ever one was sorted (added?) last will be used.
Pet ID: Pick what pet this layer is for.
Pet Level: Add in the level that this is for, note that level 0 is the egg level or first level that you make for an adoptable.
File to Upload: The image you want to use for the layer effect.
Image Requirements: The image must me less than 150kb.
It must be PNG-8 file, this script will allow gifs to load however the image functions will only handle pngs right now so it will just give you errors for trying to use gifs.
Body layers can be any color(s) the scrip will just go in and replace any value it finds. it handles transparency with the alpha channel.

Adding Cpets to a pre-existing install:

If you want to install this code to an already installed copy of Mysidia Adoptables, run the install.php script to add in the tables and apc hook. For the pages look for:
#//----------
#custom pet mod
#//----------
this is the start of the new code that I have added in, I tried not to alter any code outside of this. The exceptions are in adopt.php I relinked from doadopt.php to customadopt.php, this also doesnt have the custom pet mod comments.

Here is the list of the files.
inc/functions.php //added in link to the cpet functions forgot to add in the comment however it is basically the third line.
adopt.php //redirected page and clear out/build a new variable in the session
breeding.php //added in section for the pet to breed with the custom background. note: I just had it pick a color randomly for the new adoptable.
doadopt.php //added in section to add the info from the custom pet session pet save it. Then build the image and save that to the adoptable.
levelup.php //added in find the parent id then level up the adoptable, level up rebuilds and saves the image again.

Altered
myadopts.php //altered how the image is taken from the db and displayed.
stats.php //altered how the image is taken from the db and displayed. Note: I missed a spot when the code get a random set of adoptable, it shows the egg image instead.

New Files
preview.php //used to display the new colors. Note: This may have caching issues with some browsers, I am not sure.
customadopt.php //form used to build the new pet.
cpetadmin.php //admin that manages the image assets for the custom adopts.
custompet_functions.php //core engine of the custom adopts does stuff minus toast.

Please leave any comments and questions in this thread.
[original post]

I have been working on this on and off for months now. i am at a point were i can show an example of what i am building

this mod will allow users to pick a pet type and then pick the color of the body also add in different effects. then when the pet levels or breeds the effects stick with it and can be passed on to the offspring.

so far this all i have gotten done :displeased:
http://plumagedoom.com/cpet/petdemo.php

I am still learning how the different scripts work with each other.

any comments or interest is welcomed.

PokePets 06-11-2011 08:57 AM

This could be nice for kecleon @ Pokemon sites :P

Inf3rnal 06-11-2011 09:22 AM

Looks quite amazing.

Basically using GD to generate a color for specified areas?

or by having the bg color magenta and having whatever color specified replace the magenta?

Either way I can't wait to mess with that code. :3

Hall of Famer 06-11-2011 02:12 PM

Sounds promising, but I hate to be the bad guy to tell you that this forum is only for mods/addons that are already completed and ready for users to download. For ideas or projects you are currently working on, post in Questions & Support forum so members can have a preview of your script.

Chibi_Chicken 06-11-2011 07:26 PM

Quote:

Originally Posted by Inf3rnal (Post 17026)
Looks quite amazing.

Basically using GD to generate a color for specified areas?

or by having the bg color magenta and having whatever color specified replace the magenta?

Either way I can't wait to mess with that code. :3

it basically takes the template png image and replaces the color but it still saves the alpha channel so you can get a blending effect when you add more than just one layer.

Quote:

Originally Posted by Hall of Famer (Post 17028)
Sounds promising, but I hate to be the bad guy to tell you that this forum is only for mods/addons that are already completed and ready for users to download. For ideas or projects you are currently working on, post in Questions & Support forum so members can have a preview of your script.

ok, wasn't to sure were it went, please move it to the right place, thank you.

Teshia 06-11-2011 11:41 PM

I think its friggin awesome. ^^

But then, I'm a bit biased. XD
<3

Rozel 06-12-2011 12:52 PM

This is awesome! It could work pretty cool with breeding sites, if possible I think it would be cool to also be able to have it get markings and such kind of like Wajas. But first things first, of course. :3 It looks great.

Kaeliah 06-12-2011 10:24 PM

Yeah I've been doing stuff with GD for awhile. It's hard to get it generic enough for others to use though. That's my opinion anyway.

Teshia 06-13-2011 03:01 AM

Its a complex script. Your average newbie would get frustrated with it rather quickly. It will be a long way off before it could be edited from the admin panel, if at all. We do most of our editing directly in the database, so admin is kinda useless.

Rozel 06-13-2011 10:05 AM

Well, I'm sure if you make a little guide you can explain to people how to edit from the database, rather then go through the trouble of coding more. By now I'm used to a database so I think I'd be fine with a little instruction. I don't know about other people though. :o


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

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