![]() |
Stat/Skill System(Tested with V.1.3.3)
Please pardon my poor explanation skills, but here's a quick guide to creating random-generated stats for adoptables. Please save back ups before beginning as this works perfectly for my site but I don't know what may happen with yours. Hence, please don't unleash your anger on me if there is anything amiss. :3
This first post shall cover assigning stats to created adoptables. 1. Go to PHPMyAdmin->your site's database->prefix_owned_adoptables Once there, there should be a "structure" tab at the top of the screen - click that and then scroll to the bottom of the page until you find: http://i1290.photobucket.com/albums/...pse6034c19.png Press go. Then you'll come to a page that looks like this: http://i1290.photobucket.com/albums/...psa2d07fcb.png There, set the values to match those in the example and press "save". 2. In the "adopt.php" file, there should be something like this from lines 29 to 32: PHP Code:
$statname = rand(minimum value,maximum value); Then find this on lines 33 to 34: PHP Code:
PHP Code:
PHP Code:
$statname = rand(minimum value,maximum value) ; and PHP Code:
elseif($mysidia->input->post("shoptype") == "adoptshop"){ Put this under that: $statname = rand(minimum value,maximum value) ; And put this under that: PHP Code:
PHP Code:
$statname = rand(minimum value,maximum value) ; Put this under that: PHP Code:
$mysidia->db->update("owned_adoptables",array("statname" => "value"),"") ; Once that is done, save all changes to the file but don't close it. After that, go to your site and create a quick free adoptable. Adopt that adoptable once. This will update all adoptables in the database to have the set stat. Go back to the "adopt.php" file and delete what you just added or right-click and select "undo". Tada! Please contact me or post in the thread if you have any questions! This includes adding extra stats. The next section shall cover how to display those stats on an adoptable's levelup page. |
Displaying Stats On Levelup Page
This post will cover how to display stats on an adoptable's click page
1. Go to the "class_ownedadoptable.php" file(inside the "classes" folder). There, at the top, there's a bunch of "protected" variables. Add this below them: protected $statname; Add this function to the list of functions below: public function getAdoptstatname(){ return $this->statname; } 2. Got to the "levelup.php" file. On line 29, there should be something like this: $ip = secure($_SERVER['REMOTE_ADDR']); Under that with this: $adoptablestatname = $this->adopt->getAdoptstatname(); On line 33, there's a piece of code like this: PHP Code:
PHP Code:
PHP Code:
PHP Code:
else{ Under that, put: PHP Code:
$document->add($summary); Under that, put: $document->addLangvar($message); Tada! The next section will go over the "stat-raising system". |
Creating Items to Raise Stats
This post will explain how to create items to raise an adoptable's stats.
1. Go to the “item_functions” table in your database. Once there, click the “insert” tab at the top of the page. You should arrive at a page like this: http://i1290.photobucket.com/albums/...ps899d22a0.png Fill out the values to match those in the example and then press “Go”. 2.Go to the “functions_items.php” file in the “functions” folder. Add this item function to the list: PHP Code:
PHP Code:
Tada! The next post shall cover the award system! |
**Squees **
Okay gonna try this out, thank you soooooooo much for this!!! :) |
Would you possibly be able to just upload your modded levelup file? I keep getting errors on that part of the changeover of code!
**Also, is there any way to just get the code for your brilliant and beautiful layout? I really am dying to see this as part of my display, it's gorgeous!! Thank you ! |
Award System
Allowing pets to earn "awards" through training.
1. Go to PHPMyAdmin->your site's database->prefix_owned_adoptables Once there, there should be a "structure" tab at the top of the screen - click that and then scroll to the bottom of the page until you find: http://i1290.photobucket.com/albums/...pse6034c19.png Press go. Then you'll come to a page that looks like this: http://i1290.photobucket.com/albums/...ps25a230e7.png Set the values to match the example shown above and press "save". 2. Remember the item function we made earlier in the "functions_items.php" file? Go there and replace that part of the code with this: PHP Code:
protected $statnamemedalstatus; Add this to the list of functions: public function getAdoptObedienceMedalStatus(){ return $this->obediencemedalstatus; } 4. Go to "levelup.php" and find this piece of code: $adoptablestatname = $this->adopt->getAdoptstatname(); Under that, put: $statnamemedalstatus = $this->adopt->getAdoptStatNameMedalStatus(); PHP Code:
<div id='stats'> Statname: {$adoptablestatname} </div><br> Add: <div id ='trainingawards'><img src='{$mysidia->path->getAbsolute()}picuploads/awards/statnamemedalstatus{$statnamemedalstatus}.png'></div> 5. Awards Folder(Zipped) to your picuploads folder and unzip it. Here are some Photoshop bases you can color if you want to swap out the images provided in the folder: Trophy Base Ribbon Base Medal Base If you need non-photshop bases, please tell me. That's done! Now, you may have noticed that the levelup page might not look as visually-appealing as you want it to be. The next post will take care of that. |
I'm not sure :3
I will take another crack at this today, but I got a white screen when I did the edits on levelup ... maybe someone else can try and see what you get? Might be error on my part pretty easy heheh :) |
Styling The Levelup Page
Styling the levelup page
Ok... just a heads up, I don't really know how to explain this, but I'll give it a shot! So, do you all remember the "div id" stuff we added to the levelup page earlier on?: PHP Code:
#stats { } #trainingawards { } Add CSS code between those brackets to style the boxes the stats and awards are in! I'll make a custom them just for this. :3 Go to this thread for a CSS theme with levelup page styling: Spring Theme |
Oh sure I can test it out for you! No problem! :)
|
^Thanks a bunch! Ehh... it doesn't say what version you're using? Do you think this would work for earlier and later versions?
|
using 1.3.4 ! And it should, but yes using the latest :)
I will see if your levelup works okay on my live site ... and if it does that parts a go! |
^In that case, that MIGHT be the problem since this was made to work with v.1.3.3.
|
^Nevermind! It was probably a mistake on my part- I caught a lot of miswording and issues. But, the first post works right? COuld you check your database for me?
|
Great! I have the level up page ready for download. :3
|
Okay altering adopt and breeding both in the first section cause the dreaded white! page ... I did everything very slowly and carefully and then backtracked. As soon as I inserted '$statname = rand(minimum value,maximum value);' I lost adopt and breeding both!
Even with the table inserted correctly something isn't jibing for the code changes for the first random stats stuff. |
^Does it work for shop? Let me try and work this with my own files...
|
Umm, would you mind showing me your files... there may be another way to do this... anyways, how does the database look?
|
2 Attachment(s)
here's my two files, if you can get this all worked out that will be wonderful ! :)
The Database is fine, it just has the added table -- 15 statname int(4) No 0 Change Change Drop Drop |
^I don't know why, but your file popped up with no changes? Try this for adopt.php:
PHP Code:
|
I wanted to mention that the new levelup code is giving me a white page :(
the adopt code IS working, though! |
^Try this for breeding?:
PHP Code:
|
Breeding works! So we have adopt and breeding working alright.
Levelup still white pages on me ... |
I'll work on level up... can you give me the file again? By the way, are you inserting the code based on the line number or the content? V1.3.4 is different than v1.3.3, so the line numbering and content doesn't match exactly.
|
1 Attachment(s)
I search for it by number but I double check the content ... I've attached the file for levelup.
Named it _1 for the upload, but it's what I was using for levelup.php. |
Umm, the code you got should work:
PHP Code:
|
NOW it's working to insert the stats!! Not sure why haha ...let me see if Levelup is !
EDIT -- still white page, with the levelup code! |
^Oh, wait a minute... for the levelup page, did you use the file I provided? THat's 1.3.3..
|
1 Attachment(s)
I did yes ... I didn't have much luck adding in the code to my own, didn't think of that.
Here's my 1.3.4 levelup file attached .. if you want to see if you can add it and I'll try it! |
Try this:
PHP Code:
|
Nope :(
Still white page .. I am so sorry it's being such a pain |
Try this:
PHP Code:
|
Not working for me still ... anyone else want to try this on a 1.3.4 site?
I really can't imagine what's wrong! |
Does v.1.3.4 have the comment() function?
|
1 Attachment(s)
I'm not sure .. ah, and shop is giving the same error as adopt and breeding were.
I have uploaded the 1.3.4 shop file, if you have time you can alter that when you are able. We're getting there, I'm anxious to get this all working because it's fantastic!! I'm already working on a mod for the mod, to have the mother and father stats combine to be inherited! |
Try this code:
PHP Code:
|
Aww this one didn't work ... and yeah very true, I'll have to change some of the item amounts allowed.
|
Sorry about that - my mistake!
PHP Code:
|
Heeeeey ! Looks like you got it!! YAY!! Thank you!!
If you're able to get Levelup going, I'll test that out ...just let me know. And thank you for all your work on this! |
Hmm, all I need to know is whether or not the comment function would work... either that or, I need to check some v.1.3.4 files.
|
HOF ? You know this PHP far better than I ...what say you ? :)
|
All times are GMT -5. The time now is 03:01 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.