|
|
Note: This is useful for NEW people. If you are a good Java coder, you'll find this most likely useless, and possibly even badly written. Also, guide will not be finished for quite a while, I've been really busy.
Hi everyone, I'm Incipio of RuneServer. If you're reading this, then you are interested in RuneScape Private Servers. You may have already tried starting a few, only
to have your advertisements owned by comments such as "noob leecher, gtfo", "another boring server", or "wow, u fail". Or maybe you've just started coding, and you
want to see how to improve your skills.
I'm not going to lie to you. You'll need a good amount of patience to excel at Java (and read this). A lack of patience is the reason almost all servers released
nowadays NEVER succeed. The "owners" are just too lazy to learn a little Java and code something INTERESTING.
This tutorial is divided into Stages. Some things will take longer, some will be shorter. I will mark the approximate length of the Stage next to the name.
If you don't want to read all this, the important parts are this color.
STAGE 1 - BASICS - 1~7 days
Before you start, you need to know the basics of Java. If you have some sort of experience with ANY other programming language, whether it's the built-in language
on a TI-84 (that's all the experience I had), or with C++, Python, C#, even BASIC, then this will be much easier for you. Even if you don't have the experience, the
basics are really easy to understand.
First, you will have to be familiar with basic statements. These are easy to learn - it's almost in plain English.
This is a basic if-else statement. It's simple, and should be obvious to you. If the condition is true, then something will happen. Otherwise (or else), something elseCode:if (CONDITION) { //do something here } else if (CONDITION) { //do something else }
will be done.
There's a lot of other statements, but this is the big important one. You MUST be able to instantly identify this.
An important thing here is syntax. This is all those little parentheses and brackets. You should train yourself to remember all these tiny
things from the very beginning. Every day, a lot of people post errors in the Help section that are caused by a missing bracket or semicolon.
Now, towards the end of stage 1, you should start to know your data types.
For RSPS coding, you will most likely only ever encounter the following:
- int (Very common. Basically, allows for a number to go up to about 2.147 billion. It can also go to the negative of that amount.)
- long (Only used for the system time as far as I know. It stores a bigger value than int. It can also go to the negative of that amount.)
- double (Used for decimals.)
- boolean (Stores a true/false value. 0 is false, 1 is true. Used for a variety of purposes.)
- string (Stores a string of characters, like "Incipio of Rune-Server wrote this!")
- char (I've seen it used once, I've never needed it.)
Read this: [Only registered and activated users can see links. ]
It explains how to declare variables. It's for C++ but the method is the same.
What you should know after Stage 1...
- Basic statements such as if-else
- Data types
- How to declare your own data types
STAGE 2 - ABSORBING - 3 ~ 14 days
This is probably the longest stage. In this stage, you will learn a lot about how private servers are coded. First, download a highly customized source. PI is the most
common, so use it. By customized, I don't mean something with 102412084712048 custom items. I mean that a lot of new things have been added to the server.
Something like this: [Only registered and activated users can see links. ]
Plenty of minigames, Player Owned Shops, PK Points, Spirit Shield Making, etc. Great for learning.
Now, you should have your source downloaded. Instead of hosting it instantly and being called a leecher, learn from it!
Read the following COMPLETELY. You can skip parts that are repetitive, but you should read through the code. And don't just LOOK at it. You need
to UNDERSTAND.
A lot of this is in src>server>model.
Starting from easy to understand to difficult to understand...
MAKE SURE YOU LOOK CAREFULLY AT SYNTAX!!
- Config.java (Mostly self-explanatory, should be simple. But now you know for the future what things you have in there)
- Commands.java (Just by the command names, you should be able to figure out a lot of new things. Adding and deleting items, sending messages, rolling random
numbers, etc. Lot of new stuff to be learned here)- PlayerAssistant.java (Getting harder. If your source is highly customized, then you should find all kinds of interesting things in here.)
- CombatAssistant.java (This is where most of the math comes in. About the same difficulty as PlayerAssistant.)
- Client.java (LOOOOONNNGGGG read. Definitely worth it. This is where a lot of the first things you add will go to, so you should know everything inside it.)
After you've read all that (should take quite a while), you should have learned a lot about Java, especially for RSPS.
If there's something on the below list you haven't seen, search for it.
What you should know after Stage 2...
- Adding/deleting items
- Better grasp of syntax for various things
- Switch + Cases
- Some knowledge of dialogues
- Using random numbers
- c.sendMessage()
- How to use animations + GFX (don't need to know ID's)
- Basic interface stuff
- Sending global messages (like ::yell, but with a default message)
STAGE 3 - LET THE FUN BEGIN - 1 ~ 5 days
Finally, you can do some coding!
We'll start with some simple commands. Commands are by far the easiest things to add, since generally, there will be a command similar to what you are adding. In
this case, you can just copy it and adjust it a little to match your needs.
First, you should know commands go AFTER this part:
It's probably safest to put a command between other commands so you know they're in the right place. But, be careful not to accidentally put the command in theCode:public void playerCommands(Client c, String playerCommand)
middle of another command!
So, put your new command BEFORE one of these:
You should know by now the basic layout of a command.Code:if (playerCommand.
Code:if (playerCommand.equalsIgnoreCase("thecommandname")) { //some action here }
We'll start with commands that don't take any input (unlike ::item or ::ban). Because of this, we will use equalsIgnoreCase. This means
the command that the player types has to EXACTLY equal what's between the quotes.
For commands with input, startsWith will be used instead.
FIRST COMMAND - MAKEMERICH - Level: Easy Peasy
This command will give you 2.147b (max gold)
Please, try figuring it out yourself before looking at the hints! Remember, find another command that does something similar (in this case, ::item also adds an item)
and then take the part and put it into your new command!
If you really can't do it, then look at the second spoiler for the code. Figure out what you didn't know, and remember it.
Hints
Spoiler for Hints:
Spoiler for Answer:
SECOND COMMAND - RANDOM - Level: Easy
This command will display a random number.
Please, try figuring it out yourself before looking at the hints! Remember, find another command that does something similar (in this case, ::yell also displays
something) and then take the part and put it into your new command!
If you really can't do it, then look at the second spoiler for the code. Figure out what you didn't know, and remember it.
Hints
Spoiler for Hints:
Spoiler for Answer:
THIRD COMMAND - ONEANDTWO - Level: Average
This command will show the first and second numbers inputted after the command :neandtwo
Please, try figuring it out yourself before looking at the hints! Remember, find another command that does something similar (in this case, ::item also splits
arguments of a command) and then take the part and put it into your new command!
If you really can't do it, then look at the second spoiler for the code. Figure out what you didn't know, and remember it.
Hints
Spoiler for Hints:
Spoiler for Answer:
For the remainder of this stage, just create other random little commands. They don't have to be hard, you just need the practice.
If you are able to create something like ::item or ::ipban, then your work here is done.
What you should know after Stage 3...
- Creating Commands
- Basic methods used in commands (methods are things like sendMessage, addItem, and parseInt)
- Difference between commands with and without input
- Have a lot more experience doing basic coding
STAGE 4 - SOURCE - 1 ~ 3 days
Congratulations! If you've made it this far, you've got what it takes to take your private server to the top!
You'll need a few things though:
- A GOOD source
- A name for your server
- A name for yourself on the server
We'll go over these one by one.
First off, your own name. It needs to be UNIQUE. Something that has never been used before, something that you can confidently use for registering on ANY forum.
For example, Gir, Incipio (derp.), Pilldom, Hydrolyza. These are just a few of the good names that I picked off of this forum.
Now the bad names. donivan12, rexz0rd, blakeman8192. You should not choose something like this!
All 7 of the above names are names of random members on Rune-Server. But think. Pilldom is a name EASILY REMEMBERED, unlike blakeman8192. How can you
expect someone to remember the 8192? Also, the lack of capitalization makes it even worse. Blakeman is better than blakeman.
Spoiler for If blakeman8192 reads this:
A name like rexz0rd is decent, but the spelling is hard to remember.
A name like Epic or Pro is also bad. These names are too common. If your server goes down, people will never recognize you since there's almost no chance you'll
get the name on another server.
In short, your name needs to have no numbers, good capitalization, and be unique.
Now for picking a name for your server.
Good names: Recoil Rift, HavocWorld, SilabGarza, Near Reality, SoulSplit.
You may not have noticed, but almost all top servers don't include "scape" in their name.
Bad names: Gergscape, D4rthscape, SEXY PK X ILE.
Your server name should be unique but easy to remember.
Finally, source picking. Your source must be decent. PI is good for a FIRST server. Hyperion is also good, but PI has so many tutorials that you'll learn how to code
well much faster.
Important note about PI from LT Smith:
Hyperion, Runesource, and Shard-Revolutions ARE good. However, there are only a couple tutorials for these bases. If you are good at figuring things out, start with
them. You'll quickly learn to convert PI into your base, which will greatly improve your skills. However, I would still recommend starting with PI. When you're ready for
harder things, then make the switch and you'll be able to catch on to the small changes quickly.
[COLOR="Lime]
Some other important info about using PI:[/COLOR]
The source should not have too many customs (people don't like that). Also, the source should have most memory leaks fixed (or you'll end up
spending lots of money trying to get it fixed). Finally, it should have some basic stuff added, such as Dragon Claws, x10 hits, etc. Things you won't want to waste
time on.
Here's some that I recommend. These are just RECOMMENDATIONS. I pulled these from the first two pages of the downloads section, feel free to dig deeper. Not
too deep, or you'll be hopelessly outdated.
[Only registered and activated users can see links. ] --- Commonly used
[Only registered and activated users can see links. ] --- Looks OK, haven't used it
[Only registered and activated users can see links. ] --- probably the most widely leeched server now?
[Only registered and activated users can see links. ] --- 508 maps and full screen. This is what I use.
[Only registered and activated users can see links. ] --- this is
"SHARDS", so it's immediately harder because you'll have to figure out most of the coding yourself. The SQL integration is a nice bonus though...
After you've picked a source, you will start customizing it, starting with basic name changes. Time to go to stage 5! (By the way, stage 4 really shouldn't take a
stage in a row. But there's a good chance you'll switch between a few sources before settling, which will, when combined, take about a stage).
What you should know after Stage 4
- You should now have a source you are happy with, a name for yourself, and a name for your server
STAGE 5 [Part 1] - MAKE YOUR SOURCE YOUR SOURCE! - 1 ~ 3 days
NOTE: I will NOT be explaining how to set up your server! There's a billion tutorials on doing it, and I will just be adding an extra, un-needed 1000 words! Use the
Search button!
You've picked a source now. Just to see if it works well, run the server and log in to test it out.
First, go to Config.java.
A lot of customizing to do here, EXP Rates, Server Name, Admin Settings, etc.
EXP Rates should be challenging, but not too hard. It should take about 1 hour to get 99 in a combat stat.
Now, in your explorer search bar, type in the name of the source. It should show you every file in which it occurs. Replace all the occurrences with your server name.
Do not change the cache download link in the Client files if there is one! It will screw up your client. It will be changed later on when you get a webhost.
Not all occurrences of the source name will be found. Log in to your server and play around a little. When you see the source name come up, find it and change it!
Also, FIX TYPOS. When you see a typo, FIX IT!!!!!! THIS IS SUPER IMPORTANT. TYPOS MAKE YOU LOOK STUPID!!! SPELL CORRECTLY AND USE GOOD
GRAMMAR!!!
You should now not be seeing any occurrences of the original source name appear. If someone playing your server sees something like "FormationX V3" pop up, it'll
be embarrassing. I also recommend you change ever c.sendMessage a little so that it's hard to tell what source it originally was. People who know secret dupes
specific to certain sources will not know your original source, so they won't try them.
For the rest of the stage, play around with your server.
Change little things that you notice to improve your server. Details are important!
EX:
"wellcum 2 da pkbox" is way worse than
"Welcome to the PK Box!"
The first makes you look like a bumbling, retarded, noob leecher. The second makes you look professional, smart, and sophisticated.
What you should know after Stage 5 [Part 1]
- Basic file editing
- How to change a source name into your own server's name
- How to not sound like an idiot
- MOST IMPORTANT: KNOW MORE ABOUT THE SOURCE YOU ARE USING
Stage 5 [Part 2] - CONFIGURATIONS - 1 ~ 7 days
This may take a little longer if you get bored easily, since this is by far the most boring part of making your server really yours.
Things to DEFINITELY change (most will be in data>cfg)
- shops.cfg
- NPCDrops.TSM (Use notepad to edit)
- spawn-config.cfg
Things to POSSIBLY change (don't change too much or you'll ruin your server. Mostly, just take a look at the files)
- item.cfg
- npc.cfg
shops.cfg definitely needs to be changed. It will make it really obvious that you leeched the server. Change small things, remove items you think shouldn't be buy-
able.
NPCDrops.TSM can be changed later on. As long as the drops in your server right now are decent, you don't need to change it.
spawn-config.cfg is pretty important. Move shops to a separate location, add :hops to teleport there. Also, change up training spots a little. Keep some typical ones
like Rock Crabs, but also add new, unique spots. Don't make it too easy though, like chickens with 12048712894 hp.
shops.cfg is going to be really boring to completely redo, you can start with just re-arranging the items, then do the boring stuff.
What you should know after Stage 5 [Part 2]
- cfg editing
- A little more command practice
- Your source should now look much more different.
- Please don't brag to yourself at this point, you've barely done anything
If you always make yourself think you're awesome, you will fail. I'll tell you when you're awesome.
Stage 6 - BACK TO THE CLASSROOM - 5~15 days
You may think now that you're a good coder. All I can say is "Nope". You can add a couple commands and make a server look slightly different. But have you added custom systems? Do you know what packets are? Can you completely remake crafting? "Nope".
Here's where the road gets tougher.
Here's an official Oracle tutorial.
[Only registered and activated users can see links. ]
I want you to read ALL OF IT.
When you click something like "Classes and Objects", you'll be sent to a new page. On the sidebar, there's a billion things. READ IT ALL. There's also "Questions and Exercises". Do them if you want, but at least look at them.
This will take you a while, but when you finish, you'll feel much more confident when programming new things.
What you should know after Stage 6
- Really, you should know everything on the page provided to you. There are parts you'll never need, but it's good to always have that knowledge.
Working on this still, it'll be a LONG guide.
Feel free to thank/rep if you find this helpful! It's taken me an hour to write so far, it takes you 15 seconds (if you don't lag) to press
thanks and karma
Nice.

gj contributing,should be helpful to people just learning java
Looks nice, but you should also include that ints and longs and all those can be negative as well.

Its good to see someone taking the time to write something like this. Good job.

Nice, good job so far.

| « [Php]Fully working Highscore & Server side SQL Engine. | Changing item slots / animations » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |