123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|546|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> ImagesCollide gives a MAV!!?

Mon, 21 Jul 2008, 13:49
Forklift_Fred
This feels like a very newbie question but I can't fathom it at all. Read this as one of those quirky "I'm having a bad day" problems because I can work around it but it's bugged the hell out of me for long enough

I've used ImagesCollide a multitude of times before and never had any problems (other than the usual silly errors)

Now, with very minimal code in place I'm getting Memory Access Violations whenever a collision is detected between the player and the level!?

Silly thing is, if I load an image in everything works perfectly but if I make it within the game it fails!

Any suggestions?

It's only one of the images that is affected (the player)and at the moment it's just a white circle on a black background so what on earth is going on?

-=-=-
Come rain or shine...
Mon, 21 Jul 2008, 13:56
shroom_monk
Without the code, it's hard to say, but have you spelt all the image handles correctly?

-=-=-
A mushroom a day keeps the doctor away...

Keep It Simple, Shroom!
Mon, 21 Jul 2008, 14:26
mike_g
Another random guess is that you could have a problem with the variables scope. In other words: creating a new object within a function using a local variable as its handle. Then outside of the function the handle will be null.
Mon, 21 Jul 2008, 14:27
Forklift_Fred
Yeah the handles are global and identical when I change it to LoadImage()

I've stripped out a couple of functions but you can see how very basic this is... and that's what's so frustrating.

Sorry, I should have have posted this before




-=-=-
Come rain or shine...
Mon, 21 Jul 2008, 14:37
Scherererer
the code you posted works perfectly for me. are you sure that you didn't try using "player" or "lvl" in those other functions? if neither of those images are being used in other functions I'd recommend changing them to a local scope, because as of now they're not being used by anything outside of that scope.

if its a handle error, you can move the draw statement to before the imagescollide and see if it throws an error.

-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Mon, 21 Jul 2008, 14:44
Forklift_Fred
Interesting. Starting fresh, I pasted the code (copied from my post here) and ran it. You say it's working, I get a MAV

Point proven, it's an unfathomable glitch!

Other ImagesCollide code is still working perfectly... baffling.

-=-=-
Come rain or shine...
Mon, 21 Jul 2008, 14:53
Jayenkai
Well, guess it was an inevitability.. There's a "MEGABUG!" in Blitz.
Yup, a quick search picks up plenty of Imagescollide issues, even over at RetroRemakes and BB.com.

I'd not noticed myself, since I pretty much gave up with true-collision and started doing mostly-box stuff instead, but. Dang..

This could also be the reason Phoenix's game's MAVing on certain setups.

Nooooooo!!

-=-=-
''Load, Next List!''
Mon, 21 Jul 2008, 14:57
Scherererer
that's really quite odd... is it possible that your compiler is somehow corrupted maybe? Try re downloading and installing again? It just seems like a really odd issue to have occurred.

-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Mon, 21 Jul 2008, 15:13
Forklift_Fred
Thanks Jay, I feel better now. Well, knowing I'm not alone anyway. It still doesn't make sense.

Funnily enough, I'm trying to move away from box-like checks, trying to be more sophisticated

Firstly, keeping the images fairly small (breaking an image into two associated images for example), and secondly, sticking to images with multiples of 2, eg, 2x2, 4x4, 8x8, 16x16, 32x32, etc.


Sounds like plausible solutions... I just realised that when I've used 36 I was actually thinking of 32. For some reason I always get that wrong

Changing the scale to 32 has resolved the issue!!!

Jay, you're a genius. Or a god. You choose

-=-=-
Come rain or shine...
Mon, 21 Jul 2008, 15:18
Jayenkai
I'm a person who types "MAV Blitz Imagescollide" into google..

Nothing special!

-=-=-
''Load, Next List!''
Mon, 21 Jul 2008, 15:22
Forklift_Fred
Damn. That really makes me look even more stupid

I normally do that when other people have questions... I just though there were so many collision questions out there and maybe this was a very specific issue that the more experienced here would know. Which it was. In the end.

Thanks for Googling then!

-=-=-
Come rain or shine...
Mon, 21 Jul 2008, 15:23
Scherererer
lol, do we need to have a binary lesson?
1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384...

-=-=-
YouTube Twitter
Computer Science Series: Logic (pt1) (part 2) (part 3) 2's Complement Mathematics: Basic Differential Calculus
Mon, 21 Jul 2008, 15:32
Jayenkai
.. I can never remember the 8192 one...
Mon, 21 Jul 2008, 15:43
Forklift_Fred
I used to be good with those numbers from my early days with Spectrum... mostly working with graphics converting 8 x 8 character blocks into decimal values. It threw me for a while later though because the top value was always 255 rather than 256 (because 256 would be one more than all 8 pixels)...

I don't use them anywhere near as much now but for some reason, unless I think about it, I always go for 36. Everything else up to 1024 is instinctive and 2048 would be just a second of thought.

-=-=-
Come rain or shine...
Mon, 21 Jul 2008, 19:46
steve_ancell
That code seems to be working fine at my end.
Mon, 21 Jul 2008, 23:29
JL235
I've had some Blitz programs MAV on Vista. Also on XP you can access and change values outside of an array which again isn't allowed and crashes on Vista. Bear in mind that it's bad that it doesn't crash on XP, not good that it does crash on Vista (and reportedly XP SP2). Memory access violations need to be caught!