Thread: Simple fix, need help!

Results 1 to 9 of 9
  1. #1 Simple fix, need help! 
    Registered Member
    Join Date
    Dec 2013
    Posts
    11
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    So, I created a rsps, and I have the basics down. It's a 317 blank source and client. At the moment I have the home and respawn point set at Yanille. I have a few issues however.. I'm am not sure how to add objects to my server. I have tried and tried but the client file has nothing in it. Another issue is ALL of the npcs have 186 health and hit extremely high. If anyone can help me I would be very thankful..
    Reply With Quote  
     

  2. #2  
    Donator
    Mr Extremez's Avatar
    Join Date
    Jun 2012
    Posts
    2,219
    Thanks given
    90
    Thanks received
    291
    Rep Power
    60
    What base do you use?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Sep 2013
    Posts
    285
    Thanks given
    3
    Thanks received
    3
    Rep Power
    11
    All my servers that i've used [only] are in something along the lines of "objectHandler.java" or "objectManager.java" and the current source is the manager....


    you see something like this

    Code:
     		c.getPA().checkObjectSpawn(4874, 3091, 3486, 0, 10);
    you can copy that code and paste and use change with whats below.

    Code:
      		c.getPA().checkObjectSpawn(object id , x coord , y coord , i believe this is the way it faces, and i leave last one ten);

    as for nps, all of them do. is it the ::npc command or actually npc... because my npc command spawn monsters with alot of hp as well,.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Sep 2013
    Posts
    285
    Thanks given
    3
    Thanks received
    3
    Rep Power
    11
    Oh and you have to compile it, and if that didn't explain it you can give me an example object id, and coords and ill put it for you.... tis very easy.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Nov 2013
    Posts
    162
    Thanks given
    4
    Thanks received
    4
    Rep Power
    44
    Yup this is very much correct what "lrig" is saying, also if you want a remove a object there are some steps:

    Find objects position, either by calculating or use ::noclip to stand on top of it (added in most clients)
    Use ::mypos (added on most sources) to get your position.

    add this anywhere (under public void loadCustomSpawns(Client c) {)

    Code:
    c.getPA().object(-1, X coord, Y coord, 0, 10);
    and last step of course is to compile

    Message me for help with hosting server
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Jun 2012
    Posts
    510
    Thanks given
    33
    Thanks received
    50
    Rep Power
    0
    hp is in the spawn.cfg
    Reply With Quote  
     

  7. #7  
    Banned
    Join Date
    Jun 2012
    Posts
    510
    Thanks given
    33
    Thanks received
    50
    Rep Power
    0
    public void loadCustomSpawns(Client c) {
    c.getPA().checkObjectSpawn(-1, 2104, 3911, 1, 10);

    Paste your void.
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Dec 2013
    Posts
    11
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    I tried searching for objects in object handler, and nothing pops up. Here is my WHOLE object handler file
    // Xerozcheez: Credz to whitefang for releasing, saved me the time of making my own

    import java.io.*;

    public class ObjectHandler {
    public static int MaxObjects = 100000;
    //process() is called evry 500 ms
    public static int MaxOpenDelay = 120; //120 * 500 = 60000 / 1000 = 60s

    public static int[] ObjectOriID = new int[MaxObjects];
    public static int[] ObjectID = new int[MaxObjects];
    public static int[] ObjectX = new int[MaxObjects];
    public static int[] ObjectY = new int[MaxObjects];
    public static int[] ObjectH = new int[MaxObjects];
    public static int[] ObjectDelay = new int[MaxObjects];
    public static int[] ObjectOriType = new int[MaxObjects];
    public static int[] ObjectType = new int[MaxObjects];
    public static int[] ObjectOriFace = new int[MaxObjects];
    public static int[] ObjectFace = new int[MaxObjects];
    public static boolean[] ObjectOriOpen = new boolean[MaxObjects];
    public static boolean[] ObjectOpen = new boolean[MaxObjects];
    /*FIREMAKING*/
    public static int FireDelay = 80; //80 * 500 = 40000 / 1000 = 40s
    public static int FireGianDelay = 10; //10 * 500 = 5000 / 1000 = 5s
    public static int[] ObjectFireID = new int[MaxObjects];
    public static int[] ObjectFireX = new int[MaxObjects];
    public static int[] ObjectFireY = new int[MaxObjects];
    public static int[] ObjectFireH = new int[MaxObjects];
    public static int[] ObjectFireDelay = new int[MaxObjects];
    public static int[] ObjectFireMaxDelay = new int[MaxObjects];
    public static int[] ObjectFireDeletecount = new int[MaxObjects];

    ObjectHandler() {
    for(int i = 0; i < MaxObjects; i++) {
    ObjectID[i] = -1;
    ObjectX[i] = -1;
    ObjectY[i] = -1;
    ObjectH[i] = -1;
    ObjectDelay[i] = 0;
    ObjectOriType[i] = 1;
    ObjectType[i] = 1;
    ObjectOriFace[i] = 0;
    ObjectFace[i] = 0;
    ObjectOriOpen[i] = false;
    ObjectOpen[i] = false;
    ResetFire(i);
    }
    loadObjects("config\\objects.cfg");
    }

    public void process() {
    for(int i = 0; i < MaxObjects; i++) {
    if (ObjectID[i] > -1) {
    if (ObjectDelay[i] > 0) {
    ObjectDelay[i]--;
    }
    if (ObjectDelay[i] == 0) {
    if (ObjectOpen[i] != ObjectOriOpen[i]) {
    for (int j = 0; j < server.playerHandler.maxPlayers; j++) {
    if (server.playerHandler.players[j] != null) {
    server.playerHandler.players[j].ChangeDoor[i] = true;
    }
    }
    ObjectOpen[i] = ObjectOriOpen[i];
    }
    }
    }
    }
    }

    public boolean loadObjects(String FileName) {
    String line = "";
    String token = "";
    String token2 = "";
    String token2_2 = "";
    String[] token3 = new String[10];
    boolean EndOfFile = false;
    int ReadMode = 0;
    BufferedReader characterfile = null;
    try {
    characterfile = new BufferedReader(new FileReader("./"+FileName));
    } catch(FileNotFoundException fileex) {
    misc.println(FileName+": file not found.");
    return false;
    }
    try {
    line = characterfile.readLine();
    } catch(IOException ioexception) {
    misc.println(FileName+": error loading file.");
    return false;
    }
    while(EndOfFile == false && line != null) {
    line = line.trim();
    int spot = line.indexOf("=");
    if (spot > -1) {
    token = line.substring(0, spot);
    token = token.trim();
    token2 = line.substring(spot + 1);
    token2 = token2.trim();
    token2_2 = token2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token2_2 = token2_2.replaceAll("\t\t", "\t");
    token3 = token2_2.split("\t");
    if (token.equals("object")) {
    for (int i = 0; i < MaxObjects; i++) {
    if (ObjectID[i] == -1) {
    ObjectOriID[i] = Integer.parseInt(token3[0]);
    ObjectID[i] = Integer.parseInt(token3[0]);
    ObjectX[i] = Integer.parseInt(token3[1]);
    ObjectY[i] = Integer.parseInt(token3[2]);
    ObjectH[i] = Integer.parseInt(token3[3]);
    ObjectOriFace[i] = Integer.parseInt(token3[4]);
    ObjectFace[i] = Integer.parseInt(token3[4]);
    ObjectOriType[i] = Integer.parseInt(token3[5]);
    ObjectType[i] = Integer.parseInt(token3[5]);
    if (token3[6].equals("true")) {
    ObjectOriOpen[i] = true;
    ObjectOpen[i] = true;
    }
    break;
    }
    }
    }
    } else {
    if (line.equals("[ENDOFOBJECTLIST]")) {
    try { characterfile.close(); } catch(IOException ioexception) { }
    return true;
    }
    }
    try {
    line = characterfile.readLine();
    } catch(IOException ioexception1) { EndOfFile = true; }
    }
    try { characterfile.close(); } catch(IOException ioexception) { }
    return false;
    }
    /*FIREMAKING*/
    public void firemaking_process() {
    for(int i = 0; i < MaxObjects; i++) {
    if (ObjectFireID[i] > -1) {
    if (ObjectFireDelay[i] < ObjectFireMaxDelay[i]) {
    ObjectFireDelay[i]++;
    } else {
    for (int j = 1; j < server.playerHandler.maxPlayers; j++) {
    if (server.playerHandler.players[j] != null) {
    server.playerHandler.players[j].FireDelete[i] = true;
    }
    }
    }
    }
    }
    }
    public void ResetFire(int ArrayID) {
    ObjectFireID[ArrayID] = -1;
    ObjectFireX[ArrayID] = -1;
    ObjectFireY[ArrayID] = -1;
    ObjectFireH[ArrayID] = -1;
    ObjectFireDelay[ArrayID] = 0;
    ObjectFireMaxDelay[ArrayID] = 0;
    }
    }
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Sep 2013
    Posts
    285
    Thanks given
    3
    Thanks received
    3
    Rep Power
    11
    then it's objectManager.java where you will place the objects.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Simple error need help ASAP
    By e for ever in forum Help
    Replies: 2
    Last Post: 12-03-2011, 07:26 PM
  2. Chatbox fix, need help. (Fullscreen)
    By thim slug in forum Help
    Replies: 2
    Last Post: 02-15-2011, 12:19 PM
  3. Simple Fix, NEED HELP WILL REP++
    By rushranqe in forum Help
    Replies: 1
    Last Post: 12-11-2010, 07:57 PM
  4. Replies: 8
    Last Post: 09-12-2009, 09:19 AM
  5. item fix need help please
    By wildjjbug in forum Help
    Replies: 0
    Last Post: 06-30-2009, 07:19 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •