Jump to content

Search the Community

Showing results for tags 'basics'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 10 results

  1. [CENTER][I][COLOR="#FF0000"]THIS TUTORIAL IS NOT COMPLETE![/COLOR][/I] [I]This is an add-on to the "RuneLocus Java tutorials". Please read [URL="http://www.runelocus.com/forums/showthread.php?34729-The-Basics-of-Java"]The Basics of Java[/URL] posted by [URL="http://www.runelocus.com/forums/member.php?153-Trey"]Trey[/URL] [B]before[/B] you dive into this tutorial.[/I] [SIZE=4][COLOR="#FF8C00"]Syllabus:[/COLOR][/SIZE] Introduction Expectations Getting started References [SIZE=4][COLOR="#FF8C00"]Introduction:[/COLOR][/SIZE] Welcome to my tutorial on the basics of 2D graphics production in Java. I am Scott, I commonly go by the name of Jett because I am a MapleStory nerd. I have been programming for many years now, having progressed a lot farther than I had initially thought I ever would in the field. A lot (I dare to say to much) of my time has been spent in RuneScape private server communities since 2006 and after all of this time I am more interested in sharing the knowledge I have collected over the years with these communities rather than keep it all to myself. With that said, hopefully I will be able to provide you with further insight into the Java programming language and what it provides in the way of 2D graphics production. [SIZE=4][COLOR="#FF8C00"]Expectations:[/COLOR][/SIZE] This tutorial, while dumbed down a little, still assumes that you have a basic understanding of the Java programming language as well as the AWT (Abstract Window Toolkit), and the Swing API's provided in the Java API. If you think you need to brush up on some stuff before diving into this tutorial I urge you to reference [URL="http://www.runelocus.com/forums/showthread.php?34729-The-Basics-of-Java"]The Basics of Java[/URL] posted by [URL="http://www.runelocus.com/forums/member.php?153-Trey"]Trey[/URL], or the good 'ol [URL="http://docs.oracle.com/javase/tutorial/java/"]Java™ Tutorials[/URL]. [SIZE=4][COLOR="#FF8C00"]Getting started:[/COLOR][/SIZE] The Java API provides a very robust API for rendering any kind of graphics you can think of. The first thing you are going to want to look at when you are looking into 2D graphics production is [I]java.awt.Graphics2D[/I]. [I]java.awt.Graphics2D[/I] provides all of the methods and utilities you will ever need to render and manipulate 2D graphics on a basic, and even advanced level. Getting to know your API is very crucial so before moving on, please read the Java documentation for the following classes: [URL="http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics.html"]Graphics.java[/URL] [URL="http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics2D.html"]Graphics2D.java[/URL] You will notice right away that you have two discernible groups of methods; the methods that actually draw the graphics, and those that manipulate graphics attributes in order to produce different graphical effects. If you could not discern between the two groups, here are a couple basic examples illustrating the two different kinds of methods you are looking at: [spoiler=Examples] [URL="http://docs.oracle.com/javase/8/docs/api/java/awt/Graphics.html#drawRect-int-int-int-int-"]drawRect(int, int, int, int)[/URL] [IMG]http://i.imgur.com/XgFUtfD.png[/IMG] [URL="http://docs.oracle.com/javase/8/docs/api/java/awt/Graphics.html#fillRect-int-int-int-int-"]fillRect(int, int, int, int)[/URL] [IMG]http://i.imgur.com/TDSOIqR.png[/IMG] [URL="http://docs.oracle.com/javase/8/docs/api/java/awt/Graphics.html#drawString-java.lang.String-int-int-"]drawString(java.lang.String, int, int)[/URL] [IMG]http://i.imgur.com/y3KmzgD.png[/IMG] [URL="http://docs.oracle.com/javase/8/docs/api/java/awt/Graphics.html#setColor-java.awt.Color-"]setColor(Color)[/URL] [IMG]http://i.imgur.com/jc2fA62.png[/IMG][/spoiler]The methods for actually drawing the shapes, images, and text rely on the applications pixel coordinate grid to position the graphics where you tell them to be, and the methods for manipulating graphics rely on both position and user input in regards to what kinds of manipulation need to happen (for example: color, gradient, font type, etc ...). Here is an application I wrote that uses color, text, and basic shapes to help you get a feel for both the coordinate grid and the basics of producing your own graphics: (Click the picture to view the source code -- Java 8 is required to run this application!) [URL="http://pastebin.ubuntu.com/8368689/"][IMG]http://i.imgur.com/gN10qfA.png[/IMG][/URL] [COLOR="#FF8C00"][SIZE=4]To be continued...[/SIZE][/COLOR] I will be adding onto and revising every section of this tutorial over time. Please tell me if there are areas that I could be more clear, or just didn't elaborate enough on. Thank you for your continued support! [COLOR="#FF8C00"][SIZE=4]References:[/SIZE][/COLOR] [URL="http://docs.oracle.com/javase/tutorial/2d/basic2d/"]Getting Started with Graphics[/URL] [URL="http://docs.oracle.com/javase/tutorial/2d/geometry/index.html"]Working with Geometry[/URL][/CENTER]
  2. Hey, basically I would really like to start up an RSPS, not for public use yet, however. I have a few basic questions and it'd be great if you could help: 1. What are revisions? I know it defines a server what items it has etc.. but how do I see what items are in a revision and stuff like that, also where could I download a revision for an RSPS to edit? 2. How should I begin to learn coding? I'm all for looking up guides on youtube and trying to clone stuff on a blank servers, that'd be ideal but I don't know where to get a blank server. 3. I have no intention of opening a server so far, I merely want to have a blank canvas (kind of) where it is just like an older version of RS but without any pre-existing shops or NPC's, as I wish to code them myself. Is this possible? How so? 4. Could you refer me to a beginner's guide of some sort? That's it for the moment, any help would be much appreciated<3
  3. My friend and I are trying to setup a server just for us to play on and test things, we have an actual server to host it on rather than local hosting. The problem we're getting is that we can't seem to get the private server to run on the server. We keep getting error codes with the client. The error we're getting is 'error_game_js5connect' and we've been looking all over forums for solutions but none of them seem to be working, any help would be appreciated. If possible and you'd like to help us further then you can add me on skype 'Sicarscarr'. Thanks for taking the time to read this, i hope you can help.
  4. [SIZE=4][FONT=Microsoft Sans Serif][COLOR="#FF8C00"]I am new to all of this, I am an admin on a server but it is becoming dead so am looking to start my own (in time of course) any tips/guides you guys can share would be greatly appreciated, maybe even some advice?[/COLOR][/FONT][/SIZE]
  5. hey everyone im new to runelocus and rsps coding and i would love if someone could help me with it. wont be able to pay but whatever i make i will give credit to whoever helps me please pm me or add me on skype "bigjeff30"
  6. I thought i would share some of my knowledge on Javascript with all of you guys. Note: i created this back in 2011-2012. This is the first time i'm sharing it with anyone. [COLOR=#ff0000][SIZE=4]PROGRAMMING WITH JAVA SCRIPT [/SIZE][/COLOR] INSTEAD OF OTHER GUIDES WHERE ALL YOU ARE GIVEN IS CODES, I ACTUALLY EXPLAIN WHAT THE HELL YOU ARE CODING. PLEASE TAKE THE TIME TO READ EVERYTHING. THAT'S THE ONLY WAY YOU WILL TRULY UNDERSTAND JAVA SCRIPT. [COLOR=#0000ff][SIZE=3]CHAPTER 1 [/SIZE][/COLOR] Server Side • Server side scripts reside on the server (main computer) while client side scripts reside on a user PC • Storing all programs on the server allows multiple users simultaneous access but poses potential connection and performance issues. Client Side • While client side scripts are not as powerful and will never fully replace server side scripts, they do offer a convenient alternative for performing some of the simple, low-key tasks locally. Why JavaScript? • HTML allows developers to create static web pages, the information and look of the page does not change. • JavaScript allows you to create pages where content and layout can be modified using special code built into the page. [COLOR=#ff0000][SIZE=3]Java vs. JavaScript [/SIZE][/COLOR] [COLOR="#800080"]I included this for people who have no knowledge of Java or Javascript and would like to know the difference.[/COLOR] Java • Code is powerful but complex • A special app (JDK) required • Programs must be saved and compiles separately • Used for complex tasks JavaScript • Code is easy to learn and to use • No additional software is needed • Code can be added directly anywhere in the HTML text editor • Used for quick, simple tasks [COLOR=#ff0000][SIZE=3]Code Example[/SIZE][/COLOR] [CODE] <script> document.write(“Today is 12/20/2011 <BR>”) document.write(“Only 10 days until the New Year!”) </script> [/CODE] [COLOR=#ff0000][SIZE=3] Variables[/SIZE][/COLOR] • A Variable is a verbal representation of information that can be substituted for information. • Before you can use a variable can be used in the code it has to be created using a variable declaration. Variable Types • Numeric variables- any number in standard or scientific notification • String Variables – text (Must be in quotes) • Boolean variables- TRUE/FALSE. Used when you want the program to act depending on condition • Null Variables- a variable without an assigned value. [COLOR=#ff0000][SIZE=3]Naming Rules[/SIZE][/COLOR] • The first character must be a letter or an underscore • The remaining characters must be letters, numbers or underscores • Names cannot contain spaces • JavaScript code items cannot be used as variable names. [COLOR=#ff0000][SIZE=3]Variable Example[/SIZE][/COLOR] --------------------------------------- var month ="March"; document.write(“School starts in” + Month); OR month = “March”; document.write(“School starts in” + Month); --------------------------------------- Both of the codes above will yield the same result. Which is: [COLOR="#FF0000"]School starts in March[/COLOR] [COLOR=#ff0000][SIZE=3]Expressions and Operators[/SIZE][/COLOR] • A JavaScript expression is a command that is used for assigning values to defined variables. • A JavaScript operator is an element that can be used within an expression to perform and action, such as adding or combining multiple elements.. • The most commonly used operator is the equal sign (=) that will assign a value to the preceding variable. • Another example of an operator is the plus sign (+) used for combining multiple elements. [COLOR=#ff0000][SIZE=3]Assignment Operators [/SIZE][/COLOR]• In JS, values are assigned to variables using assignment operators. • An example is the equal sign (=) [COLOR=#ff0000][SIZE=3]Functions[/SIZE][/COLOR] • A function is a series of commands that can be executed by your program to calculate a value or perform an action [COLOR=#ff0000][SIZE=3]Benefits of Funtions[/SIZE][/COLOR] • Complex programming tasks can be broken down into simpler steps • Code does not have to be duplicated within a program • Code can be reused multiple times by a placing a simple function call anywhere is the program [COLOR=#ff0000][SIZE=3]Declaration [/SIZE][/COLOR]• A function has to be created using a function declaration like the one below --------------------------------------- Function Name(Function Variables) { Function Commands; } --------------------------------------- [COLOR=#ff0000][SIZE=3]Three major parts of a function:[/SIZE][/COLOR] Function Name= identifies each function Parameters= Values needed by the function to produce the expected result Commands= Actions that will be executed when the function runs. Calling a function Whenever you need to use the function you created you must insert this piece of code: --------------------------------------- FunctionName(Variables); --------------------------------------- (Replace "FuntionName" with the name you created for your function. Replace "Variables" with whatever variables you need to use) [COLOR=#0000ff][SIZE=3]End of Chapter 1 [/SIZE][/COLOR] [size=4][color=#0000ff]Chapter 2[/color] [/size] [SIZE=3][color=red]Arrays[/color][/size] • In a typical computer program, data cannot be stored without the use of a database such as Access, Oracle, DB2 etc. • Some of the program data, however, can be stored on a temporary basis by using data structures known as arrays. • An array is a systematic arrangement of objects, usually is a rows and columns. Like a table./ single column table with a name assigned to it [size=3][color=red]Array Example[/color][/size] [size=3]--------------------------------------------[/size] Var ArrayName= new Array(size); ArrayName[index]= value; ArrayName[index2]=value 2 ; [size=3]--------------------------------------------[/size] • The size is expressed as the number of elements that the array is going to contain. • You can leave the size blank and have JavaScript automatically increase the array size as new elements are added. • Index represents the row number [SIZE=3][COLOR=#0000ff]Coming up:[/COLOR] [COLOR=#0000ff][SIZE=2] Loops Objects/Events Prompting user for input Creating calculated fields Validating user input[/SIZE][/COLOR][/SIZE]
  7. This is a simple tutorial, to show how to edit a few BASIC things. [spoiler='Client IP and Port editing']BOTH of these are going to be located at client>src>client.Java OR client>src>ClientSettings.Java --- WHERE they are located in the file depends on the client, most are set default to 127.0.0.1 push ctrl + f and type 127.0.0.1 to find and edit it. Most default ports are 43594.[/spoiler] [spoiler='Client title and load bar (MOST)']This will be located in ClientSettings.Java Just push ctrl + f and search the server source's name you have I.E. CloudIn, then replace it with your server's name.[/spoiler] [spoiler='removing client title stuff like "by dragonkk"']This is in Applet_Sub1.Java. Just search whatever text is not edited through ClientSettings, like "by Dragonkk"[/spoiler] Yeah, its a basic and pretty crappy tutorial but I am too tired to make an in-depth one with pics and more detail, no flaming plz? :)
  8. [LEFT]I made this video not long ago, that will help out new php developers start coding in php and make their own web app. There will be more tutorial in the future. If you liked it, make sure you comment, subscribe. It is my first video, so don't hate.[/LEFT] [video=youtube;IanaRyRWpro]http://www.youtube.com/watch?v=IanaRyRWpro[/video]
  9. [center][IMG]http://i40.tinypic.com/wk2sn9.png[/IMG][/center] Trey's guide is incomplete, so I'm going to format this little guide for a better understanding, and I can at least answer the questions that people present to me. Understand that I'm not trying to "outdo" Trey in anyway, and he was my former mentor and longest friend on Runelocus. This guide wouldn't be possible without the help of Trey, blakeman, samuraiblood2 and Soul. They've helped advance me throughout the years, and I owe my programming knowledge to them, and them only. [B]Do not look into this guide without first referencing and understanding this guide:[/B] [url]http://www.runelocus.com/forums/showthread.php?34729-The-Basics-of-Java[/url] I'll be seperating the guides in spoiler tags, eact referencing something different, and we'll start off fast, so hold on to your panties, okay kiddos? [spoiler="Java Keywords"]I'm going to attempt to create a little table of keywords for you to reference throughout this guide. Someone please PM me if I miss any keywords, or if I spell one word or anything. I love to hear from the community. I shall be doing this in paint, and posting the image below this small description. [center][IMG]http://i44.tinypic.com/15f2d02.png[/IMG][/center] [/spoiler] [spoiler="First Project: HelloWorld."]In this section of the guide, you'll find the basics of writing a simple Java program. Wildly famous to anyone who can even program whatsoever, it's simply known as the "Hello World" application. It can generally be found in every programming language, and is commonly used by beginning programmers to learn the basics of a language. I'll be teaching you how to not only write this, but explain each line and then compare it to other popular programming languages. [code] 1. public class HelloApp 2. { 3. public static voic main(String[] args) 4. { 5. System.out.println("Hello, world!"); 6. } 7. }[/code] Lines 1 and 2 mark the declaration of a public class named HelloApp. [spoiler="Line 1"][B]public[/B]: A keyword of the Java language that indicates that the element that follows should be made available to other Java elements. In this case, what follows is a class named HelloApp. As a result, this keyword indicates that the HelloApp class is a public class, which means other classes can use it. [B]class[/B]: Another Java keyword that indicates that the element being defined here is a class. All Java programs are made up of one or more classes. A class definition contains code that defines the behavior of the objects created and used by the program. Although RSPS consist of more than one class, the simple programs you'll find throughout your journey may have just one class. [B]HelloApp[/B]: An identifier that provides the name for the class being defined here. While keywords, such as public and class, are words that are defined by the Java language, identifiers are words that you create to provide names for various elements you use in your program. In this case, the identifier HelloApp provides a name for the public class being defined here.[/spoiler][spoiler="Line 2"][B]{[/B]: The opening brace on line 2 marks the beginning of the body of the class. The end of the body is marked by the closing brace located on line 7. Everything that appears within these braces belongs to the class. As you work with Java, you'll find that it uses these braces a lot. become familiarized with the location of them on your keyboard for quicker access! [/LIST][/spoiler] Lines 3 through 6 define a method of the HelloApp class named main: [spoiler="Line 3"][B]public[/B]: The public keyword is used again here, this time to indicate that the method being declared here should have public access as well. That means classes other than the HelloApp class can access and utilize it. All Java programs must have at least one class that declares a public method named main. The main method contains the statements that are executed when you run the program. [B]static[/B]: The word static is used to describe a special type of field or method that isn't associated with a particular instance of a class. Instead, static fields and methods are associated with the class itself. That means you don't have to create an instance of the class to access a static field or methods. Instead, you access a static field or method by specifying the class name, not a variable that references an object. [B]void[/B]: In Java, a method is a unit of code that can calculate and return a value. If a method doesn't need to return a value, you must use the void keyword to indicate that no value is returned. Because Java requires that the main method not return a value, you must specify void when you declare the main method. [B]main[/B]: The identifier that provides the name for this method. As I've already mentioned above, Java requires that this method be named main. besides the main method, you can also create additional methods with whatever names you want to use. [B](String[] args)[/b]: Commonly called a parameter list, it's used to pass data to a method. Java requires that the main method must receive a single parameter that's an array of String objects. By convention, this parameter is named args. If you don't know what a parameter, a string or an array is, don't worry about it. You'll figure out more in the next few sections of my guide lol. [/spoiler][spoiler="Line 4"]Another [B]{[/B]: Another set of brackets begins at line 4 and ends at line 6. These mark the body of the main method. Notice that the closing bracket on line 6 is paired with the opening bracket on line 4, while the closing bracket on line 7 is paired with the one on line 2. This type of pairing is commonplace in Java. In short, whenever you come to a closing bracket, it is paired with the most recent opening bracket that hasn't already been closed - that is, that hasn't already been paired with another closing bracket. [/spoiler][spoiler="Line 5"][B]System.out.println("Hello, world!");[/B]: This is the only statement in the entire program, basic, I know. It calls a method named println that belongs to the System.out object. The println method displays a line of text on the console. The text to be displayed is passed to the println method as a parameter in parentheses following the word println. In this case, the text is the string literal [I]Hello, world![/I] enclosed in a set of quotation marks. As a result, this statement displays the text [I]Hello, world![/I] on the console. Note that in Java, statements end with a semicolon. Because this is the only statement in the program, this line is the one that requires a semicolon.[/spoiler][spoiler="Line 6"][B]}[/B]: Line 6 contains the closing bracket that marks the end of the main method body that has begun by the bracket on line 4. [/spoiler][spoiler="Line 7"]Another [B]}[/B]: Line 7 contains the closing bracket that marks the end of the HelloApp class body that had begun by the bracket on line 2. Because this program consists of just one class, this line also marks the end of the application.[/spoiler] [/spoiler] [spoiler="Working with Statements"]Like most programming languages (PHP, HTML, C++ etc), Java uses statements to build programs. Unlike most programming languages, Java doesn't use statements as its fundamental unit of code. Instead, it gives that honor to the class. However, every class must have a body, and ever body must have a statement. In other words, you can't have a meaningful Java program without at least one statement. Hit the spoiler's below (thanks Anthony`) to find out more about statements.. [spoiler="Types of Statements"]Java has many different types of statements. Some statements simply create variables that you can use to store data. These types of statements are often called declaration statements, and tend to look like this: [code]int i String s = "This is a string statement lol."; Customer c = new Customer();[/code] Another common type of statement is an expression statement, which performs calculations. Here are some examples of expression statements: [code]i = a + b; anthony = ikilikiBaby * smudgeSucks; System.out.println("Hello, world!");[/code] Remember the last statement? I'm sure you do from the second spoiler you opened on this page! Thus, the single statement in the HelloApp program is an expression statement! There are many other kinds of statements besides these two. For example, if-then statements execute other statements only if a particular condition has been met, and statements such as "for, while or do" execute whole groups of statements one or more times. It's often said that every Java statement [U]must[/U] end with a semicolon. This is actually quite untrue. Some types of Java statements are required to end with semicolons, but there are some exceptions to that rule. The basic rule is that declaration and expression statements must end with a semicolon, but most other statement types do not. Where this rule gets tricky, however, is that most other types of statements include one or more declaration or expression statements that do use semicolons. For example, here's a typical if statement: [code]if (anthony > 9000) ikilikiBaby = 1;[/code] Here the variable named ikilikiBaby is given a value of 1 if the value of the total variable is greater than 9000 (he's over 9000!). The expression statement ends with semicolons, but the if statement itself doesn't. (The Java compiler lets you know if you use a semicolon when you shouldn't, I'm sure you know that by now though.)[/spoiler] [spoiler="White space"]In all reality, this is sometimes considered more of good practice than necessary programming, but who really cares. In Java, the term white space refers to one or more consecutive space characters, tab characters or line breaks. All white space is considered the same. In other words, a single space is treated the same as a tab or line break or any combination of spaces, tabs or line breaks. If you've programmed in Visual Basic (please tell me you haven't), white space is different from what you're going to be used to, my friend. In Visual Basic, line breaks mark the end of statements unless special continuation characters are used. In Java, you don't have to do anything special to continue a statement onto a second line. Thus the statement: [code]x = (y + 5) / z;[/code] is identical (in reality) to this statement: [code]x = (y + 5) / z;[/code] In fact, you could write either of those statements like this, and freak the shit outta your friends lol. [code]x = ( y + 5 ) / z ;[/code] I wouldn't technically advise it, since I'm trying to teach you to have good structure and programming technique, but the statement does compile and execute properly. (I wouldn't try this on your RSPS, you'll mess something up and complain about it to me). Using white space liberally in your programs is sometimes a good idea. In particular, you should routinely begin using line breaks to place each statement on a separate line and use tabs to line up elements that belong together. The compiler ignores the extra white space, so it doesn't affect the bytecode that's created for your program. As a result, using extra white space in your program doesn't affect your program's performance in any way, but it does make the program's source code quite easier to read.[/spoiler] [/spoiler] [spoiler="Working with Blocks"]A block is a group of one or more statements that's enclosed in brackets. A block begins with an opening bracket ({) and ends with a closing bracket (}). Between the opening and closing brackets, you can code one or more statements. For example, here's a block that consists of three statements: [code]{ int i, j; i = 100; j = 200; }[/code] A block is itself a type of statement. As a result, any time the Java language requires a statement, you can substitute a block to execute more than one statement. This is the syntax of a basic if statement: [code]if ( expression ) statement[/code] Here the statement can be a single statement or a block. If you find this idea confusing, don't worry. I'll try to explain this in more detail as we continue down that road, mkay pumpkin? You can code the brackets that mark a block in two generally popular ways. One is to place both brackets on seperate lines, and then indent the statements that make up the block. For example: [code]if ( i > 0 ) { String s = "Ikiliki would love to have Anthony's children..." System.out.println(s); }[/code] Which style you use is a matter of personal preference bro. I prefer the first style, and that's the style I'll use throughout this tutorial, so if you get confused down the road, drop a comment and I'll try to help you to best of my ability. Keep in mind, either style works, and many programmers prefer the second style because it's more concise.[/spoiler] [spoiler="Working with Identifiers"]An identifier is a word that you make up to refer to a Java programming element by name. Although you can assign identifiers to many different types of Java element, they're most commonly used for the following elements: [list][*]Classes, such as the HelloApp class explained in the above spoiler tag. [*]Methods, such as the main method in the HelloApp application. [*]Variables and fields, which hold data used by your program. [*]Parameters, which pass data values to methods.[/list] Identifiers are also sometimes called "names" lol. Strictly speaking, a name isn't quite the same thing as an identifier to most programmers, a name is often made up of two or more identifiers connected with periods (sometimes called dots lol). For example, in line 5 of the HelloApp program, System and out are both identifiers, but System.out is considered the "name". When practicing, the terms name and identifier are used interchangeably. There are some very basic rules to creating identifiers that will be actually useful to your program and anyone else whom sees your code: [list][*]Identifiers are case-sensitive. As a result, AnthonysLame and anthonysLame are two distinctive identifiers. [*]Idenitifiers can be made up of uppercase[LOLUSUCK] or lowercase letters[lolusuck], numbers[1-9], underscore[_] and dollarsign[$] characters. Although the dollarsign is most commonly seen in PHP and SQL. [*]All identifiers must behin with a letter. Thus anthony9292 is a valid identifier but 13smudgenuts isn't (because it begins with a number lol). [*]An identifier can't be the same as any of the Java keywords listed in the first spoiler. So you can't have a variable named for or a class named public. [*]The Java language specification recommends that you avoid using dollar signs in names you create. Instead, dollar signs are used by code generators to create identifiers. Thus avoiding dollar signs helps you avoid creating names that conflict with generated names.[/list] Following these few steps will help you with identifiers.[/spoiler] [spoiler="Working with Objects"]In Java, you can create an object from a class in several ways. But the most straightforward is to create a variable that provides a name you can use to refer to the object, use the new keyword to create an instance of the class and then assign the resulting object to the variable. Kinda confusing, but it'll be easier as you go on. The general form of a statement that does that bit of magic looks similar to this fellas: [code]ClassName variableName = new ClassName();[/code] For example, to create an object instance of a class named Class1 and to assign it to a variable named myClass1Object, you would write a statement like this: [code]Class1 myClass1Object = new Class();[/code] Confused? You should be. Now you may ask, why do you have to list the class name twice? The first time, you're providing a type for the variable. In other words.. you're saying that the variable you're creating here can be used to hold objects created from the Class1 class. The second time you list the class name, you're creating an object from within the class. The new keyword tells Java to create an object, and the class name provides the name of the class to use to create the object. The equal sign (=) lol is an assignment operator. It simply says to take the object created by the new keyword and assign it to the variable. Thus, this statement actually does three different things: [list][*]It creates a variable named myClass1Object that can be used to hold objects created from the Class1 class. At this point, no object has been created just yet, only a variable that can be used to store objects. [*]It creates a new object in memory from the Class1 class. [*]It assigns this newly created object to the myClass1Object variable. That way, you can use the myClassObject variable to refer to the object that was created.[/list] Just to give you a sneak peek of what object-oriented programming really looks like, I'll be showing you a HelloApp application, this time using two classes, one of which is actually made into an object when the program is run. The first class, named HelloApp2, is similar to the HelloApp class shown in the first project. However, it alters this time by using an object created from the second class, named Greetings, to actually display the "Hello, world!" message on the console. The Greeting class defines a method named sayHello that displays the message.[/spoiler] [spoiler="Second Project: HelloWorld 2"]Both the HelloApp and the Greeting classes are public classes. Java requires that each public class be stored in a separate file, with the same name as the class and the extension .java. As a result, the HelloApp2 class is stored in a file named HelloApp2.java and the Greeting class is stored in a file named Greeting.java. Moving along, here is the HelloApp2 class: [code]//This application displays a hello message on // the console by creating an instance of the // Greeting class, then calling the Greeting // object's sayHello method. // Copyright: ninjablood2 public class HelloApp2 { public static void main(String[] args) { Greeting myGreetingObject = new Greeting(); myGreetingObject.sayHello(); } }[/code] [spoiler="Line 1 through 5"]This class begins with a series of comment lines that identify the function of the program. For these comments, I used simple end-of-line comments rather than the traditional comments, seen in old programs.[/spoiler] [spoiler="Line 7"]The HelloApp2 class begins on line 6 with the public class declaration. Because the public keyword is used, a file named HelloApp2.java must contain this class.[/spoiler] [spoiler="Line 9"]The main method is declared using the same form as the main method in the first version of this program, worked on in the First Project. Generally you'll want to get used to this form because all Java applications must include a main method that's declared in this fashion.[/spoiler] [spoiler="Line 11"]The first line in the body of the main method creates a variable named myGreetingObject that can hold objects from the Greeting class. Then it creates a new object using the Greeting class and assigns this object to the myGreetingObject variable.[/spoiler] [spoiler="Line 12"]The second line in the body of the main method calls the myGreetingObject object's sayHello method. As you'll see in the next few spoilers, this method simply displays the message "Hello, world!" on the console.[/spoiler] Now for the Greeting class that is required for the above application. [code]// This class creates a Greeting object // that displays a hello message // on the console. // Copyright: ninjablood2 public class Greeting { public void sayHello(); { System.out.println("Hello, world!"); } }[/code] [spoiler="Line 1 through 4"]This class also begins with a series of comment lines that identify the function of a program.[/spoiler] [spoiler="Line 6"]The class declaration begins on this line. The class is declared as public so other classes can use it. This declaration is required so that the HelloApp2 class can access the Greeting class.[/spoiler] [spoiler="Line 8"]The sayHello method is declared using the public keyword so that it's available to other classes that use the Greeting class. The void keyword indicates that this method doesn't provide any data back to the class that calls it, and sayHello simply provides the name of the method.[/spoiler] [spoiler="Line 10"]The body of this method consists of just one line of code that displays the "Hello, world!" message on the console.[/spoiler] I'll go into deeper explanation on why the First Project and Second Project we've done differ. It's quite substantive as well. [/spoiler] [spoiler="Parallel Explanation"] Commonly known as DJP (Deterministic Parallel Java), this is an extension which adds parallel constructs that provide a deterministic programming model to OOL (Object Oriented Language) or OOP (Object Oriented Programming). Generally parallel programming in Java is becoming much more simple with tools such as the fork/join framework, Pervasive DataRush, Terracotta, and Hadoop. Java starts out with basic concurrency constructs, such as threading and synchronization, built into the language. "java.util.concurrent" was added in Java 5 and it features several utilities that can be taken into consideration when referencing parallel programming. While these all basically provide a setup for working with threads and implementing abstractions.. tools are coming into play as the strongest and easiest way to setup parallel structure within your java programming.. I'll finish more when I'm done with my entire guide, this is just a sneak peak.. [/spoiler] [B]I'm updating this constantly, and I'll try to do as much as I can each night. Remember I'm starting slow, so the advanced programmers, don't look too poorly upon my guides.[/B]
  10. Noobcoder

    Basic's

    ok guys as i had my earlier thread i have a 562 client and source downloaded. i want to know the small basic's of what to change yes i know its easy for you guys yet i am just starting so if u guys can help me with deep instructions would be great or link me to tutorials. 1) how to add npc and make it tradable for a shop 2) how to add the items to shop and price it all that 3) how to change ::home and what not tele's i would like were i can find the file to change it too please thanks :)
×