Jump to content


Photo

Game Maker Suggestions


  • This topic is locked This topic is locked
1176 replies to this topic

#1161 GStick

GStick

    All Secrets Exposed

  • GMC Member
  • 1633 posts
  • Version:GM:Studio

Posted 29 April 2012 - 09:55 PM

I was reading Coding Horror the other day, and this seemed like something fit for GM to me:
http://www.codinghor...ail-faster.html
  • 2

#1162 Erik Leppen

Erik Leppen

    GMC Member

  • GMC Member
  • 2063 posts
  • Version:GM:Studio

Posted 30 April 2012 - 04:20 PM

I was reading Coding Horror the other day, and this seemed like something fit for GM to me:
http://www.codinghor...ail-faster.html

Thanks. Now I spent the whole afternoon reading through that website :lol:
  • 1

#1163 Tsn

Tsn

    GMC Member

  • GMC Member
  • 280 posts
  • Version:Unknown

Posted 30 April 2012 - 05:18 PM

Some of the things i've found missing from Game Maker for a long time.
1 if variable = 1 else variable = 0
{
variable = 2
}
This allows avoiding typing extra lines and what happens after else would be more easily seeable. Sometimes i type lots of code and then add a one line code after else.
2 instance_has_variable(variable,instance,set)
Checks if any of the instances has a variable set to something and returns how many of those instances there are.
This would allow me to see how many enemies there are with health set to higher then 10 for example.
3 Possibility to hide code.
4 Automatic execute code instead of select drag and drop icon menu.
5 Possibility to put an if statement inside a script, so i can do.
scriptname()
{
variable = 1
}
I use similar if statements in many places.
6 Possibility to combine numbers into text.
sprite_index = "sprite"+string(variable)
7 Possibility to create variables like this.
"variable"+string(variable) = something
8. Add x1,y1,z,z1 constants. It would be easier to seperate them from other code.
9. Add event functions. So i can do create event in step event or outside room event in step event for example. This can save time moving between events.
10. Add mouse_collision_check_button(). This also checks if the mouse collides with an object.

Edited by Tsn, 30 April 2012 - 11:53 PM.

  • 0

#1164 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • Retired Staff
  • 9314 posts
  • Version:Unknown

Posted 01 May 2012 - 12:46 AM

Some of the things i've found missing from Game Maker for a long time.
1 if variable = 1 else variable = 0
{
variable = 2
}
This allows avoiding typing extra lines and what happens after else would be more easily seeable. Sometimes i type lots of code and then add a one line code after else.

I don't understand this. What does that mean? If the variable equals 1, then set it to 2, otherwise set it to 0? What's the benefit of that over:

if (variable==1) { variable=2; }
else { variable=0; }

? Or is it supposed to mean "if the variable is 1 or 0, then set it to 2"? In that case:

if (variable==1 || variable==0) { variable=2; }

What are you trying to accomplish with that strange syntax?

2 instance_has_variable(variable,instance,set)
Checks if any of the instances has a variable set to something and returns how many of those instances there are.
This would allow me to see how many enemies there are with health set to higher then 10 for example.

You can do that in GM already:

with (instances) {
  if (variable==set) {
    //whatever code here
  }
}

It's kind of a fringe case to replace a 4-line syntax with a 1-line syntax which would require the extra parsing for it.

5 Possibility to put an if statement inside a script, so i can do.
scriptname()
{
variable = 1
}
I use similar if statements in many places.

I don't think you understand what scripts actually do. The normal way to do something like that is simply to have the script return true or false, then do this:

if (scriptname()) {
  variable=1;
}

Again, what are you trying to accomplish?

6 Possibility to combine numbers into text.
sprite_index = "sprite"+string(variable)

You can already. "sprite"+string(variable) does, in fact, combine the number into the string. In that case, though, you're trying to reference a sprite_index, which is actually a number to begin with. It's not text, it's not a string--it's a number.

Something like *_get_index("string_name") has been requested many times before, but until it's added, there are always these workarounds: map_* scripts.

7 Possibility to create variables like this.
"variable"+string(variable) = something

That makes no sense, since variable names are not strings...but if you need to do that, you can already use execute_string() for it:

execute_string("variable" + string(variable) + " = something");

8. Add x1,y1,z,z1 constants. It would be easier to seperate them from other code.

What? What are x1, y1, and z1? I understand a z constant for D3D, but what the heck are the other 3?

9. Add event functions. So i can do create event in step event or outside room event in step event for example. This can save time moving between events.

Check the help file--these already exist. There are two main functions for that: event_perform() and event_perform_object(). Look them up.

10. Add mouse_collision_check_button(). This also checks if the mouse collides with an object.

There are events for this. If you really need to code it, it's simple to do yourself:

if (collision_point(X, Y, obj, prec, notme) != noone && mouse_check_button(mb_left|mb_right)) {
  /* Here */
}

Considering the events for this already exist, what's the point?

-IMP
  • 0

#1165 Big J

Big J

    GMC Member

  • GMC Member
  • 2825 posts
  • Version:GM8.1

Posted 01 May 2012 - 01:13 AM

Some of the things i've found missing from Game Maker for a long time.
1 if variable = 1 else variable = 0
{
variable = 2
}

Did you mean:
if (variable == 1)
{
    variable = 2;
}
else
{
    variable = 0;
}

2 instance_has_variable(variable,instance,set)
Checks if any of the instances has a variable set to something and returns how many of those instances there are.
This would allow me to see how many enemies there are with health set to higher then 10 for example.

I think this is a silly suggestion.

It is already possible to count how many enemies satisfy a certain condition:
/*
    This code will count how many enemies have hp > 10
    and store them in an array.
*/
var count, array;
count = 0;
with (objEnemy)
{
    if (hp > 10)
    {
        array[count] = id; //store the ID
        count += 1; //increase count
    }
}

5 Possibility to put an if statement inside a script, so i can do.
scriptname()
{
variable = 1
}
I use similar if statements in many places.

Scripts can return values.

//Script: scriptname()
return choose(true, false); //this is just an example
if (scriptname())
{
    //do something
    variable = 1;
}

6 Possibility to combine numbers into text.
sprite_index = "sprite"+string(variable)

This is already possible with variable_*_get/set() or even the dreaded execute_string(), but if you find yourself needing to do this, you're probably designing your game incorrectly. Regardless, the best solution would be to use an array, or make scripts to retrieve the ID of the resources, such as sprite_get_index():
var i, name;
name = argument0;
for (i = 0; i < 1000; i += 1)
{
    if (sprite_get_name(i) == name)
    {
        return i;
    }
}
return -1;
Or perhaps take it a step further and map all the resources at the beginning of the game for faster retrieval.

7 Possibility to create variables like this.
"variable"+string(variable) = something

This is what arrays are for. variable[0], variable[1], variable[2], etc.

8. Add x1,y1,z,z1 constants. It would be easier to seperate them from other code.

These would be completely useless as constants. I think a built-in instance "z" variable would be nice, but how hard is that to create yourself? In a way, "depth" is similar to z, but it determines drawing order. x1, y1, and z1 would be variables I create myself if I need them, and sometimes they are script-local with "var" declaration, so they should NOT be built-in.

9. Add event functions. So i can do create event in step event or outside room event in step event for example. This can save time moving between events.

I'm not sure what you mean. If you mean to perform other events from the current event, this is already possible with event_perform() and event_perform_object(). If you want to merge all the code from all events into the Step Event, that implementation might be slower than using separate events.

10. Add mouse_collision_check_button(). This also checks if the mouse collides with an object.

This is easy to check yourself:
return (instance_position(mouse_x, mouse_y, all)) != noone);

The built-in events for the mouse buttons that are not global mouse already have a similar check.

EDIT: I never got an email notification of IMP's reply. :P

Edited by Big J, 01 May 2012 - 01:14 AM.

  • 0

#1166 TeamSteeve

TeamSteeve

    GMC Member

  • GMC Member
  • 922 posts
  • Version:GM:Studio

Posted 04 May 2012 - 06:37 AM

A lot of posts in this topic so I hope I'm not posting aything that has already been talked about.

I would really like it if you could put names for the arguments in the name of the script.
So say I had a script named "scr_change_position" and it had two arguments which I used to determine the x and y coordinates of whatever instance was calling the script, I want to actually name the script "scr_change_position(x,y)".

Also, when the auto-complete box pops up when typing in code it could show "scr_change_position(x,y)" instead of just "scr_change_position(...)".
I'm very forgetful and have to keep re-opening my scripts to make sure I'm using them right and haven't put the arguments around the wrong way.
This would be very helpful to me.

Thoughts?
  • 3

#1167 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 07 May 2012 - 07:24 AM

A lot of posts in this topic so I hope I'm not posting aything that has already been talked about.

Unfortunately, as you say, so many topics have been covered it's nearly impossible to come up with something useful and yet unmentioned. This has already been discussed. It's a good idea though :P
  • 0

#1168 Jobo

Jobo

    No neurons left today

  • GMC Member
  • 2418 posts
  • Version:GM:Studio

Posted 09 May 2012 - 09:03 PM

I'm still waiting for them to add the simple approach of variable increase/decrease, as such;
variable++;
variable--;

It's astonishing they've never added this.
  • 1

#1169 Desert Dog

Desert Dog

    GMC Member

  • Global Moderators
  • 6409 posts
  • Version:Unknown

Posted 09 May 2012 - 09:27 PM

I'm still waiting for them to add the simple approach of variable increase/decrease, as such;

variable++;
variable--;

It's astonishing they've never added this.


It isn't the simple approach at all, it's the complex way of adding 1 to a variable.
  • 1

#1170 Yal

Yal

    Gun Princess

  • Global Moderators
  • 5865 posts
  • Version:GM8.1

Posted 22 May 2012 - 01:20 PM

The only place where I ever used them was in for loops, because I thought it was hilarious to write "c++" for the counter variable. The habit still lingers, I always use "c" as the counter index in my for loops (except when nested).
  • 0

#1171 Big J

Big J

    GMC Member

  • GMC Member
  • 2825 posts
  • Version:GM8.1

Posted 22 May 2012 - 05:34 PM

I too find it amusing to use a variable named "c" or even "C" in a for loop. :D
  • 0

#1172 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 22 May 2012 - 09:29 PM

The only place where I ever used them was in for loops, because I thought it was hilarious to write "c++" for the counter variable. The habit still lingers, I always use "c" as the counter index in my for loops (except when nested).

How dare you break the unwritten law that the increment variable in loops must be "i"!
  • 0

#1173 Tsn

Tsn

    GMC Member

  • GMC Member
  • 280 posts
  • Version:Unknown

Posted 24 May 2012 - 04:47 AM

There should be a transparent color avaivable in the sprite editor.
  • 0

#1174 Zoltan Kriven

Zoltan Kriven

    GMC Member

  • GMC Member
  • 342 posts
  • Version:GM8.1

Posted 25 May 2012 - 05:56 AM

Here's one, for drawing games, make the sprite editor available for the player while playing the game.
  • 2

#1175 time-killer-games

time-killer-games

    GMC Member

  • Banned Users
  • 539 posts
  • Version:GM:Studio

Posted 25 May 2012 - 06:10 PM

^ +1 that's a good idea, that way we wouldn't need dlls for that.

An undo function for the resource tree couldn't hurt.
This is good for when you accidentally delete the wrong object or something else important.

Edited by time-killer-games, 25 May 2012 - 06:13 PM.


#1176 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 27 May 2012 - 07:36 AM

There should be a transparent color avaivable in the sprite editor.

There is. You can change the opacity of your current drawing colour.

Here's one, for drawing games, make the sprite editor available for the player while playing the game.

This would be a bad idea. It's a niche thing, and it's far better to make your own, more customisable editor for your game.

An undo function for the resource tree couldn't hurt.
This is good for when you accidentally delete the wrong object or something else important.

Yeah, the undo features in GM are very lacking. You can delete a lot of things accidentally and have no way of retrieving them afterwards, which can be very, very frustrating.
  • 1

#1177 paul23

paul23

    GMC Member

  • Global Moderators
  • 3388 posts
  • Version:GM8

Posted 30 May 2012 - 09:39 PM

Closed this awaiting some moderation discussion.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users