View Full Version : collision data / visual profile help, something's not right

07-08-2008, 04:26 PM
For some reason the little yellow crosshairs are in the upper left corner of my entity. I can't change the position of it either. It's screwing some things up. Is there a way to change position? This is an entity i brought in as a blank entity, I think this has something to do with it. Hypno-Joe's "crosshairs" are fine, but the dummy baddie is having the problem

07-08-2008, 10:04 PM
The crosshairs show where the real X/Y of the tile/entity is. It's in the upper left because things that don't use visual profiles default to "upper-left" alignment for their images.

After you assign a visual profile by script, you can use the visual profile editor to move around the image offset, or set different alignment in its visual profile.

The new version under construction renames the visual profile editor to the "Alignment Editor" and now will work on everything, not just visual profiles, so it WILL be possible to set alignment/offsets of anything, this will simplify things a bit.

07-09-2008, 03:57 AM
Here's my brainlessdummy.xml file -- visual profile for the BrainlessDummy character...

Note, you can use the in-game visual profile editor to tweak the x/y offsets, faster than trying to do it in here.

//VisualProfile for the Brainless Dummy. July 2nd, 2008 at 2:22 PM


<profile name="BDummy">

<anim state="idle_left" spritename="idle_right" mirrorx="yes" x="0" y="0"/>
<anim state="idle_right" spritename="idle_right" mirrorx="no" x="0" y="0"/>

<anim state="walk_left" spritename="walk_right" mirrorx="yes" x="64" y="64"/>
<anim state="walk_right" spritename="walk_right" mirrorx="no" x="64" y="64"/>


//Actual sprite data below, that the above profile(s) reference

//also note that we only have graphics for one direction, but use the mirrox keyword in the profile definition (above) to fake both dirs

<sprite name="walk_right">
<image file="../maps/_Graphics/DummyWalk_right.png">
<grid size="128,128" array="4,1"/>

<translation origin="center"/>
<animation pingpong="no" loop="yes" speed="300" on_finish="last_frame"/>

<sprite name="idle_right">
<image file="../maps/_Graphics/DummyWalk_right.png">
<grid pos="128,0" size="128,128" array="1,1">

<translation origin="center"/>


Note the x and y up at the top for the walk animation states says 64,64 -- I believe the image offset editor did that, otherwise if it's set to 0,0, the image is offset off the entity where the crosshairs are in the middle of the image, but not the entity itself.

07-09-2008, 04:15 AM
Okay i'm going to attach 2 jpg's, one being in the editor, and a smaller being in game. Notice how the sprite (not Joe but the other) is sitting above the light blue rectangle/platform -- This is not a mistake, it's the result of the actual entity's position being down and to the right, and the collision data being there too.

07-09-2008, 11:06 PM
Hey, we already talked about this but for others, the answer was basically "ignore that the selection box is off and keep in mind after changing the centering you'll have to move the collision shape to fit over the image right."

I'll try to make the selection box more accurate in the next version...

07-10-2008, 06:53 PM
Yes, and it works, but of course, I can't see the actual position of the entity until I actually move it, then suddenly it jumps to position.

As far as trying to make it "more accurate", I think there's a definite issue here, rather than just being off, because Joe's sprite and his animations have the crosshairs in the correct place. And the idle animations for the dummy are also correct, it's only the walking animations for the brainless dummy that gets messed up.

It's not much of a problem though like you said move the collision poly to cover the image correctly. But just an annoyance in the editor. Also potentially could mess you up when you are legitimately trying to change the offset in relation to the original position. (Which is why you made it allowable to have an offset in the first place). If I wanted all facing left, to be moved to the left by 3 units, for instance, I'd move it, but then when it came to the one where it was off (as in this case it's off by a whole 64 units), i'd have to make sure it was 64+3 = 67. Not that you really can look at the numbers closely, i'm just saying, don't assume because one animation is 3,0 that the other's are going to be 3,0 -- you have to compensate for it.

Thanks for you patience and help Seth

07-13-2008, 03:23 AM
Just a note, try the new version, the image alignment editor is fixed up a lot, and you can see the offsets and even manually type them in.

Warning: Although it looks like you can change the centering mode (top_left, center, etc) on a visual profile anim, that part isn't actually saved to the profile .xml file yet...