Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Is there a fatal bug in the select command?

Author
Message
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 26th Feb 2013 22:43 Edited at: 26th Feb 2013 22:44
I got some very weird crashes in my app after i added a few things where i used
select
case
endcase
endselect

I used it to switch mode betwen editor and game mode and to change sprite frames.

When i changed the one where i switched betwen editor and game so did this happen more rarely.

But i still got it when sprites where on screen?
So i removed the select commands for my sprites and this dosent happen anymore?

This app crash is in windows when you close the app with the windows x icon at he top corner.
I got the windows message that windows tryes to find a solution to the error?

Works if i use end?

Anyone else experienced this or iam just having a fluke?

I replaced this.


with this..


Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Feb 2013 22:53
I don't have any problems with select. I use tons of them. However, I had the problems you describe when clicking the x to end the program. This stopped completely once I made one main do-loop with a single sync() in main.agc. So maybe the two are linked?


Demo 3 is out now!
TrezSoft
AGK Tool Maker
11
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 26th Feb 2013 22:53
I had a similar issue in an earlier version of AppGameKit T1 but I have not had the issue in 1088. Sorry I can not remember which version I had the problem with.
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Feb 2013 22:54
I use 1076 if that's any help. I haven't had the problem for ages so I don't know if it has been fixed or not.


Demo 3 is out now!
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 26th Feb 2013 23:14
I actually found the the bug i belive

In the tiled based line of sight function so did i exit a function with an value grabbed from another function?
exitfunction grabbthisval()
It whas purely some bad coding by me

But i went thru hell to find it

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 27th Feb 2013 00:16
This is weird as now when i reinserted the select commands so does it crash again ?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
mr_d
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Somewhere In Australia
Posted: 27th Feb 2013 06:40
this is OT, but looking at your original code and what you are trying to achieve, couldn't you do something like this instead:


Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 27th Feb 2013 16:19
This 'imagefilename = GetThis + ".png"' would not quite work.
But this 'imagefilename = str(GetThis) + ".png"' would.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 27th Feb 2013 18:15
Clever by you both
I didt think of that
But still a weird app crash?
But i belive that i found a section that creates sprites at runtime if neaded ,could be the cause as if agk tryes to shutdown and this function creates new sprites as agk deletes them?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 27th Feb 2013 21:47 Edited at: 27th Feb 2013 21:48
Quote: "with a single sync() in main.agc."

This is wath i found to be the error ?

App shutsdown faster and no errors so far when exiting with the window x?

Only spent 3 days to find it

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 27th Feb 2013 22:39
See, it's a pretty good idea after all

It's also good coding practice!


Demo 3 is out now!
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 28th Feb 2013 00:04
But after a while so do i get the error again ?
Iam about to rewritte the entire section from scratch soon as i cant seam to find the error more then that it seams to be in the enemy code ?

But dont seam to be at the same place?

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 28th Feb 2013 08:04
Ok!
I will update here as i clean up the enemy part that causes this bugg.

I found the loadsubimage command to crash a agk app if its done during runtime and the image might be deleted by agk for exiting.

This is something similar to the create sprite command that whas fixed by tgc.

This is fixed so far by this.


I know by 100% that its stuff added in the enemy file that causes this now.

As i remed out all functions and added them one by one until the bug appeared again.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
mr_d
DBPro Tool Maker
17
Years of Service
User Offline
Joined: 26th Mar 2007
Location: Somewhere In Australia
Posted: 28th Feb 2013 10:01 Edited at: 28th Feb 2013 10:02
Quote: "This 'imagefilename = GetThis + ".png"' would not quite work.
But this 'imagefilename = str(GetThis) + ".png"' would."

Thanks AL - I was a bit lazy with my code (or pseudo-code ) always mix syntax and such up when not concentrating on 1 language for an extended period...

@Cliff, that last bit of code doesn't look right to me; as I believe the check for "BatImage" should be a "not" in front of it as you are assigning this with the "loadsubimage" command and you wouldn't so that if it already exists would you?

note: I haven't looked at the docs for the functions and as I mentioned above, I'm a bit rusty with AppGameKit BASIC, so I could be way off on the above comment.

TrezSoft
AGK Tool Maker
11
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 28th Feb 2013 10:09
NOT is not working in 1088 (I think it works ok in 1076) but you could just test as

If GetImageExists(batimage) = 0

Login to post a reply

Server time is: 2024-05-02 00:55:50
Your offset time is: 2024-05-02 00:55:50