![]() |
|
#1
|
||||
|
||||
![]()
EDIT: heres the post with the working code-
How would I make a thing to display on my side bar that shows your active/spotlight pet? And maybe make them say random things? So for a picture example- and we'll say this pets name is...Marian? ----------------------------- ![]() Marian says: "Lets go exploring!" _____________________________ But that there would be a list of different things you can make them say? So it would choose from a random assortment of Phrases Or sometimes nothing at all? Possibly depending on the pet species if possible? So one species would have a different List of things they could say. But if thats too hard its fine XD Same list is okay. I was just wondering if this was possible. and if so how it would be done. Last edited by Ittermat; 03-21-2016 at 02:05 PM. |
#2
|
||||
|
||||
![]()
To make a favpet display inthe sidebar, first in the AdminCP you'll create a module (surprisingly not a widget):
![]() Then in classes/class_sidebar.php you'll need to add these functions: PHP Code:
But I'll get back to that. Let me know if you can at least get the pet into the sidebar and then I'll be back later help you set up a switch statement to display random phrases for pets to say. ![]()
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
#3
|
||||
|
||||
![]()
thank you! I'll mess with it and get back to you after I eat dinner!! ^^
|
#4
|
||||
|
||||
![]()
Yup Got him in the sidebar! Whats next? ^___^
Last edited by Ittermat; 03-07-2016 at 05:38 PM. |
#5
|
||||
|
||||
![]()
Ittermat do you mind if I use this too? I was going to screw around with the code to try to make a active pet too.
|
#6
|
||||
|
||||
![]()
Of course not! Lol ^^
|
#7
|
||||
|
||||
![]()
Also another question- what if I wanted that pet to randomly find items or money- or have "fake" Status effects happen to it?
|
#8
|
||||
|
||||
![]()
That can be done, too.
![]()
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
#9
|
||||
|
||||
![]()
no its fine! get some rest! Help me when you can ^^ thank you!! <3
|
#10
|
||||
|
||||
![]()
We're going to set it up like this: 1% of the time the pet may get a status effect. Of the 99% of the time that the pet does not come away with a status effect, 75% of the remaining time - nothing will happen at all. Of the other 25% of the time, 5% of the time it will either be because it found some money or an item (about 50% toward either). The remaining 20% of the time it will say a random phrase based on its species. Below is commented but empty code just to get the odds of each event happening right:
PHP Code:
More soon! I've got to go look up some of the code I've used to give items and such again. 1) Is it alright if items and money are automatically collected, even without the user clicking or doing anything? It becomes much more complicated otherwise. 2) Inevitably if you wanted to, say, make it so your active pet can find an abandoned egg 1/500th of the time (about 0.2% chance of happening) but require that the user also be paying attention and clicking that message, remind me - I should be able to think this one through, given enough time. Let me know if this is something you want. 3) These percents should all be easy to modify. Let me know if you have questions and I can help tweak the code. If you change an mt_rand(1,100) to mt_rand(1,200) you will literally make something twice as hard to get and this will be relevant as soon as you want things to happen less than 1% of the time. One percent of that (1,200) would be 0.5% instead of (1,100)'s obvious 1%. 4) The fake status... placeholders for potentially real ones later? Is there a list of random events (nice ones are better than mean ones) you'd be interested in? Such as the pet suddenly gaining experience (as if clicked) or an entire level (if it's not frozen)? More complicated things (that existing item functions can't do) I might be interested in helping out with later, once everything else is done. For now, status effects will be the last on the list of things I'll do, and we'll fill it in with a message of "a status effect would have happened here" so long as we're testing. There are also some ideas I have that would be optional status effects that would require the user to click to accept and have it explained that the changes are somewhat permanent but entirely optional - such as the pet's gender or species changing, or the species' alternate appearance activated. Most of the time the user would be enthusiastically agreeing to this change but what if they really like their pet exactly how it is? We wouldn't want to force something, no matter how cool we think it is.
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 03-08-2016 at 12:32 PM. |
![]() |
Thread Tools | |
Display Modes | |
|
|
What's New? |
What's Hot? |
What's Popular? |