Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Tutorials and Tips

Notices

Reply
 
Thread Tools Display Modes
  #41  
Old 03-27-2017, 11:37 AM
kristhasirah's Avatar
kristhasirah kristhasirah is offline
Member
 
Join Date: Jan 2010
Location: In middle of the nothingness
Posts: 196
Gender: Female
Credits: 28,049
kristhasirah
Default

dont know if you already fixed the code because i dont have a favorite adopt to explore the page i get an error...but here is what i did:

PHP Code:
<?php

class Explorearea1View extends View{    
   
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;
            
$document->setTitle("Forest Path");  
        
$today date("d"); //Day of the month
        
$profile $mysidia->user->getprofile();
            if (
$profile->getFavpetID() == "0"){
            
$document->add(new Comment("<b>You dont have a companion, please come back when you have one</b>"));
        }
        else{
                
$favpet = new OwnedAdoptable($profile->getFavpetID());
                
$name $favpet->getName();
                
$coatiChance rand(1,100);
                
$boarChance rand(1,100);
                
$stepstaken $mysidia->user->exploretimes;
        
// Reset explore counter if the last recorded exploration was on a different day than today: 
            
$reset $mysidia->user->lastday != $today;
        
        
// Allow user to explore if they are under the limit or if reset condition is true.  
            
if ($mysidia->user->exploretimes <= 40 || $reset) {   
                
// Update the last day that they explored to today 
                
$mysidia->db->update("users", array("lastday" => $today), "username = '{$mysidia->user->username}'"); 

                
// If $reset condition was true, reset the count to 1, otherwise increment the existing count.  
                
$updatedExploreTimes $reset $mysidia->user->exploretimes 1;  
                
//$ExploreTimesFix = $mysidia->user->exploretimes - 1;
                 
                
$mysidia->db->update("users", array("exploretimes" => ($updatedExploreTimes)), "username = '{$mysidia->user->username}'");
                
//$mysidia->db->update("users", array("exploretimes" => ($ExploreTimesFix)), "username = '{$mysidia->user->username}'");

          
$document->add(new Comment("<div class = 'scene'><img src='http://orig08.deviantart.net/ccf7/f/2017/038/9/8/forestexplore_by_hoafan-day972y.png' style='width:50%;height:50%;'></div>"));
          
$document->add(new Comment("<b>Steps: {$stepstaken} / 40</b>"));
          
        
// This part gives a coati swirl to the user!
        
if($mysidia->input->post("coati")){
        if(
$coatiChance >= 70) {
        
$species "coati";
        
$document->add(new Comment("The Coati doesn't want to follow, but it gives {$name} an egg instead! It can be found in your pantry"));
        
$newadopt = new StockAdopt($species);
        
$newadopt->append($mysidia->user->username);
        }
        elseif(
$coatiChance 70) {$document->add(new Comment("The coati quickly scurries off; startled by {$name}. Better luck next time!"));}
        }        
        
// This part gives a boarBQ to the user!
        
if($mysidia->input->post("boarBQ")){
        if(
$boarChance >= 80) {
        
$species "boarBQ";
        
$document->add(new Comment("{$name} somehow finds a way to calm its temper, and it gives them an egg! It can be found in your pantry"));
        
$newadopt = new StockAdopt($species);
        
$newadopt->append($mysidia->user->username);
        }
        elseif(
$boarChance 80) {$document->add(new Comment("{$name} runs for their life as the boar charges with sharp tusks!"));}
        }
        
          
//This is where exploration starts!
        
if ($mysidia->user->exploretimes <= 40) {  
            
$random rand(1,100);

            if(
$random && $random 20){
                
$species "Coati Swirl";    
       
                
//adopt's image!
                
$document->add(new Comment("<div class = 'adopt'><img src='http://orig07.deviantart.net/b589/f/2017/070/8/c/csadult_by_hoafan-db1zf6y.png'></div>"));
                
$document->add(new Comment("Woah there! Is that a {$species}? Maybe {$name} can convince it to follow?"));
                
$CoatiForm = new FormBuilder("coatiform""""post");
                
$CoatiForm->buildButton("Try your luck""coati""submit");
                
$document->add($CoatiForm);
            }
            if(
$random >= 21 && $random <= 30){                              
                
$document->add(new Comment("{$name} finds absolutely nothing."));
            }
            if(
$random >= 31 && $random <= 40){            
                
$document->add(new Comment("{$name} accidentally tripped over a stick, but they seem okay."));
            }
            if(
$random >= 41 && $random <= 60){            
                
$document->add(new Comment("{$name} accidentally tripped over a rock, but they seem okay."));
            }
            if(
$random >= 61 && $random <= 70){
                
$species "Boar BQ";
                
$document->add(new Comment("<div class = 'adopt'><img src='http://orig02.deviantart.net/4e8b/f/2017/077/c/e/bbqadult_by_hoafan-db2qlpt.png'></div>"));
                
$document->add(new Comment("Look out, it's a {$species}! It doesn't look too friendly..."));
                
$BoarForm = new FormBuilder("boarform""""post");
                
$BoarForm->buildButton("Try your luck""boarBQ""submit");
                
$document->add($BoarForm);                
            }
            if(
$random >= 71 && $random <= 75){
                
$species "Spaniel Flan";
                
//$newadopt = new StockAdopt($species);
                //$newadopt->append($mysidia->user->username);                
                
$document->add(new Comment("{$name} can hear birds chirping."));
            }
            if(
$random >= 76 && $random <= 79){            
             
$document->add(new Comment("{$name} accidentally tripped over a leaf, but they seem okay."));
            }
            if(
$random >= 81 && $random <= 90){            
            
$document->add(new Comment("{$name} accidentally tripped over a bug, but they seem okay."));
            }
            if(
$random >= 91 && $random <= 99){
            
$amount rand(1,5);
                
$mysidia->user->changecash($amount);
                
$document->add(new Comment("Oh look! {$name} found $ {$amount}!"));
                    }  
            if(
$random == 100){
                
$species "Spaniel Flan";
                
//$newadopt = new StockAdopt($species);
                //$newadopt->append($mysidia->user->username);               
                
$document->add(new Comment("{$name} sees something dart past in the bushes. It was too fast to recognize."));
            }
            else{            
                        
$document->add(new Comment("<a href='/lunarbeach'>Explore?</a>"FALSE));
            }  
        }
//End Explore
            
}//End reset
        
else{
        
$document->add(new Comment("It seems that {$name} explored too much today, why don't you let them rest?"FALSE));
        }   
}
//End of favpet
    
}//End of Index

}//End of Class 
?>
dint notice/had the problem of the 2 steps when testing it on my site... but when the user reach the limit now they get to see the message, and by adding the extra if($random the blank page only appear 1 or 3 times... some times dint get the blank page at all
Also fixed the no favorite pet error... so now a message will be displayed when the user don have a favorite pet. well in my site the code worked fine.
hope this help you =)
Reply With Quote
  #42  
Old 07-16-2017, 07:53 PM
LUC1G07CH1's Avatar
LUC1G07CH1 LUC1G07CH1 is offline
Member
 
Join Date: Mar 2016
Location: Too distant for telling, but it's HUEBR
Posts: 150
Gender: Unknown/Other
Credits: 19,133
LUC1G07CH1 is on a distinguished road
Send a message via AIM to LUC1G07CH1 Send a message via Yahoo to LUC1G07CH1
Default

I tried to do a "explorearea" page and...
Fatal Error: Class ExploreencarsiforestController either does not exist, or has its include path misconfigured!
Reply With Quote
  #43  
Old 07-17-2017, 01:25 PM
LUC1G07CH1's Avatar
LUC1G07CH1 LUC1G07CH1 is offline
Member
 
Join Date: Mar 2016
Location: Too distant for telling, but it's HUEBR
Posts: 150
Gender: Unknown/Other
Credits: 19,133
LUC1G07CH1 is on a distinguished road
Send a message via AIM to LUC1G07CH1 Send a message via Yahoo to LUC1G07CH1
Default Bump...

Stills looking for fixing for this issue
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Quest- Explore System (Open Source) squiggler Tutorials and Tips 4 07-23-2020 12:07 PM
How to create an image map collierox Tutorials and Tips 3 03-13-2018 04:11 AM
Explore Help? cailynmae Questions and Supports 7 03-29-2017 11:37 PM
Help Create This? Abronsyth Templates and Themes 16 10-24-2011 03:05 PM
How to create a a battle system ,shop and currency?? SieghartZeke Questions and Supports 9 11-02-2009 12:15 AM


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

Currently Active Users: 458 (0 members and 458 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636