#1
|
||||
|
||||
Exploration System
Alright, so a while ago I took it upon myself to try and figure out a simple exploration script. Just something easy, where my members could look for items or pets, and I thought I'd share the script with you all.
The system is; + Non cheatable. Most people won't be able to figure out how to save at a certain point + Simple - very little coding is used. No huge thing to walk through. + Can be embedded in any layout + RANDOM - this is a non-narrated adventure. So yeah, this actually wasn't very hard to make, the hardest part was finding a random link selector. I consider it rather easy to edit, but HOWEVER: there is a downfall to the easy to edit part - the "randomly selected" thing is included in the header of every individual page - I advise you mass edit, which I'll go over later. LET'S GET TO IT SHALL WE? So, to start, you'll need the page itself. Go and find your blank.php and copy it. Rename it whatever you want - for this, we'll go with "explore.php". Between the "START SCRIPT" and "OUTPUT PAGE" things, place this: Code:
$article_title = "Explore The Forest"; $article_content = "<div style='text-align:left;'>You have decided to take some of your pets exploring down in the park. It's a beautiful day and you'd just love an adventure right about now...</div><br /><br><iframe src='http://yoursite.com/explore/0.html' frameborder='0' height='400' width='700'></iframe> "; Step two, is to change what it says up there. That's a copy of what's on my site and I'll be very upset if you don't change it. You'll want to change... - Title ($article_title = "Explore The Forest") - Content (You have decided to take some of your pets exploring down in the park. It's a beautiful day and you'd just love an adventure right about now...) - Width (width='700') - URL (http://yoursite.com/) Step Three. Create a directory, folder or whatever your host is calling them. Call it something like "Explore" or "Explore Pages" - we'll just go with "Explore". Step Four. Take this file below here and make a page titled "0.html" in your "Explore" folder. Code:
<html> <head> <script type="text/javascript"><!-- var links = new Array(); links[0]="1.html"; links[1]="2.html"; links[2]="3.html"; links[3]="4.html"; links[4]="5.html"; links[5]="6.html"; links[6]="7.html"; links[7]="8.html"; links[8]="9.html"; links[9]="10.html"; function getRandomLink() { var randomNum = Math.floor(Math.random()*links.length); window.location = links[randomNum]; } //--></script> </head> <body> Insert little welcome message about how everyone is happy and the sun is shining, and ask which way they'd like to go. <br><br><br><br><br> <table border="0" align="center"> <tr align="center"> <td></td> <td><form name="" action=""> <input type="button" value="Go Ahead!" onclick="getRandomLink()" /> </form></td> <td></td> </tr> <tr> <td><form name="" action=""> <input type="button" value="Go Left!" onclick="getRandomLink()" /> </form></td> <td></td> <td><form name="" action=""> <input type="button" value="Go Right!" onclick="getRandomLink()" /> </form></td> </tr> <tr align="center"> <td></td> <td><form name="" action=""> <input type="button" value="Go Back!" onclick="getRandomLink()" /> </form></td> <td></td> </tr> </table> </body> <html> So, for the rest, you'll want to make ten copies of this 0.html page, and name them 1.html, 2.html, etc, etc. Then give each of them a different message. Most of them won't be much of anything - to increase the odds of getting certain messages, repeat them. So you can have nine messages about a weird looking flower and one about finding a rare pet under said flower. And that's it! Almost. Just a quick note that I said I would say; Mass editing. As you can see, the link selector is placed in the header of every single page. I wasn't sure how to put it in its own file (that'll be an update somewhere in the future). So if you plan to have fifty pages, I would recommend writing out fifty, pasting it into your ten and then just slowly making the pages afterwards, with the fifty links already in. Also, if you want to say, add ten or twenty pages in the future, don't do them one by one, do them all at once and add the links all at once. Tedious, I know, but hey - if you don't like it, don't use it. So yeah, now I'm done. Hopefully it wasn't too confusing. Hopefully I can edit this over time and make it a little better. Credit would be nice - I didn't put it in the script anywhere, but maybe if you want to mention somewhere that Gloometh made the script, that'd be nice. If you've got an questions, suggestions, complaints, feel free to post them.
__________________
Last edited by AlexC; 03-12-2012 at 01:11 PM. |
#2
|
||||
|
||||
If i find the time will try this.. good job though!
__________________
https://gemnode.com Free Hosting for Mysidia Adopt Sites Just join our forum and request your free hosting account |
#3
|
||||
|
||||
Thanks - it's a little time consuming to write out, but otherwise pretty easy.
|
#4
|
|||
|
|||
why not try PHP instead?
PHP Code:
__________________
Need coding help? send me a PM! :) Last edited by mapleblade; 03-13-2012 at 02:52 AM. |
#5
|
||||
|
||||
I don't know that much about php, so I can't really code form scratch...
|
#6
|
|||
|
|||
ah.. well my script shoud work if you want to use it :)
__________________
Need coding help? send me a PM! :) |
#7
|
||||
|
||||
I'll stick with my version, because taking yours would mean I really didn't make it. Feel free to post yours though.
|
#8
|
||||
|
||||
From what I can tell, it would generate pages saying something like "you found a pet/item/coin" and a link to continue exploring but I don't see how it would actually give people anything.
Also, in the blank.php I don't see anything to do with "START SCRIPT" and "OUTPUT PAGE" Only: Code:
<?php class BlankController extends AppController{ public function __construct(){ parent::__construct(); } public function index(){ } } ?>
__________________
Failing at being normal since 1990. Last edited by AndromedaKerova; 12-06-2014 at 03:26 PM. |
#9
|
||||
|
||||
This thread was made for an earlier version of Mysidia and pages are not rendered in the same way anymore.
I know that in 1.3.4 that for each page there are two: one to hold complex code, and one to render the page. It's helpful to bounce to a second file for complex code, especially when forms are involved. I don't actually know how to get around having two files, even though one is fundamentally going to be blank if it's useless to you. Perhaps you can glean from my example: I have map.php, and it contains merely this blank class (and the contents from blank.php work just as well, to base an example off of): PHP Code:
PHP Code:
While this is not an exploration system in the sense that the original post has, I hope it explains how pages are rendered a little better? I'm trying to write up some vague documentation based on things I've learned about Mysidia, you can find that here. *** edit: And to imitate exactly what the original post has, try this-- explore.php: PHP Code:
PHP Code:
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 12-07-2014 at 07:13 AM. |
#10
|
|||
|
|||
This is really helpful! I was looking for something similar (I've been trying to do an image map for shops and such). This is awesome! Thank you!
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trade System | Kyttias | Questions and Supports | 4 | 05-29-2016 12:29 AM |
Dev Rambling: Exploration System | Kyttias | Programming and Game Development | 4 | 01-27-2015 01:54 AM |
Abandon system | bokkun | Mys v1.1.x Mods | 30 | 11-16-2010 10:19 PM |
Trade System? | sensacion | Questions and Supports | 5 | 08-20-2010 11:36 AM |
Trade System? | SieghartZeke | Questions and Supports | 1 | 12-28-2009 07:06 AM |
What's New? |
What's Hot? |
What's Popular? |