Saludos.

Estoy liado con la demo de mi juego y quiero que al terminar, me de la opcion de visitar una pagina web con el navegador predeterminado por el sistema.

Creo recordar que lo he hecho alguna vez, pero con explorer.

?Podria alguien comentarme como hacerlo?


Si no recuerda mal, para eso habia que usar una libreria.
La vi en la comunidad hace a?os, asi que debe seguir por ahi.
Huir y rendirse nunca son la soluci?n, asi que afronta todo con valor.

Pues el  :GM8: tiene esta accion de D&D
CitarSplash Webpage
With this action you can show a webpage. You provide the url and whether it should be shown in the game window or in the default web browser. The url can be the address of a website, for example http://www.yoyogames.com) or can be the file name for a local html file. Note however that you must provide the full path for this to work (which is not the case for the other splash actions). So you best use as url something like "" + working_directory + "\index.html". (The first two quotes are required to indicate this is an expression rather than a string.) You should either distribute the file with the game or include it in the game through Include Files in the Resources menu. You can e.g. use this to create fancy help pages for your game. This action is only available in the Pro Edition.

o la funcion en GML
Citarsplash_show_web(url,delay) Shows a web page splash screen. url is the url of the webpage (starting with http://) or it is the file name for a local html file. Note however that you must provide the full path for this to work. So you best e.g. use as url something like working_directory + "\index.html". delay is the delay in milli seconds before returning to the game.

Cita de: Fenris78Si un tema os resulta de interes y veis que hay poca información, la mejor solucion no es quejarse o pedir sin pensar, sino sugerir algo bien planteado o aportarlo vosotros mismos.
Cita de: CalioSomos desarrolladores independientes y, por lo tanto, no tenemos por qué guiarnos por las tendencias del mercado.

#3 Octubre 14, 2010, 05:14:35 PM Ultima modificación: Octubre 14, 2010, 07:32:47 PM por Fenris78
Jarl! no tenia ni idea de que habia una funcion para eso en GM8, yo lo hacia antes con "execute Shell" si no recuerdo mal, pero quiero que se utilice el navegador por defecto, no IE.

EDITADO:

Lo he estado probando, pero no funciona como necesito (no reproduce correctamente el DHTML). ?Alguna otra idea?

#4 Octubre 14, 2010, 07:30:53 PM Ultima modificación: Octubre 14, 2010, 07:34:27 PM por Fenris78
Actualizo el tema.

He probado sacando la direccion del navegador por defecto leyendo el registro:

[gml]var browser;
registry_set_root(1);

browser = registry_read_string_ext("\SOFTWARE\Classes\HTTP\shell\open\command","");
execute_shell(browser,"http://www.oniric-factor.com/oniric.html");
game_end();[/gml]

Funciona correctamente en Windows XP, pero cuando lo ejecuto en un Windows 7 me da el siguiente error:

Cannot execute "C:\Program Files\Internet Explorer\iexplore.exe"
-nohome


?A que se creeis que debe y que se os ocurre que se podria hacer?

He estado verificando la ruta real y es C:\Archivos de programa\Internet Explorer\iexplore.exe ?acaso no es fiable esta ruta de registro en Windows 7?

yo para ejecutar una pagina con el navegador predeterminado simplemente lo hago as?
[gml]execute_shell("http://www.oniric-factor.com/oniric.html","");[/gml]
y me funciona a la perfeccion

?Asi, sin especificar la aplicacion ni nada?

No se me habia pasado por la cabeza. ?Voy a probarlo!

Dos palabras: equis-de. XD
       

Oye, pues si que funciona. XD

En mi caso me aparece un error tipo "GM no puede ejecutar la aplicacion" y justo despues me lanza el navegador. Dado que el juego esta terminado, he deshabilitado la opcion de mostrar errores y listo. Lo que me tiene intrigado es porque aparecia el error si despues ejecuta la aplicacion. ?Seria porque la siguiente funcion en ejecutarse es un game_end()? le voy a dar un ultimo repaso para revisarlo, pero lo que es la duda esta mas que resuelta.

Gracias por el cable. ?Nos leemos!

?Cabe la posibilidad de que se trate de un conflcto con el Firewall? Intenta darle permiso total al programa o deshabilita el cortafuegos moment?neamente y vuelve a hacer la prueba.
       

Pues yo uso windows xp y mi firewall no me dice nada aunque le ponga que no permita excepciones, obvio el firewall no es el mismo que el de windows 7.

Que bueno que te sirvi?  :-[
?nos leemos!  :-X!

Hmm...
?Qu? tal esto?
[gml]f=file_text_open_write(temp_directory+"/t.url");
file_text_write_string(f,"[InternetShortcut]");
file_text_writeln(f);
file_text_write_string(f,"URL=http://www.comunidadgm.org/");
file_text_writeln(f);
file_text_close(f);
execute_shell(temp_directory+"/t.url","");
file_delete(temp_directory+"/t.url");[/gml]
Tal vez as? te deshazcas del error... (?deshazcas? ?se escribe as?? XD)
Vim.

Se dice "deshagas", es algo elemental mi querido Wadkson. XD