Purpose: Adding global objects
Files modified: Client.java
Difficulty: 1/10
Server tested on: DeathMoon
This is assuming you have the GetObject void, i will NOT provide it. (NO CREDITS FOR ME)
This tutorial was written by Sacred of Runelocus/Silabsoft forums, it is not to be used by ANYONE, in any means. Because using this tutorial, ask the author.
A few notes: If you already have public void newObjects, then skip step 1.
1. Adding the global objects void:
In client.java , search for
CODE
Code:
/* OBJECTS MAIN */
and add in this code underneath it
CODE
Code:
public void makeGlobalObject(int x, int y, int typeID, int orientation, int tileObjectType){ //Makes Global objects
for (Player p : server.playerHandler.players)
{
if(p != null)
{
client person = (client)p;
if((person.playerName != null || person.playerName != "null"))
{
if(person.distanceToPoint(x, y) <= 60)
{
person.createNewTileObject(x, y, typeID, orientation, tileObjectType);
}
}
}
}
}
and below the piece of coding you just added , add this in:
- Fill the XXXX and the YYYY with the X and Y coordinates of your objects (where you want them to be)
- Replace [ID] with the objects ID number, you can find a list of objects here: [Only registered and activated users can see links. ]
- Replace [Direction] with the direction you want your object to be facing (0 = west, -1 = north, -2 = east, -3 = south)
- Leave the 10 as it is.
And that's all there is to it. This is a very basic tutorial , if you want i'll write one on making them do something