I would expect that "something" would print, then the script would wait for 2 seconds, then "something else" would print, and this would repeat indefinitely. I'm not seeing this. Am I mistaken that this is what should happen based on this code above?

Welcome to the forum dood The behavior you expect is pretty much what I expect also. After the first line of text, you will see two new lines of text appearing every 2 seconds. Please try running this program with GME. What is the result that you do see? If you are running from GM compiled within your own program, are you calling gmMachine::Execute() regularly with delta time, to pump the script threads?

It works as expected when running through gme. I should mention that I'm running this on the xbox, and I have my own logging mechanism, so the only difference in script code is that the print statements are replaced with my own. I see that what is happening is that it is stalling on sleep.

I am calling gmMachine::Execute() every frame with the delta time. I will investigate more...

The error was mine. GM wanted an unsigned int for gmMachine->Execute(dt), and I was doing a static_cast from double, which was resulting in dt = 0 for very small values of dt, and since sleep(2.0) resulted in a value of 2000 in the debugger, it looked like it was expecting the number of ms or maybe the ticks that had passed.

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum