Results 1 to 7 of 7

Thread: collision data / visual profile help, something's not right

  1. #1
    Knight
    Join Date
    Nov 2006
    Location
    Oregon
    Posts
    99

    Default collision data / visual profile help, something's not right

    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

  2. #2
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,345

    Default

    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.
    Seth A. Robinson
    Robinson Technologies

  3. #3
    Knight
    Join Date
    Nov 2006
    Location
    Oregon
    Posts
    99

    Default

    Here's my brainlessdummy.xml file -- visual profile for the BrainlessDummy character...

    Code:
    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
    
    <resources>
    	
    	<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"/>
    
    	</profile>
      
    //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"/>
    		</image>
    	
    		<translation origin="center"/>
    		<animation pingpong="no" loop="yes" speed="300" on_finish="last_frame"/>
    	</sprite>
    
    	<sprite name="idle_right">
    		<image file="../maps/_Graphics/DummyWalk_right.png">
    			<grid pos="128,0" size="128,128" array="1,1">
    		</grid>
    
    		<translation origin="center"/>
    	</image>
    		
    </sprite></resources>
    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.

  4. #4
    Knight
    Join Date
    Nov 2006
    Location
    Oregon
    Posts
    99

    Default

    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.
    Attached Images Attached Images    

  5. #5
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,345

    Default

    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...
    Seth A. Robinson
    Robinson Technologies

  6. #6
    Knight
    Join Date
    Nov 2006
    Location
    Oregon
    Posts
    99

    Default

    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

  7. #7
    Administrator Seth's Avatar
    Join Date
    Jul 2002
    Location
    Japan
    Posts
    5,345

    Default

    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...
    Seth A. Robinson
    Robinson Technologies

Similar Threads

  1. Collision data seems to be lost whenever I install a new version of NS
    By Uhfgood in forum Novashell Game Creation System
    Replies: 1
    Last Post: 07-08-2008, 10:39 PM
  2. Visual Studio Express c++ 8 help ??
    By babyvegas in forum Official ClanLib SDK Forums
    Replies: 1
    Last Post: 06-19-2008, 07:11 AM
  3. about save data
    By DavinciZhe in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 01-24-2008, 03:18 PM
  4. CL 0.8 pixel data deleter class
    By Trigve in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 10-27-2007, 11:33 AM
  5. How to use the vector data from CL_Raw ?
    By ARme in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 12-21-2006, 08:35 PM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •