ds_grid

  1. P

    GameMaker Generating multiple ds_grids and stringing them together visually

    I'm trying to create an infinite world using chunks. Currently, I'm using a noise function to generate terrain on a ds_grid that is the same size as the room. It looks like this: Now I'm trying to have the world generate in 16 by 16 chunks so I can make the game infinite. My plan was to...
  2. Evanski

    (Solved)help me understand what im doing wrong

    cmd_list_size = 9; //max size of grid cmd_list = ds_grid_create(1,cmd_list_size); //create grid ds_grid_clear(cmd_list,0); var grid = cmd_list; //set all commands to false for (var i = 0; i < cmd_list_size; i++) { ds_grid_add(grid, 1, i, false); } //COMMANDS...
  3. P

    Legacy GM ds_grid_add not recognizing 0 as a number

    I'm trying to code a 3-dimensional grid structure for Game Maker Studio version 1.4.1804, and I've hit a bit of a snag. Every time I test the code to add a value to the data structure, it gives me this: Here's the script that encounters the error: ///ds_3d_add(id,val,x,y,z) //Initialize the...
  4. S

    GameMaker Help with Debugger: How to trace grid out of bounds warning message?

    My game uses a custom procedural map generation system using ds_grids in about 20 or so scripts. The game runs fine without any crashes or errors, but when I close the game, I see one or more warning messages in the output window that look something like this: Grid 0, index out of bounds...
  5. T

    Legacy GM Memory usage with DS_Grid

    All, Is there any way to calculate how much memory is being used by a ds_grid array? I'm using the grid for tracking perimeters in a roguelike and am debating using one ds_grid for each level (multiple rooms per level), or one ds_grid for the whole dungeon. The data in each cell is only a...
  6. camerakid

    GameMaker Drawing game elements from a DS_GRID

    Hey Guys, I am migrating an isometric game from GMS 1.x to GMS 2 and I run into a complex question I should decide and I would like to hear a few ideas. In the old system I used a few ds_grids that were storing all graphics in it and a script was redrawing all elements with the tile_add...
  7. M

    GameMaker Generating a line from A to B in a grid, with random variation

    Hello, I am trying to generate a path from a point in a grid to another, I am trying to do this in a 100x100 ds_grid in a way that the player won't be able to detecta s a stright line or perfect curve, to do this I need to "draw" a line from one center side of the map to another. This will be...
  8. O

    How do I make an inventory screen.

    I'm trying to make an inventory for an RPG I'm trying to make but I have almost no idea what I'm doing I'm wanting to use DS_grid for this and have a sort of separate screen from the room the character is currently in. So my question is how do I make the grid and how do I make it so that...
  9. S

    GameMaker FOV not quite right

    Evening all, I am hoping someone can help. Following code based on http://www.adammil.net/blog/v125_Roguelike_Vision_Algorithms.html#mycode I have put something in place, though it definitely doesn't work as hoped! I'll be honest, whilst I wrote all the code out while following an example...
  10. S

    GameMaker Calculating Fov from a ds_grid

    Afternoon all, I have my world info stored in a ds_grid as a bitmask and my entities are mapped on to another ds_grid. My intention is to track what tiles are currently visible by recalculating the field of view (FOV) whenever the player ends a turn in a different space to where they started...
  11. PlayerOne

    GameMaker Advice when it comes to loading text (localization) [SOLVED]

    I plan localizing my game and I have two ideas rolling around in my mind on how to load text. Either load the strings from an .ini file into a ds_grid in a centralized way and have the objects access the strings form that grid or load strings in each object when a room starts (or object spawned)...
  12. S

    GameMaker Bitwise operations and Ds_Grids

    Evening all, I am converting a 2d array to a ds_grid but I am not sure how to convert the bitwise operations. Do we have to do something specific to use bitwise operations with ds_grid? I have gone from oControllerTile.tileArray[_arrayHeight, _arrayLength] |= ISBLOCKINGMOVEMENT |...
  13. Strobosaur

    Blood surface only drawing on top of ground tiles? [SOLVED]

    I bet this has been asked before, but i was unable to find a good answer after some searching, so here goes: Im making a top down game, and i use a ds_grid for the map structure, then i map collidable tiles to another ds_grid and use that as a collision grid. Im also drawing all blood to a...
  14. Daniel Mallett

    Saving data

    I am trying to figure out how to save ds_map data. I have the following code: list_data = ds_list_create(); // Create list ds_list_add(list_data, 000); // Add value to list pos 0 map_data = ds_map_create(); // Create map ds_map_add(map_data, "list_data", list_data); // Adds list to map...
  15. PlayerOne

    GameMaker [SOLVED] Finding a specific item in a ds_grid and subtracting it.

    Right now I'm creating an upgrade system akin to the Fallout 4 / New Vegas workbench system. Everything is set up but I need to find the first item id of an item that I'm specifically looking for. In this case the item id is a sprite that is used to identify items in my players inventory. Now I...
  16. L

    GML Advice on Large Data Structures and Memory

    I'm building a management game that works with quite large ds_grids (20x100) and I'm not sure how they are handled when leaving and entering rooms, especially in trying to prevent memory leaks. Also some of the ds_grids will need to be looped through during step events. In an object's create...
  17. Daniel Mallett

    GMS2 crashes ds_map_add_map

    I have a button and some code that will simply close the app. This works fine by itself. Then I add the following code. At this point the game still runs but as soon as you click on the quit button Gamemaker crashes and says it's become unstable etc. My problem is 1) Regardless of my code it...
  18. L

    ds_grid_sort not actually sorting?

    after a few hours of scratching my head and restarting my scripts I just have to ask here! I'm a bit new to Gamemaker, but have a little experience with C and other 3d-software-scripting languages. I'm just trying to make sense of where and how I should be calling ds_sort_grid. In my Create...
  19. PlayerOne

    GameMaker [SOLVED] Item rollover into new inventory slot [DS_GRID]

    Alright I'll just boil this down, I have a ds_grid inventory system (28 slots) and an item cap per item (90). Works as intended, but I have this issue that when a inventory slot equals the max amount of an item or more then when I pickup another item it will go into another slot. Leaving the...
  20. S

    Legacy GM [SOLVED] ds_grid Position Detection Help

    Hey! This is my first post on the forum so I'll try to be as clear as possible! I'm creating a digital version of the board game "battleship" for a coding class at my high school; however, I've run into some issues trying to get my grid to detect when an object is within a specific square. I...
Top