Author Topic: SMFPets Version 0.2  (Read 162055 times)

Offline breezy

Re: SMFPets Version 0.2
« Reply #135 on: September 05, 2007, 03:17:23 am »
I have read the topic backwards and forwards, but I still do not see where its stated where the link is actually located in one of the PHP files.  If someone can point me to which file i can find it I believe I can fix it myself or at least make an attempt at it or get someone who can.  Thanks!!! 

Ok.. nevermind on this one.. I found it.  It's in the shop_pets php file.
« Last Edit: September 05, 2007, 05:36:53 am by breezy »

Offline breezy

Re: SMFPets Version 0.2
« Reply #136 on: September 05, 2007, 05:57:31 am »
hmm... dunno.

wrong "food.php" is the only thing i can think of... anyway... I just made this and figured i could share it... if you all want...

Code: (Top Pet) [Select]
global $boardurl, $db_prefix, $scripturl;

$result = db_query("
SELECT name, level, age, ownerid, breed
FROM {$db_prefix}shop_pets
ORDER BY level
DESC LIMIT 0,1", __FILE__, __LINE__);

$StrongestPet= mysql_fetch_assoc($result);

$ForumMember = mysql_query("
SELECT realName
FROM {$db_prefix}members
WHERE ID_MEMBER = $StrongestPet[ownerid]");
$MemberName = mysql_fetch_assoc($ForumMember);

echo '
   <table width="100%" height="100%">
     <tr>
        <td align="center">'.$StrongestPet['name'].' the '.$StrongestPet[breed].'
        </td>
     </tr>
        <td align="center">
            <img src="'.$boardurl.'/Sources/shop/pet_images/'.$StrongestPet[breed].'.gif">
        </td>
     </tr>
     <tr>
        <td align="center">
             Level:'.$StrongestPet['level'].'
        </td>
     </tr>
     <tr>
     <tr>
       <td>
         Owner: <a href="'.$scripturl.'?action=profile;u='.$StrongestPet['ownerid'].'">'.$MemberName['realName'].'</a>
       </td>
     </tr>
</table>';

(click on attachment to view a preview.)... It requires people to have their pets images the same name as the breed...
Does this code go in a PHP file of it's own or is it in addition to?
« Last Edit: September 05, 2007, 06:07:23 am by breezy »

Offline breezy

Re: SMFPets Version 0.2
« Reply #137 on: September 05, 2007, 06:02:32 am »
OK.. when creating new pets, do I change  the following code lines to something different?  I would think you would have different ones per pet.  And if so which file corresponds with the pet breed?   We tried this on a site and changed the two lines thinking that it should correspond with the type of pet and it errored out.

Code: [Select]
<?php

if (!class_exists('pet_Bunny')) { //Make sure name matches php file

class pet_Bunny extends petTemplate //Make sure name matches php file

function load_breed()
« Last Edit: September 05, 2007, 06:04:17 am by breezy »

Offline breezy

Re: SMFPets Version 0.2
« Reply #138 on: September 05, 2007, 08:25:34 am »
I have read the topic backwards and forwards, but I still do not see where its stated where the link is actually located in one of the PHP files.  If someone can point me to which file i can find it I believe I can fix it myself or at least make an attempt at it or get someone who can.  Thanks!!! 

Ok.. nevermind on this one.. I found it.  It's in the shop_pets php file.
 

OK.. I just thought I was done with this.  When I updated the link to reflect my site, it gave a 404 error and says the file showpets can not be found.

Offline jjyy2006

Re: SMFPets Version 0.2
« Reply #139 on: September 13, 2007, 12:57:14 am »
hello!! i'm new here ,i got an error  when I  feed my pet and got this message:

Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' happy = happy + 1 WHERE pet_id = 2 AND ownerid = 1' at line 1
File: /home/arsforum/public_html/forum/Sources/shop/items/Food.php
Line: 83

i don't know how to fix it,please help me. Thanks


Offline jjyy2006

Re: SMFPets Version 0.2
« Reply #140 on: September 14, 2007, 05:31:09 pm »
The only thing that springs immediately to mind is that there were some old food item versions around that wouldn't now work with the latest pets mod version...perhaps you'd make sure that you're using the one from the latest version's pack.

BTW...it's 3 in the morning here so even a night-owl like me needs some sleep...off to zzzzzz see you on the morrow.

i install is newest version 0.2 but still got same error ,where to download the new food.php?

Offline J-xToF

Re: SMFPets Version 0.2
« Reply #141 on: September 17, 2007, 05:34:46 am »
Maybe there should be a thread where people could share their pets, we other users could add those pets in their shop.
Im not too creative in those pet stuff lol.
And the original pictures of the starter pets is sure really plain. =[
ha! ill try to get some nicer pics.. maby some cartoon gifs.

I would also like to ask to an addition.
I would like the pet to be displayed in the post profile. (under avatar etc)
« Last Edit: September 17, 2007, 06:12:37 am by J-xToF »

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #142 on: September 17, 2007, 07:31:41 am »
To clear up a question someone asked me, I have no problems if someone wants to pick up this project and add improvements and what not, as long as common sense is used I am properly credited for what I did and you don't actually sell my code.

Quote
OK.. when creating new pets, do I change  the following code lines to something different?  I would think you would have different ones per pet.  And if so which file corresponds with the pet breed?   We tried this on a site and changed the two lines thinking that it should correspond with the type of pet and it errored out.
Code: [Select]
<?php

if (!class_exists('pet_Bunny')) { //Make sure name matches php file

class pet_Bunny extends petTemplate //Make sure name matches php file

function load_breed()

Saw you wanted a pet called "Bunny". Then you would use

Code: [Select]
<?php

if (!class_exists('pet_Bunny')) { //Make sure name matches php file

class pet_Bunny extends petTemplate //Make sure name matches php file

function load_breed()

and call the pet file Bunny.php

If you wanted a pet "Ninja" you would change the above code to
Code: [Select]
<?php

if (!class_exists('pet_Ninja')) { //Make sure name matches php file

class pet_Ninja extends petTemplate //Make sure name matches php file

function load_breed()

and call in Ninja.php.

Basically, it works the same way as it does for items =)
Arrrrr!

Offline inkstains

Re: SMFPets Version 0.2
« Reply #143 on: September 17, 2007, 03:39:08 pm »
so are you no longer working on smfpets basil? that's a shame, i was looking forward to battling these little bastards and any other improvements. it's been a cool mod cheers for all your hard work.

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #144 on: September 17, 2007, 11:51:25 pm »
I am not abandoning the project, I just realize I havn't touched it in a couple of months, realize that I likely won't touch it for a while longer, and wanted to give anyone who wanted to a green light to do more stuff with it. Someone had pmed me to ask if they could upgrade the code, so thats why I was clearing that up here.  O0
Arrrrr!

Offline J-xToF

Re: SMFPets Version 0.2
« Reply #145 on: September 18, 2007, 12:26:45 pm »
Actually it was me, as people were looking for this mod at smf community and the only 1 available is this one.
I know nothing of php but i might start learning some. 

But you need a lot of creativity creating those pets.  =/

Something i would like to ask about the pet skills, they dont actually do something do they?
Its just a random skill name and description right? (so i yes that means that i can put any random skills that comes up in my imagination)

Offline inkstains

Re: SMFPets Version 0.2
« Reply #146 on: September 18, 2007, 01:35:12 pm »
Actually it was me, as people were looking for this mod at smf community and the only 1 available is this one.
I know nothing of php but i might start learning some. 

But you need a lot of creativity creating those pets.  =/

Something i would like to ask about the pet skills, they dont actually do something do they?
Its just a random skill name and description right? (so i yes that means that i can put any random skills that comes up in my imagination)

the pets skill actually does do stuff. depending on how the pets skills are setup and how much AP the pet has as well as it's current level will effect which skill the pet can use

say a pet had a MAXAP and CURAP of 6 with a current level of 2 enabling them to use the below two skills which have an cost of 2 and 4 AP respectively. to use.the first skill below  would generate a random amount of shop credits for the owner of the pet and you could make up a short description of what the pet did to enact the owner receiving the store credits.

Code: [Select]
 
        function use_skill_1() {
global $db_prefix, $ID_MEMBER;
$value = mt_rand(1,125);
$result = db_query("UPDATE {$db_prefix}members SET money = money + {$value} WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return "{$this->name} broke into grumpys store dropping loot all the way back to his den which you pick up scoring yourself ".formatMoney($value)."";
}

so the owner of the pet would receive a message like:

"pets name" broke into grumpys store dropping loot all the way back to his den which you pick up scoring yourself  "random shop credit amount"

the pets CURAP is now 4 and the user has received a  "random amount of credits"

now lets say the user enacted the below skill

Code: [Select]
function use_skill_2() {
global $db_prefix, $ID_MEMBER;
$value = mt_rand(1,20);
$result = db_query("UPDATE {$db_prefix}members SET karmaGood = karmaGood + {$value} WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
return "you taught {$this->name} a valuable life lesson and recieved ".($value)." karma for your good deed";
        }

they would recieve a message like:

you taught "pets name" a valuable life lesson and received  "random amount of" karma for your good deed

now the pets CURAP would be zero and the user has received a random amount of karma

if the pet is not in training it is time to put the pet in training. with training your pets CURAP is refilled and depending on level gained may increase the pets MAXAP as well.

then the cycle begins over again once training is complete users use the skills available depending on the pets level CURAP and so on and so forth.

so basically you can set up skills that do just about anything you want they could be skills that add to the total time the user has been online or change their custom title you can make the skills not accessible until a certain level or you can make them all accessible at once with each one just requiring more AP than the previous

sorry for the long winded explanation but best to explain it all, mind you this is just as i understand it i've probably missed something or whatever but that's the basic gist of it. to my understanding.

also i'm gonna throw up a pet pack i put together later i just have to package it all up.



EDIT: also change AP over to SP as i think that was changed in SMFPets 0.2
« Last Edit: September 18, 2007, 02:17:10 pm by inkstains »

Offline J-xToF

Re: SMFPets Version 0.2
« Reply #147 on: September 18, 2007, 08:41:19 pm »
Quote
so basically you can set up skills that do just about anything you want they could be skills that add to the total time the user has been online or change their custom title you can make the skills not accessible until a certain level or you can make them all accessible at once with each one just requiring more AP than the previous

Hmm now i get it. But as i dont know how to code, all my pets have the same skills  >_<
Same skill effects but different workings lol.


Quote
also i'm gonna throw up a pet pack i put together later i just have to package it all up.
Yay thanks.  =]

Offline Basil Beard

Re: SMFPets Version 0.2
« Reply #148 on: September 20, 2007, 10:48:19 am »
If you want a skill to do something, like with items, feel free to ask here and maybe one of us can code up teh skill for you.  O0
Arrrrr!

Offline Alundra

Re: SMFPets Version 0.2
« Reply #149 on: September 28, 2007, 09:42:14 am »
when i try to use the skills it says its a hacking attempt....how do i fix that?