GameMaker: Studio

GameMaker: Studio

View Stats:
Diveyoc Oct 26, 2016 @ 11:29am
[ RESOLVED ] Why is a Variable (RED)
I don't get why the var for "item" is showing up red.
Is there a way to track down the source?

http://steamcommunity.com/sharedfiles/filedetails/?id=787627999
Last edited by Diveyoc; Oct 26, 2016 @ 9:24pm
< >
Showing 1-11 of 11 comments
sitebender Oct 26, 2016 @ 11:48am 
Because its a value that comes with GameMaker, such as "score," "direction" or "lives." I tend to avoid using GameMaker's own variables unless its image_blend, image_angle, image_angle and so on. Its up to you though.

They have default values always so they don't require you to set them before you use them. So image_angle will always be set to 0 without you making image_angle = 0 until you change it.

You can make your own macros that will make your own variables set in stone like the default variables that GameMaker uses. Macros tend to be more something you'll want to use for specific builds. Like an Android build, an admin build and so on.
Last edited by sitebender; Oct 26, 2016 @ 11:51am
Diveyoc Oct 26, 2016 @ 11:57am 
Well that was my first assumption, but when I middle/mouse clicked it and went to the GM help index, there wasn't a dedicated definition or anything for it like other commands. So I guess that leaves me wondering, what is this function for?
This is from Shaun S's tutorial so I assume this was added sometime after he made the tutorial, because it showed up white when he did it.
I guess long story short, I should just choose something different for this var.

Originally posted by sitebender:
You can make your own macros that will make your own variables set in stone like the default variables that GameMaker uses. Macros tend to be more something you'll want to use for specific builds. Like an Android build, an admin build and so on.

Good to know, thanks.
sitebender Oct 26, 2016 @ 12:31pm 
Commands or functions are in orange. Those are the ones you can middle mouse click or the alternate method for those without middle mouse buttons.

You can adjust the color scheme or change the preferences to have normal white code. As for Shaun, I can only speculate since his tutorials are now older than a year or so.

I always do lifes instead of lives and points rather than score. Its confused people I work with on game jams.
Diveyoc Oct 26, 2016 @ 1:28pm 
Ok thanks.
Diveyoc Oct 26, 2016 @ 8:19pm 
Wait a minute, I just downloaded an inventory source from the marketplace which is almost identical to what I'm doing.
I open the same object (obj_invisible_button) and find almost the same code that I have, except "item" is white and not red. How can that be?
sitebender Oct 26, 2016 @ 8:43pm 
Could be the settings of that specific project. My project has item in white as well.

Do you have a macro that is an item?
Diveyoc Oct 26, 2016 @ 8:50pm 
Not that I know of, I certainly haven't created any macros that I'm aware of. Is there a way I can search my entire project for the word "item" and see what shows up?
Diveyoc Oct 26, 2016 @ 8:58pm 
Maybe this is the culprit. I still have my original obj_inventory object that I am not using. I just didn't delete it in case I wanted to go back and try it again.
The create event has this.

enum item
{
none = 0,
Red_Ball = 1,
Blue_Ball = 2,
Yellow_Ball = 3,
Orange_Ball = 4
}

However, even if I change it to enum zzzz or whatever, item still shows up RED everywhere.
Diveyoc Oct 26, 2016 @ 9:16pm 
What do you make of this? I can type just "i" or "ite" and they come up RED as well, and show that pop-up box about enums.
I now deleted the old inventory system and scripts and it still didn't go away.

http://steamcommunity.com/sharedfiles/filedetails/?id=787860696
Diveyoc Oct 26, 2016 @ 9:24pm 
Ok, after deleting it, I saved the game, closed it, and reopened it. Now I can type "item" and it comes up white. So it was definately that enum.
sitebender Oct 26, 2016 @ 9:59pm 
Yeah I hate enums for various reasons. This isn't the first enum issue in the forum.
< >
Showing 1-11 of 11 comments
Per page: 1530 50

Date Posted: Oct 26, 2016 @ 11:29am
Posts: 11