#1
|
||||
|
||||
Hall of Famer's HP system
Well before we get this started, I am noticing you that this is based on Pokemon's HP system. You will have to modify the formula or even redefine the variables used in your formula to create a custom HP system of your own interest. Here I will begin:
Before getting started, we will need to set up the new structure of the 'adoptables' and 'owned_adoptables' tables. In my pokemon HP system, the following column is needed in 'adoptables' table and another three are required for 'owned_adoptables' table. You can do it pretty much easily in phpmyadmin: in table 'adoptables', add: PHP Code:
PHP Code:
Alright, we are done with the database structure. The next thing to do is to add this definition of base hp to admincp. In admin.php, find: PHP Code:
PHP Code:
This step is technically not required, but it makes your life easier if you wish to add adoptables through admin control panel instead of phpmyadmin. The next thing to do is to update nadopt.php so you will be able to successfully created this adoptable. In nadopt.php, find: PHP Code:
PHP Code:
PHP Code:
PHP Code:
So basically what we are doing here is to enable admins to create adoptables successfully by matching the number of columns in table 'adoptables'. If you are using Kaeliah's multialternative mods, your sql query will look quite different and all you have to do is to add ,'$basehitpoints' to the end of your codes. We are done with the definition of base HP, and its still rather important to convert this base HP to an adoptable's actual HP. You may wonder where the variable 'individualvalue' come from, and I will illustrate this point to you next. In doadopt.php, find: PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
We are done with doadopt.php now, isnt this easy? By doing this, an adoptable's hp will be determined to be 10 once it is added to your party. Note I define the column 'basehp' in 'owned_adoptables' table so that it wont mess up with the corresponding column 'basehitpoints' in 'adoptables' table. However, the key point of this HP system is that its value is not a constant and thus varies with the following three variables: Base HP Individual Values Levels Therefore, its rather important to make sure that the adoptable's HP does receive a new value after its level increases. To do this, you will need to modify another script file. In levelup.php, find: PHP Code:
PHP Code:
PHP Code:
PHP Code:
By doing this, we define the adoptable's new HP after its level increases by 1. Note the formula is used for pokemon HP system, you can modify it to wahtever you like for your own adoptable site. Make sure the variables you will need may not be the same with Pokemon system. We are almost done now, there's one last thing to do before heading to bed. You may want to display your pet's HP when looking at its stats. If this is what you want, then go to myadopts.php and find the following lines: PHP Code:
PHP Code:
PHP Code:
PHP Code:
You are all set now, cheers. If done correctly, you should get a similar stats page for your adoptables as the screenshot provided below. Keep in mind that I have Arianna's gender mod added to my script file, so it may not appear to be the same with yours: This HP system may look quite useless at this point, unless a battle system is made. But anyway, this is the first step to create a complicated battle system. You can use my HP system directly if you run a Pokemon site, but if not, please do at least modify the formula so that it works out for your site. Note the variable 'individualvalue' is designed for Pokemon games only, and you may need a different set of variables in your HP formula. If you are using Kaeliah's status system, you may wish to create another column called 'currenthp' for your adoptables. The pet's current HP value may be set to be exactly the same as max HP but it may decreases if your pet's sick. If you have an itemshop system, you may even be able to create medicines/potions used to heal your pets. So yeah, this HP system can be easily integrated with other addons we currently have here. For me, I will create other stats such as attack, defense for adoptables next, and maybe I should create a new table 'stats' to store each individual pet's stats if too many columns make the table 'owned_adoptables' look messy. My thanksgiving break will end soon so I wont be quite active since the end of the week, but I will continue to learn and write codes whenever I can. Thanks for support, everyone. |
#2
|
|||
|
|||
RE: Hall of Famer's HP system
great contribution, hopefully soon there is a mod of battles: D
|
#3
|
|||
|
|||
RE: Hall of Famer's HP system
Nice ;O, i gone use this <3
------------------------------------------------------------------------------------- |
#4
|
||||
|
||||
RE: Hall of Famer's HP system
Nice :D Lot better than the one I was working on X3
Can you explain the IV to me though? I play Pokemon and still don't understand the whole IV and EV values thing O.o
__________________
"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo My Adoptables|Nuzlocke Webcomic |
#5
|
||||
|
||||
RE: Hall of Famer's HP system
Thanks for the comments everyone, I really appreciate all these. I am not sure if a battle system will be available anytime soon, it may not be possible even during next summer seeing how many pre-requisites we will need for a battle system to function well. Not only the HP of a pet can be integrated to a future battle system, but also other stats such as attack, defense, speed and so on.
@ gigi: IV = Individual value, which is a random number between 0 to 31. A pokemon with higher individual value is usually stronger than others of the same species. EV = Effort Value, which is a number that increases through battling. Seems that the effort value of your pokemon is largely dependent on the enemy pokemon you defeat, which is too complicated to be implemented into this HP system(so of course, I neglect this effect for pokemon's HP determination at this point, at least until a battle system is added). Also note that in reality, a pokemon can have up to 6 different Individual and Effort values for each of its stats. For instance, your pokemon may have rather high HP if its individual value for HP is 31, but in the meantime its individual value for Speed may be low so you always get hit by your opponent first. The same applies for Effort values, which becomes a problem if you try to add all these columns to your owned_adoptables table(lemme see, 20 new columns at least). This is why I am considering whether to create a new table that stores data for each pokemon's stats with references passed by adoptable ID numbers. |
#6
|
||||
|
||||
RE: Hall of Famer's HP system
Another spambot? Amusing, havent been banning them for days and now I am sorta bored because of this.
|
#7
|
|||
|
|||
RE: Hall of Famer's HP system
This whole system is fantastic!! I've been wanting to comment on it, and I have to say this is nothing less than wonderful! thank you so much for sharing this .... :)
when you get a chance, come check out the NEW Pantheras :D The blended breeding is working now, and it's utterly amazing .... |
#8
|
||||
|
||||
RE: Hall of Famer's HP system
Thank you Anna, and I hope your site takes off too. ^^ Finals are over for me, and I should get the compilation release done asap. ^^
|
#9
|
||||
|
||||
Wow, that's nice to have. It works like a charm. :)
__________________
|
#10
|
||||
|
||||
Thank you so much Enddayne. Well this thread is sorta outdated, I've made an improved version for the stats system in premium members forum. ^^
__________________
Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Hall of Famer's Evolution Mod v1.2 | Hall of Famer | Mys v1.2.x Mods | 9 | 07-08-2012 03:48 AM |
^_^ Happy Birthday Hall Of Famer ^_^ | Alaric | Other Chat | 10 | 05-23-2012 12:35 AM |
Hall of Famer's Gender Ratio Mod v1.2 | Hall of Famer | Mys v1.2.x Mods | 45 | 04-02-2012 01:42 PM |
New interview with Hall of Famer! | cpvr | Other Chat | 6 | 03-08-2011 11:51 PM |
Hall of Famer's gender ratio system | Hall of Famer | Mys v1.1.x Mods | 34 | 01-25-2011 02:19 AM |
What's New? |
What's Hot? |
What's Popular? |