Author Topic: SMFPets is Finally Here (0.1 out)  (Read 103231 times)

Offline Basil Beard

Re: SMFPets is Finally Here
« Reply #60 on: March 06, 2007, 10:33:46 pm »
I think the error is in the food item I included. I remember fixing it, but I don't think I fixed it before the last release. I'll fix it in the next release(hopefully in a few days) but for now, just do replace the whole getUseInput() function with this::

Code: [Select]
function getUseInput()
{
global $db_prefix, $ID_MEMBER;

$result = db_query("SELECT numpets FROM {$db_prefix}members WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);
$row = mysql_fetch_assoc($result);
if ($row['numpets'] == 0) {
return "You have no pets. Using this item will simply cause it to die and you to lose money.";
}
$string .= "<select name = 'petid'>";
$result = db_query("SELECT * FROM {$db_prefix}shop_pets WHERE ownerid = {$ID_MEMBER}", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($result)) {
$string .= "<option value = '{$row['pet_id']}'>{$row['name']}</option>";
}
$string .= "</select>";
return "Select a pet to give this item to: ".$string;
}
Arrrrr!

Offline littleone

Re: SMFPets is Finally Here
« Reply #61 on: March 07, 2007, 12:49:34 am »
ok, first the two files, one restores used akill points rather than wait until the next day...the max ap (skill oints) raises the maximum number of skill points your pet can have.


Ok I am still confused.  The Pets come with a Max skill points they have?  Where is that set, I didnt notice any such thing.  My last skill (of 4 skills) on one of my pets requires 20 points.  So i am a bit confused as to the difference between the max and the cur.  Basically the owner would need 20 points to reach the final skill.  Is there a limit someplace that would stop them from reaching 20 unless they used the one to raise the maxap?

Thanks

Code: [Select]
<?php
if (!class_exists(pet_Siamese_pet)) { //Make sure name matches php file
class pet_Siamese_pet extends petTemplate //Make sure name matches php file
function load_breed() {
$this->breed 'Siamese Cat'//The name of the breed(Use _ instead of whitespace or else Baby Jesus will cry)
$this->breed_desc 'This is a Siamese Cat'//The description of the breed.
    
$this->price 2000//The price to purchase one of these pets
    
$this->breed_img 'siamese.gif'//The img file of the breed
    
$this->skills_cnt 4//The number of skills the pet can use
        
    //Sample skill. For each addtional skill, increase the index by one.(So your next skill would be $this->skill[1])
$this->skill[0] = new skill;       //Required for making new skills. 
$this->skill[0]->name "Purr";   //Name of skill
$this->skill[0]->level_learn 1;  //Level the pet learns the skill
$this->skill[0]->level_max 2;    //Level the pet masters the skill
$this->skill[0]->cost 1;         //Cost, in skill points, of the skill.
$this->skill[1] = new skill;
$this->skill[1]->name "Use Litter Box";
$this->skill[1]->level_learn 2;
$this->skill[1]->level_max 4;
$this->skill[1]->cost 3;
$this->skill[2] = new skill;
$this->skill[2]->name "Tree Climb";
$this->skill[2]->level_learn 5;
$this->skill[2]->level_max 10;
$this->skill[2]->cost 8;
$this->skill[3] = new skill;
$this->skill[3]->name "Premier Cat Show Worthy";
$this->skill[3]->level_learn 10;
$this->skill[3]->level_max 20;
$this->skill[3]->cost 20;
}

//Sample skill function. A different function is needed for each skill. Skill function should be named "use_skill_i" where i is that skills index.
//Code these skills like you would code the action part of items. Currently input cannot be given into skills. Sorry.
function use_skill_0() {
global $db_prefix$ID_MEMBER;
return "{$this->name} has learned to Purr!";
}
function use_skill_1() {
global $db_prefix$ID_MEMBER;
$value mt_rand(30,600);
$result db_query("UPDATE {$db_prefix}members SET money = money + {$value} WHERE ID_MEMBER = {$ID_MEMBER}"__FILE____LINE__);
return ($this->name 'learned to use the litter box and "materialized"' formatMoney($value) / ' tokens for you!');
}
        function 
use_skill_2() {
global $db_prefix$ID_MEMBER;
$value mt_rand(80,1600);
$result db_query("UPDATE {$db_prefix}members SET money = money + {$value} WHERE ID_MEMBER = {$ID_MEMBER}"__FILE____LINE__);
return "{$this->name} climbs a near-by tree and drops down ".formatMoney($value)." tokens!";
}
function use_skill_3() {
global $db_prefix$ID_MEMBER;
$value mt_rand(200,4000);
$result db_query("UPDATE {$db_prefix}members SET money = money + {$value} WHERE ID_MEMBER = {$ID_MEMBER}"__FILE____LINE__);
return "{$this->name} place in a Premier Cat Show and earned you ".formatMoney($value)." tokens!";
}
}
}
?>

Offline perplexed

Re: SMFPets is Finally Here
« Reply #62 on: March 07, 2007, 01:00:58 am »
Thanks Basil Beard. :)

Also, about the Pet Central problems, this should fix it:

In Pet Engine Find:
Code: [Select]
<img border='0' width='120' height='120' src='".$boardurl."/Sources/shop/pet_images/".$this->breed_img."' alt='".$this->breed."' />Replace with:
Code: [Select]
<center><img border='0' src='".$boardurl."$boardurl."[b]/[your forum directory[/b]]/Sources/shop/pet_images/".$this->breed_img."' alt='".$this->breed."' /></center>I'm not 100% sure it'll fix it, but it will also make the image not resize and will be centered. Also do it for both codes you find.

If my fix doesn't work try:
$boardurl."/$sourcedir/shop/pet_images replacing with $boardurl."/[your forum directory]/Sources/shop/pet_images

Edit-
Also for the rest of the image resizing:

Find in Shop Pets:
Code: [Select]
<img border='0' ' src='".$boardurl."/Sources/shop/pet_images/".$pet->breed_img."' alt='".$pet->breed."' />Replace with:
Code: [Select]
<center><img border='0' ' src='".$boardurl."/Sources/shop/pet_images/".$pet->breed_img."' alt='".$pet->breed."' /></center>


I can't get this to work,  I get parse errors:

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/mysite/public_html/testforum/Sources/shop/pet_engine.php on line 76

I still have no pet pictures in pet central   :'( :'(

hi

is there a solution for this as I cant release it on a live forum until its resolved?  I tried the above code but it didnt work, any other help appreciated

~Thanks
Estne volumen in toga, an solum tibi libet me videre?

Offline Basil Beard

Re: SMFPets is Finally Here
« Reply #63 on: March 07, 2007, 02:52:24 am »
ok, first the two files, one restores used akill points rather than wait until the next day...the max ap (skill oints) raises the maximum number of skill points your pet can have.


Ok I am still confused.  The Pets come with a Max skill points they have?  Where is that set, I didnt notice any such thing.  My last skill (of 4 skills) on one of my pets requires 20 points.  So i am a bit confused as to the difference between the max and the cur.  Basically the owner would need 20 points to reach the final skill.  Is there a limit someplace that would stop them from reaching 20 unless they used the one to raise the maxap?

Thanks

Curap gets consumed whenever you use a skill. If you have 6 curap and you use a skill that costs 3 sp you current skill points will drop to 3.
Each night, curap recharges to whatever maxap is. So if your maxp is 6, then no matter how many sp you used, your curap will start the new day at 6. It cannot get any higher than maxap.

Maxap can be increased in a number of ways--you can increase it via levels, via items, or maybe even by skills. The code is set up so that it increases by level---but you can easily change that.  O0
Arrrrr!

Offline xfollowthereaperx

Re: SMFPets is Finally Here
« Reply #64 on: March 07, 2007, 07:31:50 am »
Hello guys, is there any updates packaged? I'm a little confused with all the codes going around and I'd like to use some of the new things like viewing people's pets

Offline Aruta

Re: SMFPets is Finally Here
« Reply #65 on: March 07, 2007, 07:43:31 pm »
I'm a little confused with all the codes going around and I'd like to use some of the new things like viewing people's pets

Ya dont have to code dude. You van view peoples pets bij clikcing on their forum name en clicking on the "view pet" link beneath their profile.

Offline xfollowthereaperx

Re: SMFPets is Finally Here
« Reply #66 on: March 08, 2007, 06:29:07 am »
I'm a little confused with all the codes going around and I'd like to use some of the new things like viewing people's pets

Ya dont have to code dude. You van view peoples pets bij clikcing on their forum name en clicking on the "view pet" link beneath their profile.

Whose forum has it?  :P

Offline Basil Beard

Re: SMFPets is Finally Here
« Reply #67 on: March 08, 2007, 10:10:18 am »
You need to have the default skin. If you don't--just look at the profile.template file for the default skin and manually apply the same changes to your skin.
Arrrrr!

Offline blitzchic

Re: SMFPets is Finally Here
« Reply #68 on: March 08, 2007, 01:09:35 pm »
Hi everyone, maybe its a stupid question, but how do we feed our pets?

Offline TechnoDragon

Re: SMFPets is Finally Here
« Reply #69 on: March 08, 2007, 01:17:26 pm »
using either basil beards food item or the one i created
Don't tell me to get into shape...I have a shape...It is round!


Offline blitzchic

Re: SMFPets is Finally Here
« Reply #70 on: March 08, 2007, 02:44:42 pm »
Sorry Technodragon - I am still unsure how to do that!

I have uploaded food.php .. but theres no drop down menu anyway to feed my pet :(

Offline TechnoDragon

Re: SMFPets is Finally Here
« Reply #71 on: March 08, 2007, 09:37:21 pm »
Ahhh, then THAT would appear to be an error then!

don't suppose you could post a screen shot of when you are trying to use the item to feed your pet?
Don't tell me to get into shape...I have a shape...It is round!


Offline Basil Beard

Re: SMFPets is Finally Here
« Reply #72 on: March 08, 2007, 11:50:08 pm »
Like I have said, I donno how Techno's food item works, but mine had a glitch. I appear I showed how to fix it a few pages ago.
Arrrrr!

Offline Aruta

Re: SMFPets is Finally Here
« Reply #73 on: March 09, 2007, 02:59:50 am »
Like I have said, I donno how Techno's food item works, but mine had a glitch. I appear I showed how to fix it a few pages ago.

Well this fix works great  for me. My pets can eat again!  :)
Thanx man.
« Last Edit: March 09, 2007, 03:07:03 am by Aruta »

Offline xfollowthereaperx

Re: SMFPets is Finally Here
« Reply #74 on: March 09, 2007, 05:01:45 am »
You need to have the default skin. If you don't--just look at the profile.template file for the default skin and manually apply the same changes to your skin.
Im not sure if you're talking to me but I just looked at my default skin and it didn't have view pets

I installed the 0.0 pets without adding any codes or modifying anything