PDA

View Full Version : A few basic things about 562s



Mod Joe
June 17th, 2010, 18:51
Hi there, this tut will give you a basic idea of a 562[Rs2hd] server and getting around the Source, just how to keep it alive...Etc.

Okay, firstly, when you have it setup etc..to change the name of your server(If using Rs2hd) simply go to - Data>Scripts>Authentication. When you open the file...Open it is as a notepad from your selected browsers. Then you should see something like this :

player.getActionSender().sendMessage("Welcome to Bla Bla Bla");
Just edit that to make it so what you wish, then compile..

Okay, Secondly, now we go onto adding Npc's, First off when you open your Source, go into Data>Npcs.Xml,(there are a couple of ways of adding these) you will "hopefully" see something like:

<npc><id>320</id><location><x>2840</x><y>3431</y><z>0</z></location></npc>
To find the X and Y coords of your disired posistion simply stand on the spot you would like and type "coords" in your Commands Screen.
Just copy and paste that two or one line undearneath and where you see "<id>320</id>" just simply change the id to your npc id you have chosen. Where you see the "<x>2840</x>" Is the first coords, the "x" simply change that and same with the "y" and the 0 in "<z>0</z>" Is the height of ground where your placing your npc.
The second way of adding it is the "Down" method. Scroll down when you open your Npcs.xml and you will see something like...:

<npc>
<id>115</id>
<location>
<x>2495</x>
<y>3089</y>
<z>0</z>
</location>
<walkType>RANGE</walkType>
<minimumCoords>
<x>2602</x>
<y>3096</y>
<z>0</z>
</minimumCoords>
<maximumCoords>
<x>2606</x>
<y>3099</y>
<z>0</z>
</maximumCoords>
</npc>
Same method again. Where you see the Npc id change to your desired one and where you see your x and y coords change to what you wish.

Thirdly, Changing your home, simply go into Src>Com>Rs2hd>Model>Entity.java. Once your in there you will see something like:

public static final Location DEFAULT_LOCATION = Location.location(3163, 3482, 0)
And....

public static final Location CLAN_DEATH = Location.location(3163, 3482, 0);
On the first one where you see "(3163, 3482, 0)" that is the coords of where you login...so like you have learned earlier in this tutorial about getting your coords, simply do the same, and with the second one, that is where you die. Simply change your coords again.

And, Fourthly, adding objects. Go to Src>Com>Rs2hd>PacketHandler>Object1PackHandler.Java, you will need the id of your Object...to start with. Once you have that it will be something like:

case 0000://hi
player.WalkTo().WalkTo(player, 3417, 3540);
if(player.getLocation().getX() == 3417 && player.getLocation().getY() == 3540) {
World.getInstance().registerEvent(new Event(100) {
public void execute() {
player.tele(3412, 3540, 1);
this.stop();
}
});
}
break;
Where you see "case 0000" change it to your Object id. and where you see "player.WalkTo().WalkTo(player, 3417, 3540);" They are the coords to right infront of your object, so it walks to it instead of making it tele you way furthur back, and the same with: "if(player.getLocation().getX() == 3417 && player.getLocation().getY() == 3540) {" They are the coords to right infornt of your object also.. and the "player.tele(3412, 3540, 1);" Is simply the "outcome" coords to where your player ends up on clicking the object. If you would like to make your player have some sort of... Gfx? or Emote? to when clicking the object, the code for having a emote would be something like....:

player.animate(0000, 0);
and change the "0000" to what your emote id is.
Also for adding gfx to when clickin on your object will be something like.....:

player.graphics(0000, 0);
Same again... Change your "0000" to what your gfx id is.

Thank you, i hope this guide helps new commers to 562's. :)

TehCow
June 17th, 2010, 19:08
Might help the noobs out a bit. easy.

Mod Joe
June 17th, 2010, 19:12
Yea, was intending to do that. :)

kevin
June 17th, 2010, 21:04
Nice tut. If not leeched.


..


JKS LOL NICE TUT KEEP IT UP.

Fly
June 17th, 2010, 21:05
Thank you for the guide. (It will help the "newbies").

jamie
June 17th, 2010, 21:19
Lol though this was a copy and paste tut. But thanks!

Joe
June 18th, 2010, 02:49
Great Teaching 562 Thread good job joe

Desire
June 18th, 2010, 02:51
Great guide! It will help the new coders do a little with the 562 servers.

Aaron
June 18th, 2010, 02:53
Nice tutorial:D

Mod Joe
June 18th, 2010, 08:57
Thank you, :)

Dark Resurrection
June 18th, 2010, 22:49
Nice tutorial:D

What he said

tyshoun123
May 16th, 2011, 18:34
hey wen i changed home none of the normal players can tele there only owner (me) and my co owner for sum reason. yes i changed command to the right coords and i changed it in entity as well help?

davidpaceway
May 30th, 2011, 07:49
hey wen i changed home none of the normal players can tele there only owner (me) and my co owner for sum reason. yes i changed command to the right coords and i changed it in entity as well help?

First change the defualt and for the command to teleport you only changed the one in command.java.
You have to do the same for commands.java

jortjuh
February 23rd, 2012, 14:12
I like it, for people like me. I just started 562 coding and still need to find out where some things are placed.

Also i have one question: Do you know how to change a name of a npc and if it is possible to change the way it's facing on spawn.