1.3.5 Alternates
I see that when a new adoptable is inserted into the database the field "alternate" is filled in with 0. So how/when/where is the alternate form defined?
(Asking because my 1.3.4 site is heavily modified so I am upgrading in bits and pieces.) EDIT: Also it looks like class_breeding isn't updated for the new alternates function. |
There is a new table called {$prefix}_alternates, which defines a list of adoptables alternate form. I will look into the breeding system and see if theres a bug I need to fix.
|
I see that the alternates table stores the alternate forms for each adoptable type, but how is the chosen alternate form selected for each individual owned adoptable? I just see in the owned_adoptables table the section for alternate, but the default for when a pet is adopted is simply 0. So where/how does the script determine which alternate form is used?
And for breeding it's just in class_breeding.php the insert function is still the old version (with the "use_alternates" column for ownedadoptables.) |
1 Attachment(s)
I've fixed the issue with alternate status in breeding. If you are using Mys v1.3.5 already, download the attachment to fix the bug. Otherwise, I will update the download links later today so this issue will go away for new users.
|
I also have the same question as Abronsyth where do one set an individual adopt to be alt or not and witch one to use. Im trying to upgrade my site and most of my adopts have an alternate version, but the alt image is not showing, now all of my alternates have the default image.
edit: never mind, found where to add the alt image. my new problem is that the last alt form don't work. my site uses 7 levels 4 for the eggs and 3 for the rest. so I have an alternate adopt at level 6 and then level the adopt to level 7 and the image reverts to the primary image... |
Where did you find that the individual pet's alt form is stored?
|
when an alt is chosen the url will be written in the imageurl column and the 0 in the alternate column will be replaced with the number of the alt.
so to make an owned adoptable an alt you need to add the image url to the imageurl and add the number to the alternates column |
Quote:
I'm also having the last-alt error, puts it in as 0 even when I put a different number in. However when I got back and edit it, it updates just fine. Edit: Nevermind, it appears to be working upon adding more. Weird. |
Last alt works similarly as other conditions as the chance will apply. If you set the last alt field with 50 chance, then it will only be selected 1 out of 2.
|
I've been having an issue with the alts too, and on a brand new 1.3.5 website set up on mysidiahost. I'd been having an issue with it on my wamp site too, even with a fresh install to check if I'd done something wrong. It throws this error:
Fatal error: Call to undefined method Adoptable::getAltStatus() in /home/beanpets/public_html/adopt.php on line 32 So I checked adopt.php and there is this line on line 32: $alts = $adopt->getAltStatus(); But from what I can see this is never defined in class_adoptable so I think the error is because it doesn't know what it means? If I delete that line the error goes away and allows me to adopt things, but any alt form I set in adminCP doesn't get applied so that's not a proper fix lol This is my class_adoptable if anyone can help: PHP Code:
Update: I tried using the 1.3.4 files adopt.php and class_adoptable.php and they both work (with a slight change to make usealternates say alternates in adopt.php). It seems the 1.3.5 class_adoptable doesn't have this section that the 1.3.4 version does. PHP Code:
|
I'm having the exact same problem as parayna.
|
Quote:
Actually the fix is indeed to delete the line 32. I tested it on my demo site and it worked for me when generating alternate forms when leveling up. If you see that it never gets alt form at level 0, this is because alt form no longer exists for level 0(egg stage). When an adoptable levels up, it will check the available alt forms and selects one according to the criteria. Since theres no level-up at level 0, the level 0 can only have a primary form. I hope this explains things, your adoptables will have proper alt forms if you set them for level 1 and beyond. |
Thank you! Worked perfectly!
Another thing I just found though (but I'm not sure if it's by design or not lol) is that using an item that raises clicks (and that levels the adopt up) won't use the alt form even if the chance is set to 100%. I wanted to test the fix so I adopted some adopts, and bought some items from the shop to raise their clicks. They levelled up but didn't use the alt form for level 1, even though chance is set to 100%. It worked perfectly when I manually clicked to raise their level though! (For testing purposes I set the clicks required to 1) I know there is an item that raises the level so I'm not sure if it's by design or not, ignore me if so lol. Thanks again! :meow: |
Quote:
I think this is a bug, items that raise clicks should trigger the alternate form selection code. Lemme take a look into it. |
Okay, thanks :happyc:
|
1 Attachment(s)
Try this file and see if the alternate forms are generated similarly to when you level up by clicking. You will need to upload it to /functions directory, or just edit /functions/functions_items.php and replace the entire code.
|
That worked perfectly, thank you!! ^_^
|
1 Attachment(s)
You are welcome. Btw can you try the new functions_items.php file? I've updated the item functions for alternate images. There are two item functions for alternate forms, the first one 'Alts1' will set the adoptable to the specified alternate form ID(the item 'value' is the new alternate form ID), while the second one 'Alts2' will simply select one alternate form randomly(the item 'value' is the target adoptable type ID). Give a try and see if it works as expected?
|
I've just done some testing and Alts1 doesn't seem to work. I set multiple alt images for level 1 on an adopt (3 alt forms, all set at 33% chance to be applied). When I levelled them up they took on 1 of the alt forms so I made Alt1 use the ID of 5 (which was an alt that the adopt did not take)
When I use the item it says Action Completed! at the top but the actual text either says 'It appears that your adoptable does not have an alternate image at its given level...' or 'The item can only be used for adoptable Luna at level 1 or above...' I adopted 2 to test on just in case and they are both level 1, the text seems to swap between saying both those things Also Alts2 doesn't show in the list for me so I haven't been able to test that one yet Hopefully that helps a little :) |
i'm trying to figure out why it doesn't do this automatically?>???? do we have to manually put this in for all of our adopts? that seems like a lot of work!
|
You mean, the last alt field? Yeah some users reported bugs with it, I was busy searching for a new car to buy last month so I didnt get a chance to look at. I will see if I can fix something this weekend.
|
All times are GMT -5. The time now is 09:56 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.