View Single Post
Old 26 September 2017, 17:45   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Quote:
Originally Posted by Brick Nash View Post
Right folks, after three days of tearing my hair out I've discovered why one of my biggest issues keeps happening. The thing is I haven't found a solution as yet, just a very clumsy workaround but I thought I'd share it just in case anyone else was having the same issue.

The problem was that the images in my object bank were seemingly getting flipped horizontally at random. I'd start a game and there'd be maybe a few frames out a walk animation which were the wrong way round or maybe one frame out of a punch animation which had been flipped.

It was incredibly frustrating, especially when trying to check animations for things I'm working on.

Anyway I discovered that when the program is exited by pushing ctr+c, Amos automatically saves whatever has happened to the images in regard to X-flipping, to the bank (the one held in temporary memory for the program, not the actual saved file).

For example if the games starts and the default X-Flip variable is set to false (facing right) and the player taps the joystick left, that would set the flip variable to true (facing left) and activate the $8000+n instruction. Now the bob is facing left on the first frame of a walk animation.

If the game is then exited back to the editor, that first frame of the walk animation will get automatically stored in the temp object bank facing that direction whereas the other frames in the animation set would still be the correct way around.

Since the game obviously re-uses this temporary bank when the game restarts all the variables for flipping get reset back to the default false (facing right), but the problem is that they will also be the default setting for the frame which is the wrong way round.

I'm not sure why Amos does this as it serves no real purpose if the game is being restarted. At first I thought it was my code or even the Hrev()/$8000+n instruction which was glitchy, but it turns out the code itself is absolutely fine.

It seems the only solution is to go into the object editor and re-load the fresh bank from the file every single time the game is exited and then exit the object editor to get the "save current bank to program" prompt. It's kind of clumsy and irritating to do and I've hit the save button instead of the load one a few times by mistake now and had to reset the images by hand before saving again.

My failed solution was to try and auto re-load the image bank every time the game is exited so there is a correct set of images all facing the right way in the bank (refreshing the set essentially).

I did this by putting a command in the main loop whereby if ctrl +c is pressed then it would re-load the images from the saved bank. It didn't work unfortunately. Maybe the program is exiting before it gets a chance to reload all the images but I don't know.

Bar actually re-writing Amos itself to include a image bank refresh on exit from the actual saved bank file, I'm unsure as to how I'd get a tidy solution to this issue.

I'm open to suggestions and or solutions if there are any. Even if there aren't then I hope this information will be useful to someone who may be experiencing the same problem and at the very least can just do the manual bank reload in the object editor.

Thanks.
Store the HRev image to a separate Bob in the bank. HRev is a processor intensive operation and is global to every use of the Bob.

Sent from my Prism II using Tapatalk
Samurai_Crow is offline  
 
Page generated in 0.05424 seconds with 11 queries