Jump to content


EricDB

Member Since 06 Nov 2003
Offline Last Active Nov 09 2011 05:47 PM

Topics I've Started

Tired Of Typing Argument0, Argument1...argumentx?

05 June 2007 - 04:14 AM

My apologies if this doesn't belong here. I'm not sure where else it could go.

I got tired of typing the same thing over and over for every script...a var statement with my variable names, followed by a separate line for every parameter, like "some_var = argument0", etc. So I made a little AutoHotkey script to automate the process:

/*
GMAssist by Eric Burgess (EricDB)
Makes it easier to enter parameter lists into GML scripts.
*/

#SingleInstance force
#IfWinActive Game Maker
; Ctrl-Alt-P to automate script parameter entry:
^!p::
{
	InputBox params, Parameters, Enter parameters (separated by commas)
	send var %params%;{enter}{enter}
	Loop, Parse, params, `,, %A_Space%
	{
  send % A_LoopField . " = argument" . A_Index - 1 . ";{enter}"
	}
	send {enter}
}

All you do is type Ctrl-Alt-P, and a window pops up where you enter your list of parameters. Then the script enters the var and argumentX lines for you. I could make it into an EXE and post that, but I was afraid people would be suspicious of it, so I'm just posting the script. Download AutoHotkey to use it.

This is not a modification to Game Maker! It just intercepts a certain keypress, and sends some more keys to the GM window. It doesn't modify or directly interact with GM in any way.

Gm6 Executables And Windows Vista

07 May 2007 - 04:51 PM

Has there been any official word on whether there's ever going to be a way to run a GM6 EXE under Vista?  Maybe some kind of converter that could change the EXE into a Vista-compatible one?  I've recently upgraded my computer to Vista, and it's awfully disappointing to find that I've lost the ability to play about 95% of the games available on the GMC.

What Do People Use To Make Help Files?

27 April 2007 - 03:39 PM

Title says it all...I'm looking for a good, free .CHM help compiler.  I used to have one, but that was about four years ago and I don't remember what it was called.

Buttonbars 0.11

21 April 2007 - 09:27 PM

<span style='font-size:14pt;line-height:100%'>ButtonBars v0.11</span>

ButtonBars lets you quickly and easily create nice-looking strips of clickable buttons. Normally when you write a game in the Sim City or RTS genre, you give the player lots of little buttons to click to perform various game functions. It can be very tedious defining all these buttons, and even worse if you decide you have to move them around, resize them, or make them look different!

ButtonBars makes it much easier. One line of code to create a button bar. One line of code for each button. That's it. When the user clicks a button, it executes whatever code you have specified. You don't have to mess with screen coordinates, mouse coordinates, drawing, or anything...just get on with the actual game. :blink:

Download ButtonBars.gex

Screenshot: (One bar, three buttons, one disabled)
Posted Image

And here's the code that produced it:
my_bar = bbar_add_bar("My Bar", bbar_skin_yellowmech);
bbar_add_button(my_bar, "Button 1", "One", "show_message('Button 1 clicked')");
bbar_add_button(my_bar, "Button 2", "Two", "show_message('Button 2 clicked')");
bbar_add_button(my_bar, "Button 3", "Three", "show_message('Button 3 clicked')");
bbar_button_enable(my_bar, 3, false);

Current features:
  • Two built-in skins
  • Multiple bars with as many buttons as you like
  • Different button appearence for up, down, hover, and disabled
  • Ability to use a sprite or text label on each button
  • Ability to disable buttons
  • Bars are movable and resizable with a single line of code
  • Ability to use your own skin (with a little bit of graphical knowledge)
Planned features:
  • More and better-looking skins
  • Sound effects and animation
  • Vertical bars
Changes
v0.1
  • Initial version
v0.11
  • Fixed a bug in bbar_add_skin where it crashed if you called it before bbar_add_bar, because ButtonBars was initializing from bbar_add_bar.

Programmatically Adding Objects In A Gm Extension

21 April 2007 - 08:57 PM

I created this very simple extension with only one function, which is also the intialization function:
my_object = object_add();
my_instance = instance_create(0, 0, my_object);

This script runs fine if you put it in a game, but if you build it as an extension, you get the dreaded "Unexpected error occured when running the game."

I've found that if you call your initialization script from within the game, rather than automatically when the extension loads, this problem goes away.

Has anyone else run into this?  Am I doing something wrong?  It would be nice to use the initialization function as it's meant to be used, but at least this way works.