1. shui.bdr

    changing variables of an instance

    so i need to make a moving platform, normally i'd create two objects with different directions, one for the platform that moves in the y axis and the other for the x axis, but i thought that there could be a way to change a variable of 1 single object and then in code say that for example if...
  2. Totofer77

    SOLVED How can I play the game despite having unused Variables?

    Well, I don't know if I'm the only one to complain about a problem like that, but the game won't load all because I have unused Variables Here is the Output : "cmd" /c subst Z: "C:\Users\totop\AppData\Roaming\GameMakerStudio2\Cache\GMS2CACHE" elapsed time 00:00:00.0759998s for command "cmd"...
  3. Rippley

    Interact with object with specific variable

    I want to make a portal, and what I did was make portal_1 and portal_2 and in each one put the variable "portal" that would be defined manually. And with that, I want to make that when the player collided with portal_1, it would go to portal_2 with the same variable. Ex: Portal_1 with the...
  4. D

    Need help with warping the player through rooms.

    So I know how to make the object that warps the player through the different rooms because I have a separate game that I was working on and it worked out fine (that game was transferred over from gm 1.4 to gm2), here's the code of that original object: obj_player_1.x = target_x; obj_player_1.y...
  5. T

    GMS 2.3+ [Solved] Argument not able to be set

    Hi everyone, I am having trouble with a script I created that uses functions from csanyk's iMprOVE_WRAP extension. The purpose of the script is to return some traits in an array of the nearest object from the calling instance. I use this so enemies know the location of the player. To get the...
  6. S

    Having an error pop up.

    So when i try to run my game after adding some scripts from a tutorial i get this error ___________________________________________ ############################################################################################ ERROR in action number 1 of PreCreate Event for object o_entity...
  7. JelleB

    global hp?

    Is there a way to have an hp variable that can be accessed anywhere in the game? I want the variable to stay the same until i change it. I'm pretty sure you use global variables?
  8. FoxyOfJungle

    SOLVED Passing global variables to variable definitions?

    Hi, Is there no way to pass global variables using "Variable definitions" of an object? I defined particle_system_index and particle_index: I put the variable here but it doesn't seem to recognize it... I've tried switching to all types there in the selection but it doesn't work. When...
  9. nuclear_shmatt

    switch statement case 2 code won't run

    So, everything works, up until the "switch(i) case 2:" where it just doesn't run even though in the debugger, the 'i' variable does reach 2. if(!menu_check) { switch(menu_type) { case MENU_BAR.NORMAL: for(var i = 0; i < menu_amount; i++) {...
  10. King

    SOLVED Getting "Assignment of an empty value (function does not return anything?)" ONLY when I try to build YYC (Android)

    So my game build fine on mobile when compiling using VM. But trying to build on YYC gives me an error for one of my pieces of shader code if (end_super_speed) { var u_time = shader_get_uniform(sh_speed_flashing_warning, "u_time") if ss_final_countdown >= 0 {...
  11. NovemberTender

    SOLVED switch statement loop even with break;

    if ((menuability_commited != -1) and (global.menuability == true)) switch (menuability_commited) { case 4: { instance_create_layer(oPlayer.x, oPlayer.y, "Held_Tools",oFireorb); break; } case 3: {...
  12. N

    SOLVED Easy way to clamp to 0 after a certain number has been reached?

    Hi, I have the variable speed = 8 In my step its: speed *= 0.9; and I want it to jump to 0 after its below 1. Do I always have to write if (speed < 1) speed = 0; ? or is there an easy function like clamp, min, max etc.
  13. E

    Windows [Solved] - Global Var doesn´t have the actual value

    Hi there, i have a confused issue. here my code: scr_revice_msg() ... case 7: var player = buffer_read(buffer, buffer_u16); scr_get_states(player, 1); scr_server_send_data(1, targetsocket, 7, global.exp); break...
  14. R

    [sorted out]updating variables

    hello guys, i have a doubt about the create event and ways to update variables with new values. well, I'm trying to create a system that passes information between instances and, I modified and updated its variables, however, when I was creating the system (I tried it in many ways, even with a...
  15. W

    Not existing variable "not set before reading"

    Hello everyone, I'm working on a platformer/fighting game right now and I just followed a tutorial on how to add a grapple. However, now when I run my game and press the button to use this grapple i get this error : ERROR in action number 1 of Step Event0 for object obj_Reb: local variable...
  16. R

    How to change variable after collision?

    I instantiate my variable and then later I have a collision that I want to make the jumpheight smaller. I have this but it does not work. I changed the number from -10 to -20 and it did change the jumpheight but the collision does not. I need assistance. jumpheight = -10 if...
  17. PotatoSnail64

    GMS 2.3+ It says variable not set before reading it even though it should have been set at the creation of the instance

    In a game that I am working on I made a very simple door that is set up so that I can edit the variables of specific instances of it so they will lead to different locations. When I select an instance I am pretty sure that I can set the variables at the creation of the instance. When I go...
  18. T

    Giving a colliding object your variable value.

    I have a game which has the main character (a light bulb boy) interacting with several intractable electric objects. The electric objects have two main "states" (though no real state system has been implemented yet), where they are either turned on or off as indicated by sprites. I have a system...
  19. G

    Drag And Drop Creating an instance using a variable.

    When creating an instance, is it possible to use a variable containing the object name instead of the object name itself? Whenever I try doing this, it results in an error.
  20. M

    GMS 2 Difference between undefined and variable not set.

    Hi there, first post so don't kill me here. Can someone explain the difference between a variable that's undefined and not set? It's just I'm used to JavaScript where they're the same thing. The reason I ask is sometimes I try to handle this by doing say if (is_undefined(fullScreen)) fullScreen...