variables

  1. G

    Spinner not giving score as it should be.

    I'm trying to add a reward spinner into my game, but I can't seem to get the wheel to give score. This is what I have tried, and it refuses to give any score. Spinner: Create: velocity = 0; checker = 0; startspinner = 0; Step Event: if (startspinner == 1) checker += 1; if (checker % 5 ==...
  2. B

    SOLVED Copying Variable from Nearest Instance

    I am having one moving object called objForce spawn instances of another called objPath in intervals as to make a dotted path. There are several objForce instances and they all have different colors, randomly assigned, labeled col. (visualized) I am trying to make the created instances of...
  3. T

    Instance Create with set Object Variables?

    Hello, Game Maker community! I've recently been starting to hit my stride when it comes to game development. I've been working on a lot of cool features and hopefully I can get a little something out soon. Anyway, I'm here because one of the features I've been working towards is a Pendulum...
  4. G

    GameMaker Is there a best way to store Gameplay triggers in an object?

    Hello, I have recently finished the saving and loading function in my game (saving as a JSON file), and am at the point where in terms of gameplay triggers (Such as if story events have been triggered, or if you've already beaten a boss) I only have one, stored to a persistent object as a...
  5. Erik Leppen

    GML (solved) How to check whether a variable holds an instance vs. an object

    For years I have used the following code in a debug functions: if instance_exists(v) and not object_exists(v) { /*...*/ } This code is meant to check if the variable v is actually an active instance in the current game state, and not an object of which instances are active. This worked for...
  6. Jasuke

    variable_struct set acts weird

    so i wrote this code, to later add a new variable to a struct, inside an array , but when i ran the debugger, the variable name, was displayed as 234, what is this all about?
  7. C

    issue with multiple variables and running scripts

    hi guys Im currently in the process of making a slot machine game. I've managed to fix every other issue i've ran into so far but this i just cant work out why its not working. ive tried many different methods to fix it today, literally spent about 12 hours today trying and no luck so the...
  8. 2

    How do I draw my score with written code

    I am trying to make an object called game that will draw every variable of my game, I am currently figuring out writing the value points. It will follow my player object to prevent my viewport from covering up the object, but it gives a bug report as soon as I open the game.
  9. kenmasaka

    Strings and variables

    Hello, I've made a highscore thing and I want to show it onscreen with the text "best score : " right before it. I've tried many combinations like adding a plus between the string and the variable, but it doesn't work. var highscore_onscreen = highscore_value(1); draw_text(10, 960, "best score...
  10. FlatulenzaFiamm

    GameMaker Is there a way to do this thing... ?

    Heeeey comrades! Yeah whatever you probably know or don't know the drill, not important. I have a problem/question: I have an object named... "poo_poo", that has a certain variable named "fart" that equals to a different instance of "poopoo". First object instance: poo_poo_0 Second...
  11. AnnoyingDoggoX

    GameMaker Can array items be structs?

    I was wondering because I would have an array called enemies and have items like: slime, skeleton, goblin and then access the struct's variables with slime.hp <-- if that's correct
  12. S

    [SOLVED] Script Function doesn't recognize Create Event Variable

    I decided to clean my player's Step event and turn it into various different Scripts but when I tried to do it I got the error: ___________________________________________ ############################################################################################ ERROR in action number 1 of...
  13. D

    Any way to make an energy variable decrease after pressing a certain key?

    I am very new to programming (but I have experience coding in Scratch and Kitten) and I'm making an RPG where you can either walk, run or sprint. Walking and running doesn't take energy but sprinting does. I want it to when I press the sprint button (tab) it starts to decrease the energy...
  14. FlatulenzaFiamm

    GameMaker There's any particular difference between Variables and Built In Variables?

    Yoooooooooooooooooooooooooo, comrades. I don't have a problem this time (if you don't count the one's in me brain), but I have a question that I think it would be cool to permanently add in the GameMaker Community thread server. Is there a specific difference between variables and built in...
  15. G

    Is There A Way To Copy And Paste The Variables Table In The IDE?

    Is there a way to copy and paste the table of variables in the IDE? Can't seem to find the option.
  16. M

    SOLVED Problem that's busting my brain

    Here we go: Im developing a backpack and inventory system for a Text Based Rpg i've been working on. The code im talking about specifically here is one under the Enter key ( You are using a chatbox at the bottom to give commands to the game , in this instance choosing a backpack slot, ( 1-9 )...
  17. Leif

    GML [SOLVED] Pointer to a variable

    Good day I'm thinking to make of how can I change variable of an instance with some kind of pointer to this variable. The task is: I want to change any pointed variable by a script. For example: i want to make my character move with parabolic trajectory by x or by y. So, I will create...
  18. B

    SOLVED "Variable not set before reading it" in destroy event, already defined the variable.

    Hey! So i really don't know what should be the problem here. I've been around like- 2 hours trying to solve this problem, but i'm completely mind-blocked. My problem is this: ERROR in action number 1 of Destroy Event for object oTorch: Variable oTorch.lighttt(100356, -2147483648) not set...
  19. flyinian

    SOLVED Assign object to variable or not to assign to variable?

    Would assigning an object that is used often to a variable of any kind be faster than referencing it's full name? I understand that each time the object is referenced somewhere, it has to be looked up first. If this is faster, would it be good practice to assign the object to a variable? If...
  20. otterZ

    SOLVED Does declaring many global variables at the start of a game slow loading time down?

    In the project I am working on I have around 200 global variables being declared and initialised in a Create event in the very first room (start up screen). As I add more content to the project I could end up with 1000+ global variables, so my question is this . . . Does declaring and...
Top