Pages: 1 [2]
  Print  
Author Topic: Turning On A Variable Disables Character Movement  (Read 649 times)
Offline (Unknown gender) Hoohee
Reply #15 Posted on: February 06, 2018, 03:50:42 AM
Member
Joined: Aug 2017
Posts: 40

View Profile
I'm bumping this to say that I've never gotten this error before, so far as I know.  Why declaring some global variables would cause it, I also don't know.

I also converted everything involving global variables (I think) to code.  Granted, it was GML, so that might not work completely.
Logged
Offline (Male) Josh @ Dreamland
Reply #16 Posted on: February 06, 2018, 12:02:42 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2948

View Profile Email
As you have probably noticed, var<Vacuum> object_Mouth is not valid syntax (well, it technically resembles valid syntax, but as the compiler pointed out, var is not a template).

The error you posted is actually a warning; it will not prevent your game from building nor harm its function. Interesting to note, though—I'm not sure why that function is being generated if ENIGMA is not using it. Probably a sloppy refactor.

How are you assigning to this global variable? How are you reading from it? This sounds as though there may be disparity, there. Are you declaring it global explicitly? If so, how?
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) Hoohee
Reply #17 Posted on: February 15, 2018, 11:04:37 PM
Member
Joined: Aug 2017
Posts: 40

View Profile
In the title screen of the game, I have an object containing this code in its "Create" event.

Code: [Select]
globalvar Vacuum;
Vacuum = 1;
globalvar Fuel;
Fuel = 1;;

Then in the level, following, there is another object made specifically for declaring these global variables again; except as 0.  I was told that it's better to declare global variables as 1 initially, but the way I made my game in GM, they were supposed to start at 0.
Logged
Offline (Male) Josh @ Dreamland
Reply #18 Posted on: February 19, 2018, 01:55:47 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2948

View Profile Email
I can't think of any reason to favor declaring globals as one instead of zero. But "globalvar" is a GameMaker: Studio construct; ENIGMA just has you say "global var" instead. I can't tell if the compiler recognizes that you are trying to declare a global, or if it just assumes you left our two semicolons and wanted to say a bunch of variable names for no reason. The point is, it's possible globalvar just isn't working (although it seems to be declared in actions.h. Try printing the value in another object to make sure it's being persisted.

Otherwise, it could be an event ordering issue. Try setting it to what you mean instead of to one and then the correct value later.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Pages: 1 [2]
  Print