Bennu Game Development

English Forums => Helpdesk => Mensaje iniciado por: Treval en Diciembre 26, 2008, 02:09:40 pm

Título: ConTEXT launches incorrect executable
Publicado por: Treval en Diciembre 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)
Título: Re: ConTEXT launches incorrect executable
Publicado por: SplinterGU en Diciembre 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.
Título: Re: ConTEXT launches incorrect executable
Publicado por: Treval en Diciembre 26, 2008, 06:37:58 pm
Didn't work..
Any other suggestions?
Título: Re: ConTEXT launches incorrect executable
Publicado por: SplinterGU en Diciembre 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...

Título: Re: ConTEXT launches incorrect executable
Publicado por: Treval en Diciembre 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?
Título: Re: ConTEXT launches incorrect executable
Publicado por: Sandman en Diciembre 26, 2008, 07:49:52 pm
Now, 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.

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.
Título: Re: ConTEXT launches incorrect executable
Publicado por: Treval en Diciembre 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..
Título: Re: ConTEXT launches incorrect executable
Publicado por: SplinterGU en Diciembre 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...

Código: [Seleccionar]
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
Título: Re: ConTEXT launches incorrect executable
Publicado por: Treval en Diciembre 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.
Título: Re: ConTEXT launches incorrect executable
Publicado por: SplinterGU en Diciembre 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...
Título: Re: ConTEXT launches incorrect executable
Publicado por: SplinterGU en Diciembre 26, 2008, 10:23:38 pm
Well... this is a bug... mod_timer need initialization of SDL_TIMER...

Thanks.

add an 'import "mod_screen";'
Título: Re: ConTEXT launches incorrect executable
Publicado por: Sandman en Diciembre 27, 2008, 01:08:57 am
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:
Citar
Returns 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.
Título: Re: ConTEXT launches incorrect executable
Publicado por: SplinterGU en Diciembre 27, 2008, 01:33:33 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...
Título: Re: ConTEXT launches incorrect executable
Publicado por: Rovinator en Diciembre 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! :-\