Thread: Adding global objects(REPOST)

Results 1 to 2 of 2
  1. #1 Adding global objects(REPOST) 
    deathmoon
    Guest
    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:


    CODE
    Code:
    public void NewObjects() {

    You now have the required voids

    2. Adding global objects

    Underneath

    CODE
    Code:
    public void NewObjects() {

    Add this to make an object:


    CODE
    Code:
               makeGlobalObject(XXXX, YYYY, [ID], [Direction], 10);

    - 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
     

  2. #2  
    Expert Programmer


    Join Date
    Dec 2007
    Posts
    2,018
    Thanks given
    52
    Thanks received
    84
    Rep Power
    986
    frogot to initilize it

    NewObjects();
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •