Bennu Game Development

English Forums => Helpdesk => Topic started by: Treval on December 26, 2008, 02:09:40 PM

Title: ConTEXT launches incorrect executable
Post by: Treval on December 26, 2008, 02:09:40 PM
Hello.

I have followed and applied the instructions as described in here (http://wiki.bennugd.org/index.php?title=Tutorial:Setting_up_Bennu_with_ConTEXT).
In ConTEXT, I have done the following steps:
1. File > Save As > Fenix (.prg)
2. F10 (bgdc)
3. F11 (bgdi)

Now, it launches the context executable instead of bgdi, like I configured. Why is this?
Screenshot (http://i40.tinypic.com/29tuo6.gif)
Title: Re: ConTEXT launches incorrect executable
Post by: SplinterGU on December 26, 2008, 02:29:19 PM
look this http://forum.bennugd.org/index.php?topic=173.0 and this http://forum.bennugd.org/index.php?topic=165.msg2050#msg2050

It's said that you must go to "options/enviroment key options/run keys/add" (maybe can be others label options, I don't have ConTEXT now) and you must type "prg". Then you must close "ConTEXT" and run "fixbennu.reg"... and then you can use ConTEXT.
Title: Re: ConTEXT launches incorrect executable
Post by: Treval on December 26, 2008, 06:37:58 PM
Didn't work..
Any other suggestions?
Title: Re: ConTEXT launches incorrect executable
Post by: SplinterGU on December 26, 2008, 06:41:03 PM
You already try uninstall previous ConTEXT version and delete registry entries?

other suggestions: yes, don't use ConTEXT... you have others options...

Title: Re: ConTEXT launches incorrect executable
Post by: Treval on December 26, 2008, 06:59:21 PM
I have uninstalled ConTEXT, reinstalled it, ran the fixbennu.reg.
Now it compiled, but nothing happens when I run the interpreter:
As you can see here (http://i41.tinypic.com/fdcyvs.gif).

I want to be able to use ConTEXT.

[edit]
Now it works. (http://i43.tinypic.com/nf1hfc.gif)
But why doesn't it launch my Bennu program in a new Fenix window?
Why does it launch it in the output window of ConTEXT?
Title: Re: ConTEXT launches incorrect executable
Post by: Sandman on December 26, 2008, 07:49:52 PM
Quote from: Treval on December 26, 2008, 02:09:40 PMNow, it launches the context executable instead of bgdi, like I configured. Why is this?
Screenshot (http://i40.tinypic.com/29tuo6.gif)
This was probably because the execute field in the execute button config was not setup properly. Context uses ConExec.exe to start other programs.

Quote from: Treval on December 26, 2008, 06:59:21 PM
But why doesn't it launch my Bennu program in a new Fenix window?
Why does it launch it in the output window of ConTEXT?
Because the option Capture console output is enabled for that specific key. This is a choice.
Title: Re: ConTEXT launches incorrect executable
Post by: Treval on December 26, 2008, 08:02:18 PM
Many thanks for your input on that, Sandman.

Why does example a (http://i43.tinypic.com/nf1hfc.gif) run and example b (http://i41.tinypic.com/fdcyvs.gif) not?
I don't know why but it only seems to work when I exclude the timer..
Title: Re: ConTEXT launches incorrect executable
Post by: SplinterGU on December 26, 2008, 09:15:09 PM
not, don't show output because code in while never is executed...
you never think in put a "say (get_timer());" before while?

Try this...


import "mod_time";
import "mod_say";

process Main();
private
    start;
begin
    start = get_timer();
    while(start + 1000 > get_timer());
        say ("Hello World! @"+ get_timer());
        frame;
    end
end
Title: Re: ConTEXT launches incorrect executable
Post by: Treval on December 26, 2008, 09:28:22 PM
I don't understand why that code was put online if it does not execute.
Here (http://wiki.bennugd.org/index.php?title=Beginner%27s_tutorial)

[edit]
Also, it appears get_timer() gets the amount of milliseconds since 0:00:00 (since the day began),
not time the program has been running in milliseconds. , as stated here (http://wiki.bennugd.org/index.php?title=Get_timer) (this is directed to Sandman).

(get_timer()/1000)/3600 = hours passed in current day.
Title: Re: ConTEXT launches incorrect executable
Post by: SplinterGU on December 26, 2008, 09:36:58 PM
I don't know... I never wrote in wiki... maybe you must ask to Sandman where he get this sample...
Title: Re: ConTEXT launches incorrect executable
Post by: SplinterGU on December 26, 2008, 10:23:38 PM
Well... this is a bug... mod_timer need initialization of SDL_TIMER...

Thanks.

add an 'import "mod_screen";'
Title: Re: ConTEXT launches incorrect executable
Post by: Sandman on December 27, 2008, 01:08:57 AM
Quote from: Treval on December 26, 2008, 09:28:22 PM
I don't understand why that code was put online if it does not execute.
Here (http://wiki.bennugd.org/index.php?title=Beginner%27s_tutorial)

[edit]
Also, it appears get_timer() gets the amount of milliseconds since 0:00:00 (since the day began),
not time the program has been running in milliseconds. , as stated here (http://wiki.bennugd.org/index.php?title=Get_timer) (this is directed to Sandman).

(get_timer()/1000)/3600 = hours passed in current day.
I am sorry for that. I write documentation mostly by heart and thought this particular example was so rudimentary it was not worth testing. Silly of me actually for such a small effort. Mostly my documentation is not validated or corrected, so I thank you for that.

However, the documentation is correct. The function get_timer() in mod_time returns SDL_GetTicks() and the documentation of SDL_GetTicks() (http://www.libsdl.org/cgi/docwiki.cgi/SDL_GetTicks) says:
QuoteReturns the number of milliseconds since SDL library initialization. This value wraps around if the program runs for more than 49.7 days.

Thanks for finding this bug, though.

Sidenote to SplinterGU:
SDL_GetTicks() returns an unsigned integer of 32bit. Maybe get_timer() should return this too, instead of a signed integer of 32bit. You can assign it to an unsigned int without problem, but it's more beautiful to return unsigned as well.
Title: Re: ConTEXT launches incorrect executable
Post by: SplinterGU on December 27, 2008, 01:33:33 AM
Quote from: Sandman on December 27, 2008, 01:08:57 AM
Sidenote to SplinterGU:
SDL_GetTicks() returns an unsigned integer of 32bit. Maybe get_timer() should return this too, instead of a signed integer of 32bit. You can assign it to an unsigned int without problem, but it's more beautiful to return unsigned as well.

maybe...
Title: Re: ConTEXT launches incorrect executable
Post by: Rovinator on December 27, 2008, 01:43:26 AM
I think the program stays in the while loop so you get time to look at it, but the program finishes when it reaches it last end, thus closing your window in 1 ms! :-\