- UPDATE
February 1, 2016
- Finally fixed the walking issue. (Running and walking now works)
- Player saving/loading finished (I'm using json right now now, but might explore my options and check out YAML)
- Fixed walking into other regions.
- NPC Updating fully functional
- Fixed mobs that don't move from randomly walking.
- Starting working on switching client compatibility to RS2 317 Refactored
RS2 317 Refactored Client 474 Data (I'll post how to convert to various clients soon)
I'll post some media soon appending various npc update masks to show it works.
I'm going to separate player details from a players container. This is so incase something were to corrupt player details file, a player wont lose all their items because their container file will be fine; and vice-versa.
I know I'm missing a few attributes like IP, and some other useful information I'll be adding those. This is just temporarily.
Code:
{
"username": "test123",
"password": "test123",
"rights": "PLAYER",
"location": {
"x": 3161,
"y": 3493,
"height": 0
},
"newPlayer": false,
"autoRetaliate": false,
"enableSound": true,
"enableMusic": true,
"debugMode": false,
"appearance": {
"gender": "MALE",
"head": 0,
"jaw": 10,
"torso": 18,
"arms": 26,
"hands": 33,
"legs": 36,
"feet": 42,
"appearanceColor": {
"hairColor": 7,
"torsoColor": 8,
"legsColor": 9,
"feetColor": 5,
"skinColor": 0
}
},
"friendList": [],
"ignoreList": []
}
Here's a quick image, sorry I don't have a GIF my camtasia license ran out
I'll push the commit and soon as I fix the loading regions.
Originally Posted by
Mikey`
Some of this is documented, other parts have no documentation.
Use naming conventions.
Code:
private static Map<Integer, MobDrop[]> MOB_DROPS = new HashMap<>();
Also, the player class is already a mess and there's no content (afaik). You should implement a scripting system (java or otherwise)
You should just have a process method in the mob for it's local processing, not for all mob processing
Code:
public static void process() {
for (final Mob mob : World.getMobs()) {
if (mob == null) {
continue;
}
if (!mob.isRegistered()) {
continue;
}
Mobs.resetFacingDirection(mob);
if (!mob.isDead()) {
mob.resetEntityInteraction();
}
Mobs.handleRandomWalk(mob);
}
}
What is the "Players" class, it looks like a bunch of random code thrown into a class that has nothing to do with any of it.
I could post more examples but you get the point. It looks like you're copying and pasting a lot of poorly written code into this, you really shouldn't. There are some good things in here, others are not so good, and others are terrible. Finish the framework before you start throwing content into it.
You should consider this a learning project and scrap it after that, there are some good things in here and I hope to see more of them in future releases.
I'm already aware of that, no worries. This is the base of Battle-OS, so that's why there's a lot of unused content, and variables. I'll be cleaning it all up shortly.