Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.3.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=42)
-   -   Mys v1.3.x Stat/SKill System (http://www.mysidiaadoptables.com/forum/showthread.php?t=4563)

Abronsyth 01-12-2016 07:17 PM

Now if only I could get the stat value to show in from the levelupview.php file, haha (unfortunately {$adopt->getStatname()}, {$this->adopt->getStatname()}, and {$statname} do not work, though {$statname} works just fine in the levelup.php file).

Ooh, that's a cool idea, Kyttias!

Kyttias 01-12-2016 07:48 PM

Try {$adopt->statname}?

Abronsyth 01-12-2016 08:16 PM

Ended up with this error;
Fatal error: Cannot access protected property OwnedAdoptable::$magic in /home/catisserie/public_html/view/levelupview.php on line 27

(magic being the name of the stat)

Still trying several things to try to work around it.

Kyttias 01-12-2016 10:01 PM

In classes/class_ownedadoptable.php add public $magic; to the variables at the start.

Abronsyth 01-13-2016 06:40 AM

Well, it's not coming up with an error now, but instead it's simply displaying a blank where the data should be displayed.
(.../view/levelupview.php):
PHP Code:

    public function click(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;                
        
$adopt $this->getField("adopt");
        
$reward $this->getField("reward")->getValue();
        
$document->setTitle("{$this->lang->gave} {$adopt->getName()} one {$this->lang->unit}");
        
        
$image $adopt->getImage("gui"); 
        
$image->setLineBreak(TRUE);        
        
$summary = new Division;
        
$summary->add($image);    
        
$summary->add (new Comment("<ul>
                                        <li><b>Name:</b> 
{$adopt->getName()}</li>
                                        <li><b>Owner:</b> <a href='/profile/view/
{$adopt->getOwner()}'>{$adopt->getOwner()}</a></li>
                                        <li><b>Birthday:</b> 
{$adopt->getBirthday()}</li>
                                        <li><b>Type:</b> 
{$adopt->getType()}</li>
                                        <li><b>Sex:</b> 
{$adopt->getGender()}</li>
                                        <li><b>LVL:</b> 
{$adopt->getCurrentLevel()}</li>
                                        <li><b>Total EXP:</b> 
{$adopt->getTotalClicks()}</li> 
                                        <li><b>Magic:</b> 
{$adopt->magic}</li>
                                    </ul>"
));
        
$summary->add(new Comment("{$this->lang->gave}{$adopt->getName()} one {$this->lang->unit}."));
        
$summary->add(new Comment($this->lang->encourage));
        
$summary->add(new Comment("<br> You have earned {$reward} {$mysidia->settings->cost} for leveling up this cat. "));
        
$summary->add(new Comment("You now have {$mysidia->user->getcash()} {$mysidia->settings->cost}"));
        
$document->add($summary);            
    } 

And, just to make things even more fun, I'm also having a funny issue with the item that raises the stat. For some reason instead of adding +1 to the stat, it sets the stat itself to 1. I'll play around with this, though, and see if I can get it to work by studying the other functions more.

Edit:
OK, I got the function to work by doing this;
PHP Code:

 function items_magic($item$adopt){
  
$mysidia Registry::get("mysidia");
  
$magic $mysidia->db->select("owned_adoptables", array("magic"), "aid='{$adopt->aid}'");
  
$newmagic $magic $item->value;
  
$mysidia->db->update("owned_adoptables", array("magic" => $newmagic), "aid='{$adopt->aid}'and owner='{$item->owner}'");
  
$note "By using {$item->itemname}, the cat's magical skill has raised by {$item->value}! This cat now has {$newmagic} skill!<br>";
    
//Update item quantity...
  
$delitem $item->remove(); 
  return 
$note;


So at least I fixed that issue ^^

Kyttias 01-13-2016 09:36 AM

*shrug* Bizarre. This is exactly what I use for my pet's personality (so, same concept of rendering it to levelupview.php):

Code:

This is a {$adopt->size}-sized, {$adopt->nature} {$adopt->type} that likes {$adopt->likes} and dislikes {$adopt->dislikes}.
Keeping in mind that in just levelup.php it has to be:

Code:

This is a {$this->adopt->size}-sized, {$this->adopt->nature} {$this->adopt->type} that likes {$this->adopt->likes} and dislikes {$this->adopt->dislikes}.
Because it wants the '$this' involved.

If you really wanted to you could create a function by copying over one of the existing ones in class_ownedadoptable.php but it seems really redundant.

Then again, I also display my birthdays with just $adopt->birthday and you should also really be able to call gender with just $adopt->gender (after making it no longer protected). At least in v1.3.4, because of how things pull from the database. Basically any column name should be able to show up this way. Check if there's value in it for that specific adopt???

Abronsyth 01-13-2016 04:50 PM

There is indeed a value in for that adopt (and for all of them I've tested), but it simply will not show up (though it does show up when I re-visit that adopt so it loads the "you've already seen this pet today" page). I've even tried adding the function to the levelupview.php page. I'm having the same issue with displaying the "medals" with the levelupview.php file, as well. What's really odd is that I use {$adopt->getBirthday();} to show the adoptable's birth-date, and that shows up just fine, so I do not understand why {$adopt->getMagic();} isn't working, since they're both defined in all the same places, the same way in class_ownedadoptable.php:
PHP Code:

    public function getBirthday(){
        return 
$this->birthday;
    }
    
    public function 
getMagic(){
        return 
$this->magic;
    }
    
    public function 
getMagicMedalStatus(){
        return 
$this->magicmedalstatus;
    } 


aiiree 03-24-2016 05:51 PM

Does anyone have a copy of the screenshots for this mod since the images aren't avalible in the first post?

:)

Ittermat 03-24-2016 06:03 PM

Heres the post kyttias made to try to help explain the parts from the images

http://mysidiaadoptables.com/forum/s...0&postcount=74

aiiree 03-25-2016 10:27 AM

Thank you!

Sorry, Is there a way to have more than one stat, would I just add another colum or would it change the directions? I'm fairly new thisthis so I'm not really sure.


All times are GMT -5. The time now is 06:06 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.