Posted: 29th Aug 2011 9:17
Here's a weird one...

I'm gathering input from the user, with a function that does the "GetTextInput"ing. Then I check to see if it's null. Here's the code...

+ Code Snippet
return$ = get_user_input()
if return$ <> ""
` do some stuff here
endif


I have this same call and test for about a dozen different pieces of data. But now, all of a sudden, halfway through the code, the very last one I put in is causing the program to stop running.

If I change this one particular test to

+ Code Snippet
return$ = get_user_input()
if len(return$) <> 0
` do some stuff here
endif


it works fine. But I can never ever use the string match test again in the program, or it crashes. I tried having the function return "INVALID" if the user enters a null, and testing the return string for that, but it still crashes.

I have to use the zero length test from that point on in the program.

So... is there some kind of limit on checking for string matching?

EDIT: And now, adding a line that creates a text object is crashing the program. It's the dreaded
rocess terminated with status -1073741819 (0 minutes, 6 seconds)

This line

+ Code Snippet
winText27 = CreateText("blah")


crashes the program. I've tried copying all the code to notepad, making a new project, and pasting the code back in, no joy. I am dead in the water if I can't add any more code to my program.
Man, I've got 1500 lines of code in this project, I'd hate to have to start over.

MORE EDIT: The two things seem to be related. I went back and replaced all the if return$ <> "" with if len(return$) <> 0 and now I can add more text entities. I changed 8 of them, so we'll see if that lets me put in 8 more text objects.

EVEN MORE EDIT: There is definitely a problem with CreateText and the number of times you can use it. I'm not sure what the limit is, but I have hit it. I can't add any more text entities without either getting an error, or having previously created text objects display corrupted string data.

I've got half a dozen info windows in a program, each time the user opens one, I've been creating the text objects for the window (title, heading, helpful notes, labels, etc.) and then when the user closes the window, I've been deleting the text objects.

Now, I'm going to try creating them all at the beginning of the program, and re-using them, instead of create/delete.

AGAIN WITH THE EDIT: I think I'm narrowing down the problem. By limiting the program to just a couple dozen text objects, and re-using them instead of delete/re-creating them, I think the crashes are going away. Knock on wood.
Posted: 29th Aug 2011 12:13
I've just purchased AppGameKit - and looks excellent. However, a quick bug report - everything compiles in debug mode (VS2008) but in release mode the paths are incorrectly set in the example projects. (..\..\..\..\IDE\common\Include in debug but ..\..\..\..\common\ in release - so AGK.h not found - linking also fails if this is corrected, so linker paths incorrect too)

Martin

PS - web form clears if captcha entered incorrectly - aaaarrrrggghhh
Posted: 31st Aug 2011 1:10
Undim doesn't work. It doesn't highlight as a command in the IDE, and using it in a program halts the compile with Unknown Instruction 0.

+ Code Snippet
dim myArray [ 10 ]
myArray [ 5 ] = 123
undim myArray [ ]


do
 Print("hello world")
 Sync()
loop
Posted: 31st Aug 2011 13:33
Not sure if this is a bug, or a slow backbuffer.. But whenever I fade out a sprite setting the alpha level to zero, and then try to hide it it re-appears at full opacity for a split second before actually dissapearing.
Posted: 31st Aug 2011 13:48
I ran into this last night, and I think it's to do with the alpha going below 0. If I start alpha at 255 and reduce it by 10 every step, then it will evetually get to -5 and I see the sprite reappear at full brightness.

If I reduce it by 5 every step, it neatly ends on 0 and the sprite fades out properly.
Posted: 31st Aug 2011 13:50
I assumed the same thing, but oddly enough my code decreases it by steps of 1, and caps out if it runs below 5, then exits the loop and hides it altogether. I made this change because I thought that was what caused it, as the documentation does state it doesn't take well to values below zero and above 255.

EDIT: I just tried this on the computer at class(The one I am currently using) and it doesn't appear to do this when I limit it at 5, but it does when I let it run up to "if <0" as a boundary. So this is something that does happen when you input negative values.

Now I'm just puzzled what causes it to keep doing this on my own desktop regardless of what I cap it out on.
Posted: 31st Aug 2011 16:49
Since Alpha is an 8 bit value -5 = 251, so yes it should reappear. Stop at 0.

Martin
Posted: 31st Aug 2011 23:58
Not sure what's going on when building an application, but I have renamed my project, and clicking on Run loads the old exe.

I have to manually delete the exe, click Run, and then have it complain about the project not having been built before. Once a fresh exe is built, it works.

Clicking Compile, Run and Broadcast works as expected, even with the old exe in place.

Also, I'm not sure about the timestamps that are used when the exe is built either. I deleted my exe and built a fresh version. The file properties say:

Created: 31 August 2011, 20:40:49
Modified: 30 August 2011, 22:22:32
Accessed: 31 August 2011, 21:50:45

The Accessed timestamp is the correct one for when the app was built, but by default, Windows Explorer shows me the Modified date, which is the most wrong of the lot.

Is AppGameKit doing something odd with times when building the exe, or is it Windows?
Posted: 1st Sep 2011 1:55
The exe is not modified when building, it is merely copied from IDE/Compiler/interpreters/Windows.exe and used to run your bytecode.
Posted: 1st Sep 2011 4:05
Try this.
+ Code Snippet
loadmusic("1,1.mp3")
loadmusic("2,2.mp3")
loadmusic("3,3.mp3")
playmusic(1,1)
do
sync()
loop


It ends up playing through all of the music files instead of looping the first. Even if I use the play once parameter, it still plays through all the loaded tunes. Most assuredly a bug! It has drove me mad for the last hour thinking it was something to do with my game logic.
Posted: 1st Sep 2011 4:26
There are two more parameters on PlayMusic() that limit how many tracks are played.
Posted: 1st Sep 2011 4:49
Ah.. That would explain a lot. Thank you!
Posted: 1st Sep 2011 10:37
The GetRawMouse commands don't seem to be working as intended.

GetRawMouseLeftPressed and GetRawMouseRightPressed are triggered for as long as the mouse button is held down, and so functions the same as GetRawMouseLeftState and GetRawMouseRightState. I was under the impression it should just trigger once, much like GetPointerPressed.

GetRawMouseLeftReleased and GetRawMouseRightReleased has the same problem, but in reverse. Without pressing a mouse button, nothing happens - as expected. When pressing a mouse button - nothing happens. Also good. When releasing the mouse button, the event is constantly triggered until you press the mouse button again to stop it. And then it again fires constantly once you release the button. I thought it should just fire once, similar to GetPointerReleased.
Posted: 1st Sep 2011 12:45
Is it possible we can have the following commands:

GetMusicFileVolume
GetMusicSystemVolume
GetSoundSystemVolume

Pleaseeeeeeee!
Posted: 1st Sep 2011 15:55
The GetRawMouse commands don't seem to be working as intended.


Thanks, they are fixed for a future update.

"


Those don't look too difficult, although at the moment we are focussing on fixing things rather than adding stuff, so not yet
Posted: 1st Sep 2011 16:29
When typing in a text input, if the user hits the ESC key, the text input is cancelled. But, that ESC keypress is also caught in the same cycle, by GetRawKeyReleased(27).

So, if your program is trapping the ESC key (assuming you are coding for folks with an actual keyboard), the cancelling of the text input also triggers whatever code you have for catching the ESC key.

This also happens if your code traps the ENTER key, so a completed text input also throws a hit to GetRawKeyReleased(13).

Not exactly a bug, and a work-around is easy, but I think the desired behavior should be that the last keypress of a text input should NOT be picked up in the current cycle.
Posted: 1st Sep 2011 17:53
not sure what the changes to the media folder are but I think it may have caused issues.
I'm using the following:
+ Code Snippet
bgsound as integer
bgsound = loadsound("sound.wav")
playsound(bgsound, 100, 1)
have tried having sound.wav in both a virtual folder and a real folder, but although it seems to not give an error with the loadsound commmand, it doesn't like the playsound command and give the error:Failed to create sound instance at line xx.
the sound file plays fine in media player - any ideas?
btw,I noticed that mp3 sound file format has been dropped.

other "bugs" I've noticed so far are:
"exitfunction" does not syntax highlight properly
"global" keyword is missing from language and/or command reference
"OpenToRead" command maybe should be in the "Read" section more than the "Access" section (to match the related "Write" section command).
Posted: 1st Sep 2011 18:00
I have a major problem!

My game has reached 1624 lines, and every time I try and add any more lines of code, (For example, If I add: Function Test() .. EndFunction)
The program crashes with an "XXX.exe has stopped working and must be closed" error.

Adding comments work, but executable code doesn't!

I'd add my code, but 1) it's 1624 lines long and 2) I don't want to make it public.

I've tried in the original version and in the new version, neither work.

HELP!!! HELP!!! HELP!!!
Posted: 1st Sep 2011 18:05
Mobiius - my current project is over 2000 lines long. I started getting that same type of error when I included too many "create text", and "delete text" commands. I'm finding that if I reuse text objects, the crashes go away.

Now, I also get those kinds of crashes when I've mis-typed something, and the compiler doesn't pick up the bad code. For example, when I try to delete an object that hasn't been created. So, who knows?
Posted: 1st Sep 2011 19:32
Mobiius, my project is just over that size at the moment with no problems (as yet). I haven't updated my version of AppGameKit yet though and from the sounds am a little wary.
Has mp3 been dropped? If so do we have to use huge wave files now instead or is there ogg support? My game has a few mp3's in and more lined up to be used... I wouldn't mind the update for the ide F1 bug, but don't want to update it if it kills my project at this stage.