#1
|
||||
|
||||
Exploring System
EDIT (5/23/12) I am no longer updating this (seeing as I no longer am working on MM2+). But please note this tutorial is apparently outdated and may not work properly with the main script without lots of extra work.
Alright, so since MM2+ is heavily explore based I have to do this a lot XD So I figured I'd post up a tutorial to maybe help some people make their own systems! Now note: MY EXPLORE SYSTEM IS NOT 100% COMPLETE Thus, I will be posting this information as I go through. Also: I'm going to assume each part is long and will go over the limit per post (because my code kindly already does this XD) And it'll be easier to see each separate part. :D EDIT: Actually I just tested, it wouldn't go over this magical limit (hopefully) but it'll make it easier so I can link to the second/third post to save you the scrolling :3 The three parts of this tutorial will be: -'Simple' NPC interactive with user-Complete -Exploring, finding, seeking, etc-Nearly done -Extra stuff (finding something, interacting with the environment, getting a new adoptable, etc, etc)-Not started? IDK So now for PART 1!!! Part 1--NPC Interaction Your user is stuck in the randomness of empty space of the internet OH NO!!! But wait! There's a random person here too! Oh! IT'S AN NPC *shot* NPC stands for Non-Person-Controlled. Basically it's a character who is not controlled by you, but can still interact (or not?) with their environment given user input. So now we need some information before we make our code. We need to make this NPC. Here's some things to keep in mind: Quote:
"Hello there!" "Hiya!" "Well hello there!" "Howdy!" "Hola!" "Welcome stranger!" And so on! If I can make one phrase in 6+ different ways you can make your characters speeches the same! Now that we got our speech complete maybe we begin coding! But you need to plan! Where are these/this people/person? Are they in a snowy field, a volcano, a jungle? For the sake of this example we'll be in a magical forest (shush). In this magical forest there are mysteries, so what would someone do in a new place? Ask for help! Now we begin coding! Part 1b--Beginning the code So what you need to do is find a file in your main folder called "blank.php". On your computer, right click the file and go down to copy (yours might have a duplicate button, IDK), after you've copied it right click again (not on a file, on a blank space in your folder) and hit 'paste'. Your pasted document should be called "blank copy.php" If not it'll ask you to rename it or change it's name to "blank (2).php". Either way just accept that. Now rename your file to something you can remember, I suggest not 'explore.php' since you might want more explore areas. For this example we'll be using a fake file called "forest.php". Now open up your file and go down to "Output to user". Underneath that we'll begin our quest! But first paste in: PHP Code:
Now we can't just throw ourselves into a conversation! Introduce the area, what do you see? So now we add: PHP Code:
So we need to define this conversation, but we don't just jump right in! We need to introduce the situation So in order to do that we must define $act == talk! Let's do that now: PHP Code:
So the conversation for Lavendra and Kyto is exactly the same, excluding what they say exactly and how they say it. Since they are the same I'll walk you through Lavendra and assume you can do others as well after this So now we start with a simple definition of $act == lavendra and $num==0: PHP Code:
The last bit is to end the conversation, you need this so you can...well...stop talking XD You see it's called 'talk2' I'll explain that in a second. But that's boring, a simple "How can I help you" then stop talking? No! We need to talk! Let's now define a question, how about we ask them about Kyto? He's an interesting guy. PHP Code:
Now we can add as many more topics as we want! Just remember to make a link to each one and make each a new number. So here's our example again after adding some more! PHP Code:
Once again you can add as many characters as you want interacting in this fashion. The only thing you need to change is the "else if($act == "name")", "$article_title", and the actual answers. But what about a non-speaking NPC who just reacts? Like say...A PUPPY!!! What if we want to go ahead and pet the cute puppy! Well let's do that shall we? Part 1c-Petting The Puppy (etc) Now if you remember our talk page one of the links was Pet Fluffy! (see the third link?): PHP Code:
So first we need to define the actual subpage of our puppy: PHP Code:
First, you are defining to new subpage of Fluffy. Fluffy is subpage worthy Secondly, you are defining a rand number with this statement: PHP Code:
Next we define the article title, pretty boring? XD Fourth, we are defining all the random actions this puppy could do. For simplicity I only added 3. The first two are actions the puppy does while the 3rd is just in case of an error we have our backs covered. PHP Code:
NOTE: When working with random outcomes it's always good to keep in mind a couple times. 1) The less options you have the higher chance of a repeat. Since I only have two that chance is extremely high. 2) Every time you add a new outcome MAKE SURE to change the second number in the $rand to be equal to that of your highest number, that'll make sure all your options work. Now you may ask: Are we done now? NO! We still have to make the 'talk2', 'talk3' and 'enter' work! Part 1d-Talk2, Talk 3, and Enter Okay, so now we have already defined links for 'talk2' and 'enter', but what are these exactly? We'll begin with Talk2 and Talk3. Now if you remember 'talk' is when we first met these dragon, we don't know who they are, we just got there. But after chatting with them you do know them a bit better, also they'll be standing there and not walking into the picture. 'talk2' is just like 'talk' because it lists the people you can converse with but it changes the $article_content because the people are already there and we know them a bit better. So just to put simply your talk2 should look a bit like: PHP Code:
But now you must wonder why we need ANOTHER talk. 'talk3' is for when you return from your valiant exploration! PHP Code:
But what is this 'enter'? Why is it so special? Well that actually has to wait for part 2 XD BUT! Keep thinking of a few things! -What areas are there to explore? Yeah, yeah it's a forest, but what's IN the forest? Maybe a thicket, maybe deeper in the forest, maybe a stream, or whatnot! These 'subareas' will be defined in part 2, as well as what you can find/interact with while exploring! -What can you find? Pets, items, money, nothing, new areas, etc! And yes I just stated everything I will cover XD (note: items is not, item items, because I do not know that YET. It's just items as in OMG I FOUND A BOTTLE *action**action**action*) -How can you interact with your environment? -What does the landscape look like? Yes, you'll need to make images for part 2 -How should the page be set up? More will come later but basically it'll have an Event, an Image, and a Description of the Event.
__________________
"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo My Adoptables|Nuzlocke Webcomic Last edited by PTGigi; 05-23-2012 at 06:43 AM. |
#2
|
||||
|
||||
<post saving section for part 2--Exploring-exploring>
Gah sorry for taking so long D: Okay before we start please note, I'm sure there is a faster and more efficient way to do whatever I post and you may happily do that! (ie iframes for whatnot) But as Gigi I tend to find a simple, yet effective way to do things XD Also I tend to find a way that involves a lot of rand(); I love random stuff 8D Being worked on -Random Search System -Finding and gaining Money (works with multiple currencies) -Finding random 'items' (not item-items, but stuff you can interact with) -Finding nothing (durr easy XD) -Finding a new path -Multiple areas within one area (i.e. Within the magical forest a stream area, a mushroom area, and maybe just a deeper part of the forest) -Background image for location -Overlayed image for the event (i.e. a pile of coins or an adoptable or whatnot on top of your image of the background for the location)
__________________
"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo My Adoptables|Nuzlocke Webcomic Last edited by PTGigi; 02-22-2011 at 04:40 PM. |
#3
|
||||
|
||||
<post saved for part 3--Extra add-ons>
Will/Might include: -Design of Explore Page -Save Points -Quest Log -Adventure ideas? -Riddles -Guest Block -Area Block -Pet Block (?) -Possible 'Mini' battles (not full since I haven't gotten there yet X3) -Possible page redirect for when you FAIL -Possible change of images by time of day (yeah I like this time of day stuff from my Javascript-ness ) -Possible Random bg images -Different style of exploring (just the look of the page, nothing massive)
__________________
"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo My Adoptables|Nuzlocke Webcomic Last edited by PTGigi; 02-22-2011 at 04:37 PM. |
#4
|
||||
|
||||
*watches*
This looks rather useful.
__________________
|
#5
|
||||
|
||||
Thank you :D
Hopefully I can get more done in the next couple days but with midyear exams it might be hard D:
__________________
"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo My Adoptables|Nuzlocke Webcomic |
#6
|
||||
|
||||
It's really cool your doing this gigi maybe it can find a use on my puppy site.
|
#7
|
||||
|
||||
I was pretty sure NPC stood for Non-Player-Character... I guess its the same principle just a different word
Looks good, btw, I'd like to see more :D
__________________
dasheep.tk |
#8
|
||||
|
||||
Oh really? I thought it stood for Non-Person Controlled [Character] X3 Lolz but you're right it's the same thing XD
Thank you both of you :D I do hope it helps ^-^ The second part should be the most helpful X3
__________________
"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo My Adoptables|Nuzlocke Webcomic |
#9
|
||||
|
||||
Yeah, I guess there's multiple definitions, since I've known it as Non-Playable-Character. But it doesn't really matter.
Awesome guide, looking forward to parts 2 and 3.
__________________
Yacker Quote:
|
#10
|
||||
|
||||
Thank you :D
Okay, I am ALMOST done with my explore system. Though me being me I just doubled my work by wanting to add a whole new area >.> So....IDK XD When I go to type up part 2 that might take me 1-2 days because I have a MASSIVE chunk of code to sort through and attempt to explain XD I expect this to go over 2,000 lines (though lines don't mean much it just means it's A LOT ._.)
__________________
"I see now that the circumstances of one's birth are irrelevant; it is what you do with the gift of life that determines who you are."~Mewtwo My Adoptables|Nuzlocke Webcomic |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mys v1.3.3 Personality System | Hwona | Mys v1.3.x Mods | 15 | 12-18-2016 09:13 PM |
Trade System | Kyttias | Questions and Supports | 4 | 05-29-2016 12:29 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? |