} else if (type == 1) {
int length = stream.readUnsignedByte();
if (length > 0) {
if (modelIds == null || lowMemory) {
modelTypes = new int[length];
modelIds = new int[length];
for (int i = 0; i < length; i++) {
modelIds[i] = stream.readUShort();
modelTypes[i] = stream.readUnsignedByte();
}
} else {
stream.currentPosition += length * 3;
}
}
} else if (type == 2) {
name = stream.readString();
} else if (type == 3) {
description = stream.readString();
} else if (type == 5) {
int len = stream.readUnsignedByte();
if (len > 0) {
if (modelIds == null || lowMemory) {
modelTypes = null;
modelIds = new int[len];
for (int l1 = 0; l1 < len; l1++)
modelIds[l1] = stream.readUShort();
} else {
stream.currentPosition += len * 2;
}
}
} else if (type == 14) {
objectSizeX = stream.readUnsignedByte();
} else if (type == 15) {
objectSizeY = stream.readUnsignedByte();
} else if (type == 17) {
solid = false;
} else if (type == 18) {
impenetrable = false;
}
else if (type == 19)
isInteractive = (stream.readUnsignedByte() == 1);
else if (type == 21)
contouredGround = true;
else if (type == 22)
delayShading = false;
else if (type == 23)
occludes = true;
else if (type == 24) {
animation = stream.readUShort();
if (animation == 65535)
animation = -1;
} else if (type == 28)
decorDisplacement = stream.readUnsignedByte();
else if (type == 29)
ambientLighting = stream.readSignedByte();
else if (type == 39)
lightDiffusion = stream.readSignedByte();
else if (type >= 30 && type < 39) {
if (interactions == null)
interactions = new String[5];
interactions[type - 30] = stream.readString();
if (interactions[type - 30].equalsIgnoreCase("hidden"))
interactions[type - 30] = null;
} else if (type == 40) {
int i1 = stream.readUnsignedByte();
modifiedModelColors = new int[i1];
originalModelColors = new int[i1];
for (int i2 = 0; i2 < i1; i2++) {
modifiedModelColors[i2] = stream.readUShort();
originalModelColors[i2] = stream.readUShort();
}
} else if (type == 41) {
int j2 = stream.readUnsignedByte();
modifiedTexture = new short[j2];
originalTexture = new short[j2];
for (int k = 0; k < j2; k++) {
modifiedTexture[k] = (short) stream.readUShort();
originalTexture[k] = (short) stream.readUShort();
}
} else if (type == 82)
minimapFunction = stream.readUShort();
else if (type == 62)
inverted = true;
else if (type == 64)
castsShadow = false;
else if (type == 65)
scaleX = stream.readUShort();
else if (type == 66)
scaleY = stream.readUShort();
else if (type == 67)
scaleZ = stream.readUShort();
else if (type == 68)
mapscene = stream.readUShort();
else if (type == 69)
surroundings = stream.readUnsignedByte();
else if (type == 70)
translateX = stream.readShort();
else if (type == 71)
translateY = stream.readShort();
else if (type == 72)
translateZ = stream.readShort();
else if (type == 73)
obstructsGround = true;
else if (type == 74)
hollow = true;
else if (type == 75)
supportItems = stream.readUnsignedByte();
else if (type == 77) {
varp = stream.readUShort();
if (varp == 65535) {
varp = -1;
}
varbit = stream.readUShort();
if (varbit == 65535) {
varbit = -1;
}
int length = stream.readUnsignedByte();
childrenIDs = new int[length];
for (int i = 0; i < length; i++) {
childrenIDs[i] = stream.readUShort();
if (childrenIDs[i] == 65535) {
childrenIDs[i] = -1;
}
}
}
Hi thanks,
the link is dead on that thread, would you happen to have another so I can play around?
Also is this used for defining object positions? I've noticed when using multiple locs the positions of objects will change and new ones will spawn etc... How does this work?
the link is dead on that thread, would you happen to have another so I can play around?
Also is this used for defining object positions? I've noticed when using multiple locs the positions of objects will change and new ones will spawn etc... How does this work?
Loc files only contain information about the object such as which models it has, what name and actions it has and what color it has ingame.
The only use in loading multiple locs is having objects from different revisions. For example if you want to load the Abyssal Sire area you would want a
OSRS loc because the 317 doesn't contain the data you need for the objects of the area, yet you would want the keep the 317 loc if you want your edgeville
to look like 317 edgeville and not OSRS edgeville.
Consider this a short version of what happends when you load a map file
1) Mapfile is loaded
2) Object IDs and positions are extracted
3) loc file is searched for object ID
4) model, name, actions etc are retrieved from the loc
5) object models etc are loaded from the cache
6) object is displayed ingame with actions, name, models etc retrieved earlier
As I said the position of objects is handled in map files (index 4 in your cache). The easiest way of adding custom objects ingame
is just hardcoding them although if you want to do it properly you could use a map edittor (there are a few but they are mediocre or hard to get to work).