I added all the corrections in the filter list except for these objects:
Hen/Cock/Chicken
Moth
Rabbit (or Hare as its called in the res files)
Dragonfly
Frog - correct hit-box but incorrect reading
Blood
Tree log
The listed objects above still are not showing the correct hit-box data. Reasons listed below:
Frog / Moth / Dragonfly are all listed as Rats. They get the same hit-box as the rat so in the case of the frog it coincidentally works out. But dragonfly's and moths don't have a hit-box and in this case causes issues. I have tried to find out why with no success.
Rabbits and Hen/Cock/Chickens have the same issue. They display as if they were the player with the players hit-box. Same attempts to figure out why they display as players have failed as the reasons with the ones listed above.
Tree logs I just kept with there hit-box as they give that nice red outline when you hide trees. Its just convenient and a bad workaround honestly. There might be a better solution so if one is found it should be added that instead of this one.
Blood is a whole mystery on its own. Plants(farm crops)/bushes/chanterelles all had hit-boxes so you could see that nice mini-plant random locations in that small tile they grow on. Ender have that nice simplified plants to remove the affect on farms. This caused issues so I had to go in and hardcode the hit-box in the code instead of the randomize reviving the info from the neg data. But here is the crazy thing. Blood have the same randomize affect so I tried to find and hardcode the blood neg data but mysteriously its not there. Its nowhere to be found and I cant fix it. Editing its neg values crashes when you see blood. The crash printout in the console points to Blood.java but that class or java file doesn't exist anywhere. I have no idea what the hell is going on so I just gave blood back its hit-box and left it at that. I hope someone can help figure out this crazy mystery as its driving me nuts.
But overall it takes a few lines here and there to fix the haven code to match up with the hit-box changes made with this new hit-box correct haven-res.jar. I hope someone that is interested in making pathfinder finds this useful and uses it.
This is the full filter list:
- Code: Select all
gfx/terobjs/blood
off=-5,-5
sz=11,11
gfx/terobjs/herbs/chantrelle
off=0,0
sz=0,0
gfx/tiles/wald/flavobjs/f1
off=0,0
sz=0,0
gfx/tiles/fen/flavobjs/f10
off=0,0
sz=0,0
gfx/tiles/moor/flavobjs/f1
off=0,0
sz=0,0
gfx/tiles/moor/flavobjs/f2
off=0,0
sz=0,0
gfx/tiles/moor/flavobjs/temp/f3
off=0,0
sz=0,0
gfx/tiles/moor/flavobjs/temp/f4
off=0,0
sz=0,0
gfx/tiles/heath/flavobjs/f1
off=0,0
sz=0,0
gfx/tiles/heath/flavobjs/f2
off=0,0
sz=0,0
gfx/terobjs/ridges/grass/ss
off=-10,-4
sz=14,7
gfx/terobjs/ridges/grass/e
off=-2,-11
sz=5,21
gfx/terobjs/ridges/grass/e2s
off=0,-21
sz=23,22
gfx/terobjs/ridges/grass/es
off=-5,-6
sz=7,16
gfx/terobjs/ridges/grass/ee
off=-4,-10
sz=7,14
gfx/terobjs/ridges/mountain/we
off=-11,0
sz=22,11
gfx/terobjs/ridges/mountain/ws
off=-11,-11
sz=22,11
gfx/terobjs/ridges/mountain/ne
off=-11,-11
sz=11,22
gfx/terobjs/ridges/mountain/ns
off=0,-11
sz=11,22
gfx/terobjs/ridges/mountain/ss
off=-10,0
sz=10,11
gfx/terobjs/ridges/mountain/ee
off=0,-10
sz=11,10
gfx/terobjs/furniture/coffer
off=-5,-4
sz=10,8
gfx/terobjs/furniture/leanto
off=-9,-5
sz=21,10
gfx/terobjs/furniture/wardrobe
off=-8,-3
sz=20,9
gfx/terobjs/furniture/bed-sturdy
off=-8,-5
sz=18,13
gfx/terobjs/furniture/cclosed
off=-3,-3
sz=7,4
gfx/terobjs/furniture/copen
off=-3,-3
sz=7,4
gfx/terobjs/vclaim
off=-12,-4
sz=27,8
gfx/terobjs/htable
off=-2,-5
sz=7,12
gfx/terobjs/crate
off=-6,-3
sz=14,7
gfx/terobjs/trough
off=-7,-4
sz=21,10
gfx/terobjs/dframe2
off=-3,-8
sz=4,18
gfx/terobjs/mining/ladder
off=-4,-1
sz=9,2
gfx/terobjs/lbox
off=-6,-7
sz=10,15
gfx/arch/gates/brick-ns
off=-5,-11
sz=10,21
gfx/arch/gates/fence-ns
off=-5,-11
sz=10,21
gfx/arch/gates/palisade-ns
off=-5,-11
sz=10,21
gfx/arch/gates/brick-we
off=-11,-5
sz=21,10
gfx/arch/gates/fence-we
off=-11,-5
sz=21,10
gfx/arch/gates/palisade-we
off=-11,-5
sz=21,10
gfx/arch/stairs-inn
off=-7,-11
sz=12,23
gfx/arch/door-inn
off=-11,-2
sz=19,5
gfx/kritter/plow/s
off=-3,-3
sz=6,6
gfx/kritter/cow/s
off=-4,-4
sz=11,11
gfx/kritter/cart/s
off=-5,-5
sz=10,10
gfx/kritter/rat/s
off=0,0
sz=1,1
gfx/kritter/deer/s
off=-4,-4
sz=11,11
gfx/kritter/bear/s
off=-8,-8
sz=16,16
gfx/kritter/fox/s
off=-3,-3
sz=7,7
gfx/kritter/troll/s
off=-8,-8
sz=16,16
gfx/terobjs/plants/beetroot
off=0,0
sz=0,0
gfx/terobjs/plants/carrot
off=0,0
sz=0,0
gfx/terobjs/plants/flax
off=0,0
sz=0,0
gfx/terobjs/plants/hemp
off=0,0
sz=0,0
gfx/terobjs/plants/hops
off=0,0
sz=0,0
gfx/terobjs/plants/onion
off=0,0
sz=0,0
gfx/terobjs/plants/peas
off=0,0
sz=0,0
gfx/terobjs/plants/pepper
off=0,0
sz=0,0
gfx/terobjs/plants/poppy
off=0,0
sz=0,0
gfx/terobjs/plants/tea
off=0,0
sz=0,0
gfx/terobjs/plants/tobacco
off=0,0
sz=0,0
gfx/terobjs/plants/wheat
off=0,0
sz=0,0
gfx/terobjs/plants/wine
off=0,0
sz=0,0
gfx/terobjs/plants/pumpkin
off=0,0
sz=0,0
Code needed to get the hit-boxes should look like this, much shorter then previously:
- Code: Select all
ArrayList<Rectangle> getAllNegs2(){
long time = System.currentTimeMillis();
int meOffcet = -2;
int meSize = 4;
if( ifYourInABoatTurnThisTrue ){
meOffcet = -14;
meSize = 26;
}
Gob player = getPlayerGob();
ArrayList<Rectangle> negRec = new ArrayList<Rectangle>();
synchronized(m_hPanel.ui.mainview.glob.oc){
for(Gob g : m_hPanel.ui.mainview.glob.oc){
String name = g.resname();
if( g == player ) continue;
if( g.getc().equals(player.getc() ) ) continue;
if( name.equals("gfx/terobjs/trees/log") ) continue;
if( name.equals("gfx/terobjs/blood") ) continue;
if( (name.equals("gfx/terobjs/hearth-play") && g.getattr(KinInfo.class) == null) ) continue;
if( (name.contains("/gates/") && g.GetBlob(0) == 2) ) continue;
if( name.contains("/items/") ) continue; //speed optimization
Coord offcet = new Coord();
Coord size = new Coord();
if(!kritterFix(g, offcet, size) ){
Resource.Neg neg = g.getneg();
if(neg == null){System.out.println("Error neg"); continue;}
offcet = neg.bc;
size = neg.bs;
}
if(size.x != 0){
Rectangle rect = new Rectangle(g.getc().x + offcet.x + meOffcet,
g.getc().y + offcet.y + meOffcet,
size.x + meSize,
size.y + meSize);
negRec.add(rect);
}
}
}
//System.out.println("Neg compleate. " + (System.currentTimeMillis() - time) );
return negRec;
}
boolean kritterFix(Gob g, Coord offcet, Coord size){ // fix for those pesky bugs
if(g.resname().contains("gfx/borka/s") && !g.isHuman()){
offcet.x = 0;
offcet.y = 0;
size.x = 1;
size.y = 1;
return true;
}else if(g.resname().contains("gfx/kritter/rat/s") ){
for(String s : g.resnames() ){
if(s.contains("gfx/kritter/dragonfly") || s.contains("gfx/kritter/moth") ){
offcet.x = 0;
offcet.y = 0;
size.x = 0;
size.y = 0;
return true;
}
}
}
return false;
}
Thanks again boshaw. Would never been able to fix all this without your awesome filter.