Jump to content


DoubleD33D

Member Since 05 Aug 2011
Offline Last Active May 10 2013 04:53 AM

Topics I've Started

Open URL in default browser

24 January 2013 - 05:19 AM

Title: Open in default web browser
Description: Open a URL or file in the default web browser of currently logged in user
GM Version: GM5+
Registered: No
Required Extension: No
Required DLL: No
Tags: web, browser, default, open, page, url, file
Note: Only works on windows, not sure about GM5 but should work on all others newer than 5

This is a script I wrote, it will open a given URL/file in the default web browser of the user on the computer, even if the default web browser changes while the game/program is running.

Script is
if (string(argument0) != "") { //Check for a string input
    var browserDir, browser;

    registry_set_root(0); //Set the registry root to that of LOCAL USER
    browser = registry_read_string_ext("\Software\Clients\StartMenuInternet", ""); //Read the name of the default browser

    registry_set_root(1); //Set the registry root to that of the system, which will have the file location of the default browsers executable
    browserDir = registry_read_string_ext("\Software\Clients\StartMenuInternet\" + browser + "\shell\open\command", ""); //Read the directory of the default browser
    browserDir = string_copy(browserDir, 2, string_length(browserDir) - 2); //Remove the quotes that will be in the string, from the registry
    execute_program(browserDir, argument0, 0); //Execute the browser with the URL/file given
}

If you pass a real value or an empty string, or just simply nothing, this script will do nothing. For those who may ask, this will open a new tab if the browser is already open.

This could be really useful if you have a system to check your game for updates and want to direct your players to a download page, or if you simply want a button to send players to your website. This script will make no changes to the registry, only read it.

file_exist game maker bug?

24 January 2013 - 03:37 AM

I trying to check for the existence of a simple ini file using file_exist(fname); and create my default settings file if it does not. My value for fname is absolute. "C:\Users\Devin\Desktop\settings.ini" which is what I'm using to test.

I've been having such problems that I decided to check the values of everything to show them in a show_message(msg);. So I did
show_message(string(file_exist("C:\Users\Devin\Desktop\settings.ini")));

show_message says "4". FOUR!?

The Game Maker help file clearly says "file_exists(fname) Returns whether the file with the given name exists (true) or not (false).". nope, no 4.

Note: The file doesn't actually exist, so shouldn't it return 0? or false.

Edit: Game Maker 8.0

Banned

15 September 2012 - 09:03 AM

You must post why you would ban the last poster to this topic. You have to ban them for something. >:)

Room editor

15 September 2012 - 08:59 AM

How many agree. Game Maker should have the option in the preferences to use the classic room editor as it is that one I'm still used to.

Tower Defense Ideas

22 August 2012 - 06:20 PM

I plan to start working on a tower defense game in Game Maker :GM8: . However I find all tower defense games are all a like. So I'm looking for suggestions on

GUI(Graphical User Interface) - How can players play the game?
Theme
Story line - Which would be cool for a tower defense
If a story line? What kind, any long term upgrades?
Different enemies - With different features
Maybe boss ideas?
Maybe a way to make it where something getting past you without even attacking you hurts you a logical thing
Different game mods? - A challenge mode for sure.


Just give me ideas to make my new TD not like all the others. I have enough Game Maker skill to stick about anything into a TD so have at 'er. Also if you have an idea that I like and might use, I'll ask if you want credit or not if you haven't already said.

Once I get a work in progress, I'll post a link to it.