• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Legacy GM Compile Error, Unsuccessful at fixing

MGSting

Member
So I've been using someone's platformer template for GMS and this is the script he created for character inputs
Code:
///key_check(key, event)

/* This script appropriately handles player input, given a key and event.
 * We use this to make support for multiple input types (gamepads) easier.
 * key: K_LEFT, K_RIGHT, K_UP, K_DOWN, K_JUMP, K_FIRE, K_START
 * event: E_PRESS, E_DOWN, E_RELEASE
 */

key   = argument0;
event = argument1;

// Define the default keyboard controls for each player.
switch (PLAYER_NUMBER) {
  case 1: {
    k_left = vk_left;
    k_right = vk_right;
    k_up = vk_up;
    k_down = vk_down;
    k_jump = ord("Z");
    k_fire = ord("X");
    k_start = vk_enter;
    break;
  }
  case 2: {
    k_left = ord("A");
    k_right = ord("D");
    k_up = ord("W");
    k_down = ord("S");
    k_jump = ord("T");
    k_fire = ord("Y");
    k_start = ord("Q");
    break;
  }
  default: {
    assert("Default keyboard controls for player #" + string(PLAYER_NUMBER) + " haven't been specified.");
    break;
  }
}

// Handle an event based on the given key.
switch (key) {
  case K_LEFT: {
    return handle_event(k_left);
    break;
  }
  case K_RIGHT: {
    return handle_event(k_right);
    break;
  }
  case K_UP: {
    return handle_event(k_up);
    break;
  }
  case K_DOWN: {
    return handle_event(k_down);
    break;
  }
  case K_JUMP: {
    return handle_event(k_jump);
    break;
  }
  case K_FIRE: {
    return handle_event(k_fire);
    break;
  }
  case K_START: {
    return handle_event(k_start);
    break;
  }
  default: {
    assert("Unable to handle unrecognized key: " + string(key));
    break;
  }
}
So I went into the code to try and change the inputs to make it more comfortable on a keyboard. The problem is when I tried testing it I got the compile error message and that I had to go into the compile error window to see what went wrong. Not knowing where the compile error window was, I tried just changing the code back to what it originally was, however that didn't work either. So what am I missing here? Thanks in advance.
 
Without any error to look at, I'm taking a guess here. But I cannot see any command called assert() in the manual. Is this a special function that is being called? Your compile window should just be another window in the IDE. I thought you could actually click a button on the error window to display it, but I could be mistaken as I haven't used 1.4 for a couple of years.

What does the compile error message actually say other than telling you to look at the compile error window?
 

MGSting

Member
Without any error to look at, I'm taking a guess here. But I cannot see any command called assert() in the manual. Is this a special function that is being called? Your compile window should just be another window in the IDE. I thought you could actually click a button on the error window to display it, but I could be mistaken as I haven't used 1.4 for a couple of years.

What does the compile error message actually say other than telling you to look at the compile error window?
it says "Compile Failed - Please check the Compile Window for any additional information"
 

FrostyCat

Redemption Seeker
The so-called "Compile Window" is the text-only pane that should be on the bottom-right of the IDE window. If you closed it, go to the menu bar and select Window > Show Compile Form. If it's too stubby, copy everything out onto a text editor and read it there.
 
Top