is there a npcHandler process?
|
Paying up to 10 dollars for someone to fix my soul splits spawnconfig lmfao..
Basicly my spawn-config.cfg npcs aren't spawned..
Code:public NPCHandler() { for(int i = 0; i < maxNPCs; i++) { npcs[i] = null; } for(int i = 0; i < maxListedNPCs; i++) { npcDef[i] = null; } (new NPCDrops()).loadDrops(); loadAutoSpawn(); }As you can see it should be printing but it doesn't.Code:public void loadAutoSpawn() { try { Scanner s = new Scanner(new File("./data/cfg/spawn-config.cfg")); while(s.hasNextLine()) { String str = s.nextLine(); if(str.startsWith("//")) { System.out.println("returned tr0ll."); return; } if(!str.startsWith("#")) { String[] args = str.split("\t"); int id = Integer.parseInt(args[0]); int x = Integer.parseInt(args[1]); int y = Integer.parseInt(args[2]); int z = Integer.parseInt(args[3]); if(npcDef[id] != null) { System.out.println("spawned npc tr0ll."); this.newNPC(id, x, y, z, 1, npcDef[id].npcHealth, npcDef[id].maxHit, 0, 0); } else { System.out.println("Couldn\'t spawn npc: " + id + " because the definition is empty."); } } } s.close(); } catch (IOException var8) { ; } }
PM me msn
is there a npcHandler process?
Code:public boolean loadAutoSpawn(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("spawn")) { newNPC(Integer.parseInt(token3[0]), Integer.parseInt(token3[1]), Integer.parseInt(token3[2]), Integer.parseInt(token3[3]), Integer.parseInt(token3[4]), getNpcListHP(Integer.parseInt(token3[0])), Integer.parseInt(token3[5]), Integer.parseInt(token3[6]), Integer.parseInt(token3[7])); } } else { if (line.equals("[ENDOFSPAWNLIST]")) { 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; }Erm make new file called spawnConfig2.cfgCode:loadAutoSpawn("./data/cfg/spawnConfig2.cfg");
Code:// npc spawnX spawnY height walk maxhit attack defence description spawn = 6970 3080 3505 0 1 0 0
Omg so close..
And is it any way to keep my current spawnConfigCode:src\server\model\npcs\NPCHandler.java:1030: cannot find symbol symbol : class BufferedReader location: class server.model.npcs.NPCHandler BufferedReader characterfile = null; ^ src\server\model\npcs\NPCHandler.java:1032: cannot find symbol symbol : class BufferedReader location: class server.model.npcs.NPCHandler characterfile = new BufferedReader(new FileReader("./"+F ileName)); ^ src\server\model\npcs\NPCHandler.java:1032: cannot find symbol symbol : class FileReader location: class server.model.npcs.NPCHandler characterfile = new BufferedReader(new FileReader("./"+F ileName)); ^ Note: src\server\net\StaticPacketBuilder.java uses or overrides a deprecated API . Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 3 errors
Please do learn java and learn to import
Code:import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter;
Shit it crashes when i run it..Code:Exception in thread "main" java.lang.ExceptionInInitializerError Caused by: java.lang.ArrayIndexOutOfBoundsException: 7 at server.model.npcs.NPCHandler.loadAutoSpawn(NPCHandler.java:1060) at server.model.npcs.NPCHandler.<init>(NPCHandler.java:96) at server.Server.<clinit>(Server.java:49) Could not find the main class: server.Server. Program will exit. Press any key to continue . . .
And yeh i added ENDOFSPAWNLIST or w.e in spawnConfig2 aswell.
Any suggestions?
Red crashes it
Code:public boolean loadAutoSpawn(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("spawn")) { newNPC(Integer.parseInt(token3[0]), Integer.parseInt(token3[1]), Integer.parseInt(token3[2]), Integer.parseInt(token3[3]), Integer.parseInt(token3[4]), getNpcListHP(Integer.parseInt(token3[0])), Integer.parseInt(token3[5]), Integer.parseInt(token3[6]), Integer.parseInt(token3[7])); } } else { if (line.equals("[ENDOFSPAWNLIST]")) { 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; }
bump need asap!
Had same problem, but fixed 100% soulsplit release by iRamie worked.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |