• 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!

case

  1. Y

    GML Sequence not running

    I have a function that runs a sequence in the middle of switch statement as part of a turn based game. The problem is that if I simply call the function like I would any other function, it does not run. The only way it does run, is if the switch statement goes to the next case. It would seem the...
  2. VoxPrincipalis

    SOLVED Switch Case Range

    Buen Thursday Y'all 🤠 Does Game Maker support ranges in a switch case? Some C++ compilers do. Example: switch(ord(char)) { default: return -1; break; case 32: return 0; break; case 194: return 0; break; case 207: return 0; break; case 212: return 0; break; case 252...
  3. huenix

    Issue removing spawn point form available list after taking it

    I am trying to make it so a connected player spawns on an available starting spot (its a board game). It currently works to place them at random points, but they CAN over lap players, i don't want that. How do i remove the available spawn point after "ojb_player" is crated at x/y? if (type...
  4. sinigrimi

    GameMaker Need help with "switch"

    Sorry for the stupid question, but I need to know how to make the analogue && (and) from the if system in the "The" Switch "Statement" system. I seriously don’t know. I need to test 2-4 events at once, but I want to do this in the "switch" system
  5. C

    Question - Code Switch Statement Compile Error

    Hi all! So today I thought I'd try something with Switch statements, I figured it wouldn't work but I didn't expect the error I got. All I did was put the "Or" Operator in the cases (||). You can see the code below: ///@description horizontal_tile_collisions() var grounded =...
  6. ac585318

    Question - Code Do case statements require curly braces?

    I'm new to GMS2 and am curious... Do case statements require curly braces? I've seen been going through tutorials and some of them are using curly braces in the case statements and some not. I breifly read that apparently in the C programming language they are needed for declaring variables in...
  7. S

    GameMaker can I put a switch inside of a switch?

    if (daycycle.hours >= 24) { dialouge_choice = irandom(1); switch(relationship_Level){ case 0: switch(dialouge_choice){ case 0: text = ["Hello."]; case 1: text = [...
  8. M

    GameMaker (HELP) switch statement with range of numbers as a case

    im sorry my english is kinda bad, ill try to explain what i need as simply as i can: i want one of the cases in a switch statement to happen in a multiple situations. i want to write something like this (just as an example), but of course it is not how it would work: switch (anim) { case 1,2,3...
  9. M

    GML [SOLVED] Is GML case-sensitive?

    I want to make a non-"draw_text"-text display-er. I don't know if lowercase letters should be considered to be displayed. Simple question to solve this, Is GML case-sensitive? Can GMS 2 Detect a case different in variables and strings? Example: string = "A" if string = "a" { x = "true" }...
  10. MartinK12

    GML [SOLVED] How can I use object name in switch statement?

    I've created this simple code and depending what kind of object is selected I want to perform different actions on it, but looks like I always get default case. I don’t know where I messed up? Thank You for pointing my mistake :) if mouse_check_button_pressed(mb_left) { instance =...
  11. X

    GML Can a case in a switch statement be checked for "noone"?

    Cases in switch statements need to be a number, be it 0, positive or a negative number, or it can be set to default... The "noone" declaration, refers to a null or empty variable. If I used a switch statement, could I have a case for if it is unset? It could allow me for some pretty...
  12. C

    Can't escape from my switch-based textbox

    Hi, I've made a working system so my player can talk to npcs, there's just an issue or shutting it at the end. This is my code: draw_self(); if (show_text = 1) { var str; switch (line) { case 0: {str = "Four lines of text " + string(line) + " lineys"...
  13. X

    GML [Solved] Can a case in a switch statement have a negative value?

    Quick question, since I don't want to write a whole bunch of code having these values set up and then it turning out to not work. Essentially, I want to know whether something like this: switch(some_thing) { case 1: break; case -1: break; } Is that okay, or a no-go and...
  14. A

    GML How many cases can be in a Switch statement?

    Is there a built in limit, or a practical limit (causes slow down), to the number of cases that can be in a switch statement? does it matter where the switch statement is (like in a step event vs a draw event)? the player in my game has a complex set animations/states and gear you can see, and...
  15. A

    GML Case statement not in manual?

    Am I the only one who cant find anything on "case" in the manual? i searched for it in the manual and middle mouse clicked on "case" in game maker and still nothing. any help?
  16. M

    Showing sprite

    Hello everyone! Few days ago I have an idea to make an clicker game with case opening. Everything goes without any problems till now, where I cannot show sprites in room. I make most of my code in room's creation code, but when I try to make some sprites using "draw_sprite" they simply didn't...
  17. A

    Simple Menu Problem

    I'm just starting out with Game Maker so I am using tutorials to learn how to do everything. I've managed to make a simple Yes/No pop-up menu that comes up in my game. It's designed for planets on a solar system map. When the player runs into a planet the planet creates an instance of this menu...
Top