Game Maker Suggestions
#1161
Posted 29 April 2012 - 09:55 PM
http://www.codinghor...ail-faster.html
#1162
Posted 30 April 2012 - 04:20 PM
Thanks. Now I spent the whole afternoon reading through that websiteI was reading Coding Horror the other day, and this seemed like something fit for GM to me:
http://www.codinghor...ail-faster.html
#1163
Posted 30 April 2012 - 05:18 PM
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.
#1164
Posted 01 May 2012 - 12:46 AM
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: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.
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?
You can do that in GM already: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.
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.
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: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.
if (scriptname()) {
variable=1;
}Again, what are you trying to accomplish?
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.6 Possibility to combine numbers into text.
sprite_index = "sprite"+string(variable)
Something like *_get_index("string_name") has been requested many times before, but until it's added, there are always these workarounds: map_* scripts.
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:7 Possibility to create variables like this.
"variable"+string(variable) = something
execute_string("variable" + string(variable) + " = something");What? What are x1, y1, and z1? I understand a z constant for D3D, but what the heck are the other 3?8. Add x1,y1,z,z1 constants. It would be easier to seperate them from other code.
Check the help file--these already exist. There are two main functions for that: event_perform() and event_perform_object(). Look them up.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.
There are events for this. If you really need to code it, it's simple to do yourself:10. Add mouse_collision_check_button(). This also checks if the mouse collides with an object.
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
#1165
Posted 01 May 2012 - 01:13 AM
Did you mean:Some of the things i've found missing from Game Maker for a long time.
1 if variable = 1 else variable = 0
{
variable = 2
}
if (variable == 1)
{
variable = 2;
}
else
{
variable = 0;
}I think this is a silly suggestion.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.
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
}
}Scripts can return values.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.
//Script: scriptname() return choose(true, false); //this is just an example
if (scriptname())
{
//do something
variable = 1;
}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():6 Possibility to combine numbers into text.
sprite_index = "sprite"+string(variable)
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.This is what arrays are for. variable[0], variable[1], variable[2], etc.7 Possibility to create variables like this.
"variable"+string(variable) = something
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.8. Add x1,y1,z,z1 constants. It would be easier to seperate them from other code.
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.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.
This is easy to check yourself:10. Add mouse_collision_check_button(). This also checks if the mouse collides with an object.
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.
Edited by Big J, 01 May 2012 - 01:14 AM.
#1166
Posted 04 May 2012 - 06:37 AM
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?
#1167
Posted 07 May 2012 - 07:24 AM
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 thoughA lot of posts in this topic so I hope I'm not posting aything that has already been talked about.
#1168
Posted 09 May 2012 - 09:03 PM
variable++; variable--;
It's astonishing they've never added this.
#1169
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.
#1170
Posted 22 May 2012 - 01:20 PM
#1171
Posted 22 May 2012 - 05:34 PM
#1172
Posted 22 May 2012 - 09:29 PM
How dare you break the unwritten law that the increment variable in loops must be "i"!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).
#1173
Posted 24 May 2012 - 04:47 AM
#1174
Posted 25 May 2012 - 05:56 AM
#1175
Posted 25 May 2012 - 06:10 PM
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
Posted 27 May 2012 - 07:36 AM
There is. You can change the opacity of your current drawing colour.There should be a transparent color avaivable in the sprite editor.
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.Here's one, for drawing games, make the sprite editor available for the player while playing the game.
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.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.
#1177
Posted 30 May 2012 - 09:39 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users



This topic is locked






