![]() |
Ok, let's take this step by step.
Try this code on a non-frozen adopt(refresh the page after clicking): PHP Code:
PHP Code:
PHP Code:
|
Ok the first code on a non frozen --- I was able to level and did NOT get the white page of DOOOM.
I refreshed and got this: An error has occurred. Statname: 53 You already leveled this Pet today. You may only Boost a Pet once per day. Please come back tomorrow to Boost this Pet again The *first* code works on frozen and non frozen. The second and third codes, WHITE OUT ... so we are a lot closer :) At least one code works to some degree, not sure what the Statname 53 error is. Was there a formatting supposed to show for this? ( the pretty layout like you have? ) .. I didn't see that, not sure if we have that coded in yet. |
We won't be able to get to that until this levelup thing is fixed - is there a way to do this without the ERROR?! EEEEP!!!
Try this: PHP Code:
|
Okay ...THAT code is working perfect now, no error but:
when you try to click again there is a white page. Possibly there is something we are missing in a lang file? I've noticed that often throws a white page, when that's missing or off ( something in lang ) I see what you mean and it might be the comment thing ... |
Wait, it works but throws a white page at the same time?
|
You can go level once.
The fails before wouldn't even let you do that without white page. If you go back to try to re level, it throws white page now with this latest code. BUT -- The code you had JUST before that ... did work and give the 'already boosted' comment, but it gave that Statname 53 error mentioned too. |
^Does html work in the lang files?
|
Ok the previous code where you posted three, and the first one works?
I just realized what that code is doing! It's pulling the statname result and posting THAT, along with the already leveled message! Let me see if I can fix it ... |
^That's what I did for my site. ^.^ If html works for lang files, I may be able to fix it...
|
1 Attachment(s)
Okay I removed this:
$message = "<div id='stats'>Statname: {$adoptablestatname}</div>"; I've attached what I believe to be a working version of levelup for 1.3.4 and thank you so much for all your help and work !! :) |
Err, it probably would work, but I don't see how it's going to show the stats now...
Try adding this to the lang_levelup file: $lang['already_leveled_title'] = "You already leveled this adoptable today"; Try this code: PHP Code:
|
Nope :(
White page immediately on attempt. No go ..and I really do suspect something with the lang file setting. |
Try this:
PHP Code:
|
Still white page... we really need HOF to help on this possibly.
|
It might be this?
$message = $message .= (restOfCode) Try just $message .= (restOfCode) or $message = $message . (restOfCode) |
Good call but it didn't change it white paging ....good eye though!
|
^Actually, can you link me to the levelup page where it showed as an error... I want to check something. :3
|
|
^Would you mind putting the error code back real quick for me(the one that shows the stats)
|
http://sim-life.com/simpets/stats
from there clicking gives the white page too. I have the error still happening ( as in white page ) for attempting to Boost any of them. You can view the stats themselves in myadopts but you cannot Boost ( levelup ) |
I have to put back the good code now, though, I am opening my sites in a few days and I am crunched for time to get this all ready :)
I am really hoping HOF can possibly swing in here and help, I think this would be a really great mod !! |
^Okay, I still have to wrap up the v.1.3.3 tutorial and my own site. XP
|
The error is probably because in the file it's supposed to throw an exception if the adoptable has already been clicked. In 1.3.4 all pages are separated into two files: One manages the controller (database accesses and verifications) and the other (in the folder view) manages what is shown to the user. The exchange of variables between these files is done through a hashmap. What's happening is that, when the user has already clicked an adoptable, this should throw an exception:
elseif($this->adopt->hasVoter($mysidia->user, $date)){ $message = ($mysidia->user instanceof Member)?"already_leveled_member":"already_leveled_ guest"; throw new LevelupException($message); } And it stops the levelupview.php page from generating text. If you don't throw an exception there, the view file will try to access two variables called Reward and Adopt, which are set by the controller only in the case they pass all conditions: (from levelup.php) else{ //stuff $this->setField("adopt", $this->adopt); $this->setField("reward", new Integer($reward)); } So it's basically trying to use two variables it can't find in the hashmap: (from levelupview.php) $adopt = $this->getField("adopt"); $reward = $this->getField("reward")->getValue(); ----- Maybe try setting both variables at the beginning instead of being inside the else clause? |
^Hmmm... which code would be best to try this with?
|
The guide is now fully updated! :D
|
That's wonderful!! :)
|
I'm going to try and figure out how to do this with v.1.3.4 now... :L
|
This is really great! Please do get it working with the latest version, I love what I'm seeing here!
|
^Oh thank you! Actually, I think everything is compaticle with v.1.3.4(at least the assigning stats to new adopts part). The only part I'm stuck on is displaying information on the levelup page... :3
|
I updated the guide! Promocode adopts can now be assigned stats!(Sorry for forgetting!) Just go to step 4 of the "assigning stats" post and update your code. :3
|
Some of the photos on the first, third, and fourth post no longer are up, would you be able to replace them?
Looks like a super cool mod, at any rate! |
I'd also love to use this mod, but I'm not sure what to enter into the database at the start. ^v^;
|
Me too XD The images no longer work ^_^''
|
Since the images are gone, here's supplementary instructions:
Post 1: Assigning Stats to Created Adoptables Open the owned_adoptables table in your database, go to the second tab at the top, which is Structure, at the bottom right of the page there is a Go button that will, by default, add 1 column at the end of the table. Press it, and on the next page it will ask for field data. For stats that will have number values, intergers, that is, Type INT will suffice: Name: statname, Type: INT, Length/Values: 11(If you want a default value, then select 'As defined' in the Default dropdown and supply a value in the new text box provided below it. This will ensure this default value to all pre-existing adoptables.) Reminder: Whatever statname you choose, you will need to change it in ALL files we're changing, so search for 'statname' in the material this mod is adding and replace it with your own stat's name. Continue following the steps on Post 1, starting with Step 2. Post 2: Display Stats on an Adoptable's Click Page For Mysidia v1.3.3, follow instructions in the original Post 2. For Mysidia v.1.3.4, the line numbers are wrong, and some things may be difficult to find. If there are questions on the instructions here, let me know and I'll add a write up. Post 3: Creating Items to Raise Stats Open up your database. In the items_functions table, make note of how many rows there are (check out the ifid column for help), hit the word Copy on the row holding the Level1 function. Fill in the first blank with the next number. If you had 13 item functions, this will be 14. Since this is a copy of Level1, rename it. The original instructions imply naming it Statname. The description you can fill in here is mostly for your sake on the admin side of things, and won't be seen by your users. Continue following the steps on Post 3, starting with Step 2. Post 4: Rewards Through Training Open the owned_adoptables table in your database, go to the second tab at the top, which is Structure, at the bottom right of the page there is a Go button that will, by default, add 1 column at the end of the table. Press it, and on the next page it will ask for field data. I'm not exactly sure on the data being inserted here, but I think this will do it??? Name: statnamemedalstatus, Type: VARCHAR, Length/Values: 11Continue on starting at Step 2, however, Wallie's Step 3 is just an example with a statname of Obedience, yours should be: public function getAdoptStatNameMedalStatus(){return $this->statnamemedalstatus;} Best of luck! |
Thank you! ^_^
|
I'd still like to see an example image of the stats since the original images no longer work.
|
Wallie's site is still up and running, you can find a link to it her signature. Pick a random pet to view, then click the first link (or refresh the page) and you'll see a live example.
|
Looks awesome!
If nobody minds, I've added a screenshot of what I see on the little fuzzies page http://i.imgur.com/AmNBYDd.png |
For users who want to use this with Mys 1.3.4 there are some adjustments you'll need to make. Firstly, in the first post step 3:
Instead of shop.php, you'll want to go into the file .../classes/class_stockadopt.php, and around line 66 you should see some variables being defined; PHP Code:
PHP Code:
And then in the string that starts with PHP Code:
PHP Code:
I will edit this post as I continue adapting it to 1.3.4 :) |
In v1.3.4, adoptables are created in five places - adopt.php, admincp/ownedadopt.php, classes/class_breeding.php, classes/class_promocode.php and classes/class_stockadopt.php. You'll want to add stats in all these places.
Otherwise, everyone should be sure to reference this post from a few up (in it, the post numbers are links to the original versions of posts). I installed on v1.3.4 and really the only thing that changed were line numbers. It's better to search for exact contents than rely on line numbers!! Oh, and in addition to just number stats, you can also give a pet a random personality, for example -- PHP Code:
|
All times are GMT -5. The time now is 05:56 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.