Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Suggestions and Feature Requests (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=21)
-   -   Pets with Personality? (http://www.mysidiaadoptables.com/forum/showthread.php?t=4556)

Kyttias 06-26-2014 05:13 PM

Pets with Personality?
 
I was stumbling through random generators earlier and one I found had a distinct pattern:

"This {adjective}{age}{species} is {size} and {intelligence}. {Gender} likes {likes} and hates {hates}."

I think this is cool from the sense someone could integrate random generation for their creatures, from a purely flavor text standpoint.

"This affectionate young {species} is smaller than average and unusually intelligent. {Gender} likes making noise and hates strangers."

You could even include one to three likes and hates, also randomized. Each creature will feel unique as they pull from a random array that sticks with them their entire life, except for age, which should change based on their level.

I think this might be a fun feature to implement. Enough so that if anyone had interest in making it, I'd be willing to pay a bit for it just so the entire community could have it if they wanted it. ovo

squiggler 06-26-2014 06:31 PM

This might be fun to have. It's definitely not on my priority list, but I would enjoy this feature.

tahbikat 06-27-2014 10:53 AM

Support! I really want personalities. :P

Hwona 06-27-2014 12:22 PM

I tried doing something similar, but I don't think I know the best way to do this. XP You could try to add an extra column in the owned_adoptables database. Then, on each page where an adoptable is created, you could select a random word from an array and then put that into one of the columns. I'm using v.1.3.3, but I can try and play around with some things. :3

Hall of Famer 06-27-2014 10:37 PM

It actually isnt difficult, unless its time-based and require cron jobs/scheduled tasks. The real question is, what do you want the pets personality to do? Is it just for display on pets profile to make it look more interesting? Or do you have other plans for pets personality like it may affect how it battles/interacts with owners in future versions?

Kyttias 06-28-2014 12:45 AM

Nah, nothing fancy, just flavor text, for now.

But I'm sure some would be curious about things sort of more in the direction of Pokemon, as well. For example, 'likes sweet things' and from a list of sweet, sour, bitter, spicy and bland foods to choose from. (Click bonus/level up would not occur upon visit, but upon food selection, with a bonus given to choosing the proper food.) I've seen other sites already implement similar things, it's quite entertaining.

Just having a static variable attached to an adoptable that never changes is a big step forward for those who want to code past that. Unfortunately, I'm pretty bad about database entry. For now, I'm eagerly watching what Wallie's doing, because it sounds super close to what I want to do.

I'm glad that Mysidia's intention is to be here for beginners who don't need complex websites. Some of us are big dreamers, though, so we can't wait for some actual documentation and tutorials. Now that I've finally settled into my new home, I've had a lot more time to appreciate the inner workings of the script. ^^

Hwona 06-28-2014 12:59 PM

^ Edit: Everything works! Should I share this as a modification? I can't figure out how to give each existing adoptable their own random personality, but you can change them to something unique maybe? :3
There's probably an easy way to make all of this editable through the ACP, but I have no idea how to work with addons.

Kyttias 06-28-2014 01:46 PM

Ah, so their personalities are being set to something when they're created, though? (So they all have the same personality for now?) Have you tried grabbing from array? In PHP there's an array_rand function (php.net / w3schools).

If you hand it over I'll attempt to take a look at it, but I'll be spending the next week someplace without convenient internet. ><

Hwona 06-28-2014 01:49 PM

^ New adoptables will have different personalities.(I used that function) :3 However, on my site, there are existing adopts and I can't give them different personalities, so I'm just going to go ahead and give them a "special" personality.
Edit: What are your thoughts? It would be great if you could fix that tiny thing, but I've got everything else. :3

Kyttias 06-28-2014 02:47 PM

Ah, some supplement script would have to be made to insert (or very literally install?) data for older adoptables. Once it's run once then the file could be tossed out.

Hall of Famer 06-29-2014 03:24 AM

Interesting, looks like you two are already trying to get it to work. ^^ Like I said, it shouldnt be hard, just need some creativity and efforts. If you want random personality but with different chance/probability to occur, you may try the class Probability. It is very simple to use, and will generate the appropriate personality for you based on the chance/probability you assign. A chance of 20 is higher than 10, so more likely to occur. Hope this helps.

Hwona 06-29-2014 09:36 AM

^Ah! I'll look into this! :D

Kyttias 07-02-2014 01:12 PM

Wallie, you finished this, right? You can go ahead and share it? (And just making sure, this and your stats mod work on new adopts that come from promocodes, too, right?) What did you want in return? ovo

Hwona 07-02-2014 02:07 PM

Gah! Promocodes... got it...
Thanks for reminding me! Should I share this as a mod? As of now, I haven't gotten to the part where you can alter the likelyhood of an adoptable getting a certain stat, but I'll add that later on. Also, I'm working with v.1.3.3 and I found out that the levelup.php file is quite different in the newset version, so I may need to do a bit of tweaking. I'm pretty certain that personalities will be assigned with just some slight repositioning but I can't figure out how to display it on the levelup page... :3
One more thing... what did you mean by what I want in return?

Hall of Famer 07-02-2014 03:48 PM

Why not? You can always release a Mod if you believe it's ready. ^^

Kyttias 07-02-2014 04:16 PM

Eh, I'd make you something if you like. I'm thankful for your efforts! ^^ Maybe some delicious flowers for your catepillars?

I'm not so concerned about the positioning, so long as I can get it down to a {$variable} form, I'll be able to place it in wherever I like.

But yeah, promo code babies are super important. ^^; Next I want to know how to give a creature directly to a person without having to use the promo code as a go between (with a 'will you accept this creature? y/n?' dialog).

As for sharing it, I suppose it's up to you? If you have PayPal, I can always donate a little bit of money, too.

Hwona 07-02-2014 04:24 PM

^Aww, thanks! I really don't need anything, but flowers sound really nice! :D Are you good with just personalities having an equal chance of being picked? If so, I'm going to go ahead and make the thread. Getting it into a variable is not a problem. The issue we had with converting the stat system to v.1.3.4 was that I couldn't find a way to add an extra message to put the variable in. Do you know how to do that?

Kyttias 07-02-2014 04:46 PM

Equally random, yup.

As for an 'extra message'? Uhmm... well... there's this, for example:

Code:

$online = $mysidia->db->select("online", array(), "username != 'Visitor'")->rowCount();
$offline = $mysidia->db->select("online", array(), "username = 'Visitor'")->rowCount();
$this->assign("population","{$online} Users Online + {$offline} Guests");

If you call just {$online} or {$offline}, you receive just a number. But if you call {$population} it'll render something like "12 Users Online + 17 Guests" wherever you choose to place it.

I'm super not sure if that's helpful. =/ I hope so.

Hwona 07-02-2014 04:55 PM

I'm not sure if that'll work with the levelup page. Do you know if the comment function works with v.1.3.4? How about addLangVar?

Kyttias 07-02-2014 05:23 PM

I don't know how the comment function works, no. ><; I just know how to make variables that can be used in pages.

Hwona 07-02-2014 05:27 PM

That's my problem. Like, on the levelup page, I know how to insert a variable into text, but I can't insert the text into the page.
As for the gifting system, isn't it like trading for free?

Hwona 07-02-2014 10:41 PM

Oh! One more question... does "return $note;" work with v.1.3.4? LOL, just when I though I was getting a hang of coding, v.1.3.4 comes along and crashes me to the ground. XP

Kyttias 07-02-2014 11:48 PM

You'll have to ask HoF, I personally haven't seen anything like that. I mean, it looks like very run of the mill php going on there, but... I also really don't know and it's past midnight and I've had three glasses of wine so, @o@~ Bed time for me.

Kyttias 07-04-2014 05:56 AM

OKAY, yeah, man I was out of it.

Code:

$document->add(new Comment("Hello!"));
Is what we've got.

IntoRain 07-04-2014 03:03 PM

Quote:

Originally Posted by Wallie987 (Post 30568)
Oh! One more question... does "return $note;" work with v.1.3.4? LOL, just when I though I was getting a hang of coding, v.1.3.4 comes along and crashes me to the ground. XP

Return statements are part of php, so depending on the contents of note, yes it will work xD


All times are GMT -5. The time now is 03:13 PM.

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