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

return

  1. V

    Deleting folder GameMakerStudio2 and projects deleting.

    I was fixing my computer last time, and i forgot to save my game at .yyz file, i must to reload windows. Then when i launch program and login to account all my projects were deleted. Is there any way to return it? I have a game exported in .zip but i dont have anything else. ;-;
  2. W

    Can't assign a return to a variable

    I made (borrowed) a script for drawing buttons to gui and it works perfectly, except I cannot seem to assign a variable to the returned value. Here is the script: /// @function draw_gui_button_sprite(sprite, index, x, y, width, height, main_view); /// @param {index} sprite The sprite to...
  3. M

    GML Script Return don't work

    I've try to make a simple script that simply increment a number that we pass in the argument. In my object i call this script function every step and the variable is crate in the create section and not in the step section. this is my code, the resoult in the console isn't increment and simply...
  4. X

    Legacy GM What happens to lists and maps in these instances?

    Wondering what would happen in these cases to lists and maps. Picture that they are in a script, and when a script is called with either of these pieces of code in, I'm interested in knowing what will happen in terms of garbage collection; will the list or map be destroyed or hang around filling...
  5. X

    GML [SOLVED] Convert string to keyboard input or return keyboard input?

    Is it possible to convert a string to a keyboard input? Say I have "mouse_x" string variable and I want to create a new variable that holds keyboard input and takes that string variable to get what key the variable will be set to? Or may be it's possible to set in a list a key value? I've tried...
  6. N

    Legacy GM When this, skip the next ?

    Hi. I have a quick question, this is my code: if (!place_meeting(x+sign(hsp),y-8,par_ground) && !place_meeting(x+sign(hsp),y-8,obj_pipe)) { with (obj_oneway) { if (place_meeting(x-sign(other.hsp),y+8,other)) { if !(bbox_top > other.bbox_bottom) {...
  7. Fixer90

    GameMaker Returning a function in a script? (SOLVED)

    After getting GMS 2, I noticed that one of the compatibility scripts (the one for instance_create) used return before its function. Here's the code for reference: var d = object_get_depth(argument2); return instance_create_depth(argument0, argument1, d, argument2); What I'm wondering is, what...
  8. S

    The Return statement doesn't work in the script

    Hi, In a nutshell, I want to use the scr_zx() I created besides this: if (keyboard_check_pressed(ord('Z')) or keyboard_check_pressed(ord('X'))) so I created the scr_zx() function where i've put: return (keyboard_check_pressed(ord('Z')) or keyboard_check_pressed(ord('X'))) then I replaced the...
  9. N

    GameMaker Returning array from script

    I vaguely recall some functions returning an array, but it doesn't seem to work for me. Say you have a script that fills a local array with values, is it possible to return the array and end up with something like this? ///script_array() var array array[0] = 10 array[1] = 11 array[2] = 12...
  10. D

    GameMaker instance_position(xLocation,yLocation,all); returning 100099

    For some reason instance_position(xLocation,yLocation,all) is returning 100099 instead of -4 (or noone) like it should. It appears that the first time the code is run it returns -4. However, the second time it returns 100099 which is not the ID of any object and causes issues further down the...
  11. T

    GameMaker Returning Physics_World Variables

    Hello, does anyone know how to return values such as gravity in the current room or if physics are enabled in the current room? I have looked at: https://docs2.yoyogames.com/source/_build/3_scripting/4_gml_reference/physics/the physics world/index.html...
  12. Gamer (ex-Cantavanda)

    GML The return statement

    The return statement, what does it do? Hiya! I've been busy learning GML recently, and if there's one thing I don't understand, and just can't find a clear answer for (manual, forums) it's what the term returning a value means, and what the return statement does. Could someone explain it in...
  13. U

    Error in function exp()

    Hello everyone. I am running a script called sigma within the object obj Create Event. This script is as simple as this: return 1/(1+exp(-argument0)) which is returning the output of the logistic function. I don't see anything wrong with the code. However, sometimes I'd say like 1/5 of the...
  14. R

    Formulas returning NaN [SOLVED]

    I've This code event_inherited(); //parent gives his code slider_value = obj_options_menu_controller.surf_height; instance_create(x,y,obj_vbar); obj_vbar_parent.scroll_power = 20; obj_vbar_parent.slider_px_height = sprite_height; obj_vbar_parent.real_slider_height = slider_value...
  15. R

    returning an argument in a script, gone wrong I guess?

    position = argument0; key_kind = argument1; if(mouse_check_button_pressed(mb_left) && point_in_rectangle(mouse_x,mouse_y,x_pos+first_line-(button_size/2),y_pos*position-(button_size/2),x_pos+first_line+(button_size/2),y_pos*position+(button_size/2))) { key_kind = position; inside_region = true...
  16. A

    [SOLVED] How do I check which value in array is active?

    Sorry if the question was a little hard to understand. I'll try and break it down: i've initialized an array cRect[ ] to hold the returned values of a collision check for various collision rectangles. for (n = 0; n < arbitraryNumber; n++){ cRect[n] = collision_rectangle(32, 32 * n, 64, 64...
Top