index

  1. flyinian

    SOLVED Parent and first child have same index/id?

    I am having trouble updating data when switching what is being selected(think of items in a store and when you click different items, it gives different data for each item). This is determined by the object's index/id when clicked. I noticed that the parent and first child of said parent has the...
  2. tobiasgjerstrup

    GMS 2 [Solved] how to change image_index for a drawn sprite?

    hello guys. I was wondering how you change the image index for a sprite that you draw (not the sprite associated with the object)
  3. Smenkare

    (solved)getting index from ds_list

    Create event exampleList = ds_list_create(); ds_list_add(exampleList,1); ds_list_add(exampleList,10); ds_list_add(exampleList,10); ds_list_add(exampleList,30); choice = 0; weight_sum = 0; for(var i=0; i<ds_list_size(exampleList);i++) {weight_sum += exampleList[|i]} Draw event if...
  4. J

    Question - Code Need help with random cursor

    Hey guys, So I have a sprite with 10 images, all different coloured cursors. Here is my code: if (room != rMenu) and (room != rControls) and (room != rUpdatesAndNotes) and (room != rShop) and (room != rEnding) and (room != rCredits) { cursor_sprite = sCursorGun; } else { cursor_sprite =...
  5. Pfap

    [SOLVED]Resource order and saving

    This is probably not a big deal, but is there a solution to avoiding resource conflicts when updating a launched game other than: once a game has been released never change the order of resources and if adding to the game only add at the tail of the tree? I guess, maybe saving the string name...
  6. FacesOfMu

    GMS 2 Get the script name within the script?

    I see there's script_get_name(scr), but that requires the input of the script index. Is there anyway to get the name of the script the code is in without knowing the index? For example, objects have the "self" and "id" keywords to reference themselves. I'm looking for a programmatic way to...
  7. S

    GMS 2 (Help) Array index out of range

    I was making a scrolling system in gamemaker 2 and I got an error I cannot seem to figure out! Create: Draw: Step: Error:
  8. H

    (Solved) Deleting/destroying room duplicates?

    Hello! I am using DND, but understand a bit a coding/gamemaker language. I am making a game similar to Doodle jump. As the player sprite leaves the top of any room it moves to the next room and if it hits the bottom of any room it goes to the previous room - simulating an endless sky. I...
  9. FacesOfMu

    How do you solve "index out of bounds" errors?

    Do you have a special method or tip on how to solve "index out of bounds" errors? Do you know a neat trick on cutting your investigation time? Please post your GMS2 list and grid access tricks! Pre-reading...
  10. S

    Legacy GM DS_grids - non reproducible bug

    I have been getting this bug with my DS_grids that seems random when it shouldn't be and I highly suspect it is a bug on game maker's side. at the start of the game I have this object creating global ds_grid's in Game start event global.invT = ds_grid_create(0,3) //item id, modifier, upgrades...
  11. A

    Windows sprite_index not working properly

    So i just bought gms2 and started a new project. as i started inserting animations i noticed something. Unlike in gm1 if i set sprite_index = 0 it just locks on set index now here is my draw event: draw_self(); show_debug_message("image_index = "+ string(image_index)); if hsp_ == 0 { if...
  12. YoSniper

    [SOLVED] 1D/2D array confusion

    Hello community, I recently ran into an issue using arrays that I don't remember experiencing in Game Maker 8. Basically, I am trying to initialize values to be stored in a persistent object that basically tracks my game data, and is responsible for saving to files and loading data back from...
  13. andev

    GML String functions that start at 0 instead of 1

    GM Version: Studio Target Platform: All Download: Download Links: <N/A> It bothers me that the string functions start at id 1 and not 0, because it means you have to add offsets sometimes. So I wrote some pass-through scripts that fix it. Further reading. All scripts are ready to drag straight...
  14. Pfap

    global variable index???

    FATAL ERROR in action number 1 of Create Event for object data_structure_grid: global variable name 'purple1' index (100007) not set before reading it. at gml_Object_data_structure_grid_Create_0 (line 14) - global.purple1 = 1 This is the actual code: //variables for tracking global.red1 = 1...
  15. K

    GML HOW TO MIX VARIABLE NAME WITH INSTANCE_NUMBER???!!!

    Hello Friends,Let's Contextualize... I'm doing a phase selection map where you plot the route to it, it works like this: you're on a planet and now you want to go to another, you plot a route to the other planet, creating points, obeying the amount of fuel that you have. Then you play the...
  16. Y

    Legacy GM Cannot make sprite animation stop

    Hi, i'm having this issue without a clue on how to solve it. In my character selection room y have an object which will set the frame (sub-image) of the player and CPU, and also the preview. for this In my object (arrows) I'm using "image_index -= 1 (for the back) and image_index += 1 (for the...
  17. A

    drawing animation issue

    Hey boys and girls, how are you all doing?Hope well! I have got this problem that i've seen solved in some threads but i couldnt really solve myselfe (probably just because im bad at programming ahah) first and foremost here is my lil' bit o' code if (atk1 == true) { sprite_index =...
  18. SuperSlim

    Legacy GM Check if room exists by name instead of by index

    I've made an elaborate system of room generation but it works by checking the room name instead of room index. It's not working because room_exists checks for the index. How do I make it check for the name instead?
  19. S

    Array, how to read out one value into another variable

    I want to read out the value of the array sx at the position xc_old and yc_old. I want to write this value into the variable xc. For this I use the following simple code: xc = sx[xc_old,yc_old] But I get the error: "trying to index a variable which is not an array" However, I don't want the xc...
  20. V

    Getting weird error in gamemaker for no apparent reason

    Unable to find any instance for object index '0' name 'obj_Block' at gml_Object_obj_scoreController_DrawEvent_1 (line 7) - draw_sprite(spr_ZFighter, 0,x + 128 +(i*spr_ZFighter.sprite_width), y)...
Top