Resource Layer Utility
Moderator: Phades
-
EnderWiggin
- Posts: 1156
- Joined: Sat Mar 20, 2010 8:23 pm
-
boshaw
- Posts: 1612
- Joined: Tue Jun 01, 2010 10:22 pm
Re: Resource Layer Utility
I felt like trying something new I suppose, I figure eventually i'll translate it later into Java for easy usage with users from it's current state or take the time to make it into an executable and test that; however, I've been busy lately.EnderWiggin wrote:Wow. Lisp, eh? Nice work, boshaw.
One thing that would be cool to eventually do is translate the VertexBuffer and a few other layers (which I assume to be directly related to the 3D models along with Image Layer for it's image texture) into actual 3D formats so you can edit them in blender or other programs alike.
-
aghmed
- Posts: 238
- Joined: Fri Sep 07, 2012 7:20 pm
- Location: between London and third part of LSD
Re: Resource Layer Utility
don't know why but many, many negs are broken (contains other size that it is in real)
examples:
vilage idol
leanto
plow (don't have any neg)
cow (same as plow)
chest
80% of moutain ridges
and many others
if someone know how to read neg files i can give fixed rectangles of broken objects (rectangle(int sizex, int sizey,int offcetx, int offcety))
examples:
vilage idol
leanto
plow (don't have any neg)
cow (same as plow)
chest
80% of moutain ridges
and many others
if someone know how to read neg files i can give fixed rectangles of broken objects (rectangle(int sizex, int sizey,int offcetx, int offcety))
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{

}}
/* oh, i love swing. */
class checkOutMyPathfinder{

}}
-
boshaw
- Posts: 1612
- Joined: Tue Jun 01, 2010 10:22 pm
Re: Resource Layer Utility
aghmed wrote:don't know why but many, many negs are broken (contains other size that it is in real)
examples:
vilage idol
leanto
plow (don't have any neg)
cow (same as plow)
chest
80% of moutain ridges
and many others
if someone know how to read neg files i can give fixed rectangles of broken objects (rectangle(int sizex, int sizey,int offcetx, int offcety))
Broken as in the they are compiled wrong by LayerUtil or that they are wrong to start with?
If it's the former then send me a file of what the output should be and i'll fix the issues with the program. If it's the latter then just decompile them, edit in the correct values and recompile.
Also HnH or Salem util?
-
aghmed
- Posts: 238
- Joined: Fri Sep 07, 2012 7:20 pm
- Location: between London and third part of LSD
Re: Resource Layer Utility
it's in HnH
well there are 2 types of bugs
1. zero neg
2. wrong neg size
i don't really know how it is calculated from neg into rectangle but
in case 1
plow
orginal rectangle size
(0,0)
offcet
(0,0)
proper size
size.x = 6;
size.y = 6;
offcet.x = -3;
offcet.y = -3;
case 2
orginal rectangle size
(21,9)
offcet
(-9,-5)
proper size
size.x = 21;
size.y = 10;
offcet.x = -9;
offcet.y = -5;
total broken negs i've found with my friend: 37
pm me if you can fix it having that data so i can send you all
well there are 2 types of bugs
1. zero neg
2. wrong neg size
i don't really know how it is calculated from neg into rectangle but
in case 1
plow
orginal rectangle size
(0,0)
offcet
(0,0)
proper size
size.x = 6;
size.y = 6;
offcet.x = -3;
offcet.y = -3;
case 2
orginal rectangle size
(21,9)
offcet
(-9,-5)
proper size
size.x = 21;
size.y = 10;
offcet.x = -9;
offcet.y = -5;
total broken negs i've found with my friend: 37
pm me if you can fix it having that data so i can send you all
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{

}}
/* oh, i love swing. */
class checkOutMyPathfinder{

}}
-
boshaw
- Posts: 1612
- Joined: Tue Jun 01, 2010 10:22 pm
Re: Resource Layer Utility
Just find all the resources with bad negs, decompile them with LayerUtil, fix the proper values within the neg.res folder/files, then recompile and useaghmed wrote:it's in HnH
-
aghmed
- Posts: 238
- Joined: Fri Sep 07, 2012 7:20 pm
- Location: between London and third part of LSD
Re: Resource Layer Utility
i'm not so pro in that stuff
neg file contains something like that
my data looks like that:
if i would know how to convert one into other i would do it long time ago
neg file contains something like that
Code: Select all
#NEG LAYER FOR RES: out///gfx\terobjs\trough.res
#Coord cc
52
47
#Coord bc
-7
-11
#Coord bs
16
20
#Coord sz
104
76
#Byte en
0
Code: Select all
size.x = 6;
size.y = 6;
offcet.x = -3;
offcet.y = -3;
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{

}}
/* oh, i love swing. */
class checkOutMyPathfinder{

}}
-
boshaw
- Posts: 1612
- Joined: Tue Jun 01, 2010 10:22 pm
Re: Resource Layer Utility
If you refer back to the first post in the thread i posted a snipit of code relating to the Neg layer and it's relation to the game (I added comments now):
I stated that the code above had something to do with drawing hitboxes of objects.
So from the looks of it the Coord BS seems to related to the SIZE, while Coord BC relates to it's position or offset.
With that being said, edit the files so BS and BC match your SIZE and OFFSET data and check ingame if it's working as you intended. If it still doesn't match up then i suggest experimenting with the values in Neg till you figure it out.
Code: Select all
if(Config.bounddb && ui.modshift) {
g.chcolor(255, 0, 0, 128); //Set color scheme
synchronized(glob.oc) { //Synchronize the object cache
for(Gob gob : glob.oc) { // Loop for each object
Drawable d = gob.getattr(Drawable.class); //get Drawable attribute
Resource.Neg neg;
if(d instanceof ResDrawable) { //check if it's of type ResDrawable
ResDrawable rd = (ResDrawable)d;
if(rd.spr == null) //Ignore if it doesn't have a sprint
continue;
if(rd.spr.res == null) //or if it's sprints res isn't in existence
continue;
neg = rd.spr.res.layer(Resource.negc); //get the Neg otherwise
} else if(d instanceof Layered) { //If it's not ResDrawable and instead Layered
Layered lay = (Layered)d;
if(lay.base.get() == null) //ignore if it has no base
continue;
neg = lay.base.get().layer(Resource.negc); //get the Neg otherwise from the base layer
} else {
continue; //ignore Object if neither Layered or ResDrawable
}
if((neg.bs.x > 0) && (neg.bs.y > 0)) { //If the bs isn't negative
Coord c1 = gob.getc().add(neg.bc); //Set the upper left?
Coord c2 = gob.getc().add(neg.bc).add(neg.bs); //add the bs to right lower right?
g.frect(m2s(c1).add(oc), //render
m2s(new Coord(c2.x, c1.y)).add(oc),
m2s(c2).add(oc),
m2s(new Coord(c1.x, c2.y)).add(oc));
}
}
}
g.chcolor();
}
So from the looks of it the Coord BS seems to related to the SIZE, while Coord BC relates to it's position or offset.
With that being said, edit the files so BS and BC match your SIZE and OFFSET data and check ingame if it's working as you intended. If it still doesn't match up then i suggest experimenting with the values in Neg till you figure it out.
-
aghmed
- Posts: 238
- Joined: Fri Sep 07, 2012 7:20 pm
- Location: between London and third part of LSD
Re: Resource Layer Utility
well we've brute fixed by "if(name.equals("gfx/..."){size=....;}"
honestly i am way to lazy to decompile and check how does it working by pressing random numbers
if you want pm me i will send you whole fixed rectangles so you can fix it in your custon client
honestly i am way to lazy to decompile and check how does it working by pressing random numbers
if you want pm me i will send you whole fixed rectangles so you can fix it in your custon client
public static class StupidJavaCodeContainer {
/* oh, i love swing. */
class checkOutMyPathfinder{

}}
/* oh, i love swing. */
class checkOutMyPathfinder{

}}
-
mvgulik
- Posts: 4098
- Joined: Fri May 21, 2010 2:29 am
Re: Resource Layer Utility
Mmm. Never looked at those two vars that way. But it makes more sens than what I had in my mind until now.boshaw wrote:Coord BS seems to related to the SIZE, while Coord BC relates to it's position or offset
@aghmed:
You might like to add some info/data on 'why' do you think there is something wrong. (I, at least, don't get it.)
+ Res file source? Think that might matter to.