PDA

View Full Version : Only 2?


trollis76
04-19-2009, 09:30 AM
There's something that bothers me. I want to have like 5 alternate outcomes of an adoptable. Like, you have this egg, and when that one reaches level 5 you can get one of the 5 different dragons, is that possible?
Please answer ASAP!

gjac1
04-19-2009, 11:29 AM
I asked this before and i thought it was going to be available in the new script, but maybe it was more difficult than first thought...

trollis76
04-19-2009, 11:47 AM
Perhaps..?
:/
Well, that would take years just to make one level, it's already a pain in the as* to make levels. :/
Well, gotta be patient.
*Here's a cookie*

BMR777
04-19-2009, 04:22 PM
Currently only two total outcomes are available.

trollis76
04-20-2009, 12:15 AM
OK, thanks Brandon.

zhiichiro
04-20-2009, 09:33 AM
so far, i dont make pets with alternate outcome..

but i'll try to add this on my May-special pet lol

www.whyrmz.tk

gjac1
04-20-2009, 03:10 PM
Is it possible to direct the alternate image code to a folder containing multiple images rather then to just 1 image ?

BMR777
04-20-2009, 04:11 PM
Is it possible to direct the alternate image code to a folder containing multiple images rather then to just 1 image ?


No, it has to be an image file. You can probably use the image from url box though to link to a dynamic image, such as something.php?imageid=1 or something, that would be a way to "cheat" the system. :)

gjac1
04-20-2009, 04:54 PM
Can you explain that in a bit more detail please ?? like step by step lol , sorry, i am a bit of a noob :s

BMR777
04-20-2009, 04:59 PM
You could use something like this:
http://www.alistapart.com/d/randomizer/rotate.txt

It allows you to rotate through random images. Not sure if it is what you want though. More info here:

http://www.alistapart.com/articles/randomizer/

gjac1
04-20-2009, 05:49 PM
yeah..that looks a wee bit too complicated for me lol..

Thanks anyway for your reply :)

gjac1
04-21-2009, 05:07 AM
I have managed to install it :)

Can you tell me though where i add this to make it so the hatched image is just 1 constant random image ?? At the moment, the hatched images changes everytime the page is refreshed :s

<img src="http://www.pokefusions.kilu.de/rotate/rotate.php?imageid=1"

Thanks :)

BMR777
04-21-2009, 03:43 PM
Constant random image? Seems like a conflict in words...

gjac1
04-21-2009, 03:45 PM
The images changes each time the adoptable is reloaded, it doesnt just change the image by itself....

So in my sig now it is 1 thing, i refresh the page and its something else lol :s

BMR777
04-21-2009, 03:47 PM
Ok, maybe the random image rotator isn't the best idea then. I'll have to think about this...

gjac1
04-21-2009, 03:48 PM
ok thank you :)

gjac1
04-25-2009, 05:54 AM
I have been thinking (never a good thing :s ) , instead of it picking an image at random, is it possible to edit it so it picks an adoptable AID at random ??

So for example, you click on the Egg on the adoption page and then the script picks an AID at random...obviously all the alternatives would have to be added separately as current adoptables to be assigned an AID , but that wouldnt bother me...

EDIT : or maybe using the freeze feature in the new script to free it once the random image has been chosen ??

gjac1
04-27-2009, 08:30 AM
Could this RAND() command not be added to the ?AID= function at all ??

Sorry to bump this but i am pulling my hair out trying to figure this out lol :s

BMR777
04-27-2009, 04:29 PM
I don't think so, since we want a constant set of images once you specify a random image.

What you could do is add more fields onto the adopts_levels table to allow for more alternate images, or you could make a new database table that is used to handle alternate images so you could have unlimited that way.

gjac1
04-27-2009, 04:50 PM
The new database table used to handle unlimited alternatives sounds very good :) I think lots of people who use your script would make good use of it and be very grateful....

Any chance you could do a short set of instructions for me ?? i have learned loads from you, so you dont have to go into too much detail, just the general gist would be good....if you could :)

Thanks

BMR777
04-27-2009, 05:38 PM
Basically you would make a new database table for the alternate images that contains the adoptable type, level and level image location, plus give each alternate level a defining name, such as alternate1, alternate2 etc.

Then you need to modify the getcurrentimage() function in functions.php to read from the new table if the adoptable is using alternate images. So, in functions.php for getcurrentimage() replace the part after "If alternate images are enabled and an alternate image exists, use it" with...

if($usealternates == "yes" and $alternateimage != ""){

// Using an alternate image, read from the alternate images table you
// made based on adoptable type and type of alternate image.

}
else{

// Set the image equal to the primary image for the level
$image = $primaryimage;


}

Then you would have to alter doadopt.php and levelup.php where they determine alternate images and change it so it picks a specific alternate image set, which you could store in the usealternates field for a given adoptable in owned_adoptables.

It's not something that can be done in 5 minutes, but it is doable.

gjac1
04-27-2009, 05:38 PM
I have created a new table called "adopts_alts" , the structure of this table is just a single field called "alturl" , Type : varchar(120)

I have already added 10 alternate image locations, the part at where i am stuck now is where to edit in the functions.php file, i have found where the alternate image is :

// If alternate images are enabled and an alternate image exists, use it

if($usealternates == "yes" and $alternateimage != ""){

$image = $alternateimage; // Use the alternate image

}
else{

$image = $primaryimage; // Set the image equal to the primary image for the level

}


Thanks for all your help :)

BMR777
04-27-2009, 05:39 PM
Basically, you want to replace:

$image = $alternateimage; // Use the alternate image

With some code to assign $image to one of the alternate images you created for the adoptable.

gjac1
04-27-2009, 05:39 PM
ahh, sorry, i seem to have posted just after you did :s , it seems i was way off with what i was doing lol :(

Thanks for the reply, i will give it a go now :)[hr]
ok, i know you must be getting really annoyed with me now, sorry :( but the reply you gave telling me what i needed to replace in the code, is that in response to what i was doing or an add on explanation to your guide ??

If its a reply to my idea, do i change it to :

$image = 'adopts_alts' $alturl ;

You must get so tired of us noobs, and again i am really sorry.....

gjac1
04-28-2009, 04:38 AM
I have tried several different things to try and get it to pick one image from the new table i created, but i am having no luck...

Anyone have any ideas what i need to replace that line of code with ??

gjac1
04-30-2009, 12:26 PM
Sorry to keep bugging you with this, but have you had a chance to think this over a little more ??

Like i said, i have setup the new table which includes the links to the multiple random images, i just dont know what code to add or where to add it to make it select one and them from the new table...

Thanks again for all your patience and help :)

BMR777
04-30-2009, 12:39 PM
What is the structure of your table?

Seapyramid
04-30-2009, 02:28 PM
Why not do like I did and work with the system, not change it? Make the same adoptable more then once and different outcomes on each one:) Mystic Grave has Companions with up to 5 outcomes currently. :)

Sea

gjac1
04-30-2009, 04:40 PM
I called the new table "adopts_alts" , the structure is just 1 field named "alturl" which is a varchar(120) type, this is where i input the url of the image.

Sea, i kind of did something like that with the old script, i created a html page for the adoption page, made the egg on all 10 adoptable exactly the same, then created 10 different outcomes..but i had to edit the "type" of adoptable manually in the DB, which wasnt fun....

BMR777
04-30-2009, 04:56 PM
You need more structure than alturl. You should have the URL to the alternate image, the adoptable type and the level the alternate level is for, at a minimum.

Seapyramid
04-30-2009, 05:48 PM
I called the new table "adopts_alts" , the structure is just 1 field named "alturl" which is a varchar(120) type, this is where i input the url of the image.

Sea, i kind of did something like that with the old script, i created a html page for the adoption page, made the egg on all 10 adoptable exactly the same, then created 10 different outcomes..but i had to edit the "type" of adoptable manually in the DB, which wasnt fun....


You can do it with the new system real easy.. just add in the adoptable the same way as always.. Give it 2 outcomes. Add another adoptable with the same name but with an extra space somewhere so the system looks at it as being a different name. Give it 2 outcomes. The space isn't noticeable on the adopt page, but the system knows the difference.

gjac1
05-01-2009, 05:38 AM
You need more structure than alturl. You should have the URL to the alternate image, the adoptable type and the level the alternate level is for, at a minimum.


I have added 2 more fields to my table like you suggested, the level field is the same level in them all, as it is the 1st evo after the hatch stage that is going to be random from multi images.

And the Adoptable Type will also have to be the same, as at the moment i only have 1 egg for the multiple outcomes, so only 1 adoptable type.

The 2 new fields i added are called "type" which is varchar(40) and "level" which is int(11) .

Thanks again for your help :)

gjac1
05-02-2009, 04:57 AM
Is it a simple line of code your working on for this mod or is it like a big re-write ?? because if its a big re-write you could always release it as a buyable add-on....

Would it not be easier to assign an AID at random ?? if you could do that, that would make it work perfect..a member picks an egg, its assigned an AID at random, and that it hatches and evolves as normal :)

Almost all decent adoption sites that are already established have just the 1 standard egg that has multiple outcomes, so you might get a few buyers for it, inc me :)

Missy Master
03-20-2010, 08:38 AM
I don't think so, since we want a constant set of images once you specify a random image.

What you could do is add more fields onto the adopts_levels table to allow for more alternate images

I think this sounds like a fascinating idea, and would you be able to specify a bit more on this, Brandon? I understand how to add the extra fields, but would they go right after the one alternate field, or at the end?

Would this mess up anything with the coding/SQL later, and finally, for the actual form for creating the adoptable levels, would you need to alter that in any way, or would it "automatically" draw from these extra field images? I am pretty sure they all have to have different names, like-1, -2 etc.

thank you very much! :D

gensuperman
03-28-2010, 09:39 AM
This is a rather old... and I mean old... post to try and revive... But, I thought that since I had an idea/question that BMR777 could set me straight on, in regards to having multiple outcomes of a level.

Also, considering that this code has not be updated by the time of the discussion of this thread, heres my idea:

Currently the script has the option for "1" specific level to have "1" alternate outcome. Which, that setting is located in Admin, "Alternate Outcomes Settings: Start using the alternate outcome at level number #".

So, most will choose to start at birth which would be zero.

Now, BMR777 had an interesting approach by using a rand() command... but, you guys are assessing that the images are the real culprit.

But, when creating a brand new adoptable within the Admin Area "Manage Adoptable - Edit Existing Levels - Adoptable Name One - Alt Image Category..."

Even though that as listed above, the alternate outcomes starting level is set to zero, each editable level has an alternate image field, especially when you edit the image:

For example:


Edit> Adoptable Name One - Level 1

Primary Image for this level

Alternate Image for this level.


Now obviously, even when you add something here, the changes won't matter, because the script is concentrating on just level 0 as being the main alternating change...

However... what if... you use the rand type command within the code of the "Alternate Outcomes Settings: Start using the alternate outcome at level number #" setting?

So, now keep in mind, that you would lose the chance for the birth to be female or male per say (after the egg hatch), because then every image would have the possibility of rotating by 2 different images (per advancing each level).

The script would need to recognize that each level has the alt image field active. I wouldn't think you could have more than 2 alternate outcomes of images at this point for a specific image.

I'm still new to the script, but I just noticed this setting, I wasn't entirely sure, if this was already a part of the scripts function to work in the manner I described?

If it is not, then BMR777 could you please let me know what code or where I could find the code to implement a rand command against the leveling up of the "Alternate Outcomes Settings: Start using the alternate outcome at level number #" setting?

So, everytime a user levels their creature up, they have the possibility of every level having the alternate image active (and the possibility would be set within the Admin Area> The alternate outcome has a chance of 1 in # chance setting), so that specific setting would also have to follow with the rand command.

This would allow for more flexibility... This may not be a great idea for say male/female genders... but... this would work great for uni gender projects.

redheadturkey
04-12-2010, 01:12 PM
that's a really interesting idea as a way to tackle this. I know I've had several people ask me to provide more varieties of my pets, and it seems to be a really important thing to be able to offer on a site.