- A What-Not Primar - Best viewed with Word Wrap on, in this Primar I plan to show the reader (you) how to do a few tricks that will increase the quality in your game. I have things on programming to plot writing its all here so enjoy *switchs music on winamp*. Alright now lets take a look at a few chapters here and perhaps a section of who am I? Perhaps? Maybe? Well why not eh? Can't hurt, lets hope not... - Me and who I am - I am a private person so lets keep names to first name basis, nothing personal just a little paranoid after witnessing how easy it is to hack computers while taking some computer classes a year or two ago. I am familar with C and C++, I've screwed with Visual Basic and I know Java Script and a few tricks with HTML. In the Toolkit world, I have been using the toolkit for three years. I didn't start posting on the forums till around two years ago, either way I downloaded the toolkit in the year of 2000. I loved it and found the language very simple to use (I didn't know any programming then except a little html) and loved to screw around with it. I couldn't get enough of putting text on the screen and the first few games of mine were very embarrassing and I happened to notice they where gone one day (deleted) by someone (me). I like to do one night stands you could say with programming because I have no patience with it at all and 3 or 4 days is all I am willing usualy to devote to a program. That about raps who I am up lets check out the contents! - Contents - - Manipulating Variables - The If Command - Key Input - The Branch Command - Plot Development - Manipulating Variables - Let me start off by saying this is one of the most entertaining and perhaps most powerful part of RPGcode. When I say entertaining I mean fun and I mean it can be a huge pain too. If you haven't come of age and tooken at least Algebra 1a (I believe thats freshman year in high-school), then it'll be a little harder to understand. In algebra you can give x or y a value right? Well in RPGcode thats exactly what it is for example: #x!=15 This shows that the variable x equals the number 15, note the "!" after x. You need either a "!" or a "$", "!" meaning mathmatical or in otherwords numbers and "$" meaning literal or in otherwords the alphabet (words). Now you may ask yourself how can this ever be useful? Well if you think about it, quite useful actualy. Let me show you a few variables you could use: #hp!=120 #gold!=40 #exp!=3 #attack!=17 #item1$="Bronze Swords" #name$="John" See quite useful, now let me make sure you understand one thing. With variables there are not pre-defined variables (well there are but thats kinda complicated for right now). So for that hp variable (#hp!=120), we could call it anything we wanted. Any random thing you could come up with like this: #hp!=120 #playeronehp!=120 #hitpoints!=120 #kjkgjjnvkhsuneusnv!=120 See? Anything from # -> ! or # -> $ can go in and it will work correctly. Once you get ahold of this and realize this you will start to realize truely almost anything is possible. Your only limitations is your imagination. Now that we have this covered lets say you want to display an amount or I should say a literal or mathmatical variable, how should we do this? Here take a look at this: #amount!=13 #something$="cats" #mwin("Hey I have !") #wait For those slow learners let me explain, the variable goes inbetween < >. May sound complicated but its as easy as it sounds. Time for a Drill Practice! Directions: Make an mwin program using 2 mathmatical variables and 2 literal variables, if it doesn't work try to debug it and read over this section again and do some of the examples. ----------------------------------------------------------- You should have something like this or similar: #number!=7 #dogs!=1 #name$="Grant" #car$="Mazda" #mwin(" My favorite number is , I have dog, my name is and ") #mwin("my car is a .") #wait Now if yours didn't work be sure to try to find your mistakes and fix them, check the examples to see if you can identify the problem. If yours works then congratulations! You have learned a difficult part of programming! - The #If Command - Alright now that you know how to use variables the "If" command is very very easy. Lets use an example: #dogs!=1 #if(dogs!=1) { #mwin("I have one dog...") #wait } #if(dogs!=2) { #mwin("I don't have a dog...") #wait } See? So it goes like this: #if(var!=num!) { Whatever you want here... } Lets try with a literal value like this: #name$=="Grant" #if(name$=="Grant") { #mwin("Hello my name is Grant!") #wait } #if(name$=="Joe") { #mwin("My name is Joe!") #wait } I hope you understand this because here comes a Drill Practice! Directions: Try and make a program using a literal and mathmatical variable using at least two "If" commands. How'd it go? Well lets see what I did: #soda!=7 #soda$="Coke" #if(soda!=7) { #mwin("I drank !") #wait } #if(soda!=<6) { #mwin("I didn't drink ") #wait } Remember to try and debug your program and look over my examples if you didn't get them right. If you did get them right then congratulations once again! Man are you on a roll! You may just yet be the next best RPGcode programmer! But lets move on and see what we got next... - Key Input - Ah yes the secret art of key input, quite fun once you know how to do it actualy. Take a look at this program and see if you can't figure out anything, alot of it will seem familar: #mwin("Press 1 for a message or 2 for a different message...") #wait(key$) #if(key$=="1") { #mwin("Message 1 here you go...") #wait } #if(key$=="2") { #mwin("Message 2 here you go...") #wait } You see you have your "wait" command and you just add the (key$) literal variable to it. key$ is just a variable I picked to help me remember its getting the key the user pressed you can use any variable you'd like. Lets try another example thats a little more complicated eh? #hp!=120 #mp!=50 #exp!=1203 #one$="HP" #two$="MP" #three$="EXP" #mwin("Press 1 to see player .") #mwin("Press 2 to see player .") #mwin("Press 3 to see player .") #wait(key$) #if(key$=="1") { #mwin(" - ") #wait { #if(key$=="2") { #mwin(" - ") #wait } #if(key$=="3") { #mwin(" - ") #wait } Here we go getting a tad bit more advance but still very basic, we got 3 "If" commands, 7 variables, 4 literal, 3 mathmatical and one of the literal ones allows for a key input. See your starting to see for the startings of the true power of variables, if command and player input. The possibilities are almost endless. But incase you didn't understand this program let me go over it. We first define 6 variables, the first 3 are mathmatical, second 3 are literal. Then we give 3 mwins giving the player directions using 3 literal variables. Then we have the wait command to allow the player to press a button to continue once there done reading and allow the user to choose what will come up next. The players hp, mp or exp then we have the if the key equals 1,2 or 3 and the approiate message. Lets do a Drill Practice! Directions: Make a program using at least 2 if commands, 2 literal and 1 mathmatical variables and you have to have an input program that works with the if commands. Did it turn out well? How about we take a look at what I did first eh? #name$="Grant" #num!=7 #mwin("Press 1 for my name or 2 for my favorite number.") #wait(key$) #if(key$=="1") { #mwin("My name is ...") #wait } #if(key$=="2") { #mwin("My favorite number is ...") #wait } Did it work out? If not again I can't stress enough go back read over and see what the problem is and fix it or else you'll never improve as a programmer and get further and further lost and buried with negative confidence. Confidence is everything just about, without it you will have a hard time doing anything... - Branching - This is quite easy so I won't spend to much time on it, just one quick little example and explanation thats all you need. Lets look at an example of the branch command: :up #mwin("Press 1 please") #wait(key$) #if(key$=="1") { #mwin("You pressed 1 alright!") #wait #end() } #branch(:up) Understand? This usualy is used to prevent from the program closing when the wrong button is pressed, without this your programs will become very long when they don't need to be. The "Branch" command is similar in one respect to variables in that anything can go in between #branch(: ->) As long as you put it somewhere like I did in the program above. - Plot Developing - Alright to develop a good or great plot you need to plan it first, like this ask yourself three questions: 1)What is my main characters name? 2)Where is he from? 3)What is his role or status? Then once you have these questions answered try and ask why like this: 1)What is my main characters name? Why? 2)Where is he from? Why? 3)What is his role or status? Why? Be sure to be writing this down in Notepad or something or else what good is the plan if you can't use it!? But here I will do it with you to help you get a better understanding: 1)What is my main characters name? Why? James, his mother named him after his father died but his real name is Luther. 2)Where is he from? Why? James is from the small town of Talos, his family moved there after his father died. 3)What is his role or status? Why? He is a lost sole looking for meaning in life, he finds himself like this because he has had no role-model to look up to while growing up. See not so hard eh? Now try and start planning chapters like this. -Intro- A lost sole by the name of Luther but after his father died was given the name James has grown up in a small town called Talos. James now a young man searchs for meaning in life and is truely lost in his mind and needs something to change... - Meets King of Yetelor a big city near by. - Accepts the quest of finding the kings golden apple. - Checks with the bar tender at the bar and realizes he is in for much more then he bargained for. - Goes to one of the three theif houses and after defeating them finds out that he must defeat the other 5 houses to win the kings apple back. - We can keep going but you get the idea... Along the way the player needs to change, before James was lost but he needs to gradualy change and start to answer the unanswered. Without gradual change in the character, the player will not feel any kind of accomplishment when (s)he is done playing your game. I cheaped out on the chapters above because its getting late but always always plan well. Once you have your plot all planned out then you get to create it, this is the fun part and is up to you.