ds_grid

  1. Logan Bevans

    Ds_Grid Help

    I don't know a whole lot about ds grids but found this awesome inventory system that uses ds grids, well to remove items from the inventory you run this script. [ //If there's only 1 item in the inventory if(ds_grid_height(playerInventory) == 1) { //Only 1 item in inventory...
  2. Divinik

    GMS 2 Loading Grid From Json Not Working Properly?

    So in the game I'm currently working on, every companion and their info is stored in a ds_grid (Companions_Grid), and within each companion's column is another inventory grid stored for the companion. The code for storing the inventory grids into the json seems to be working perfectly, I check...
  3. D

    GMS 2 ds_grid not showing values set in create event

    I've filled a ds_grid in the create event but when I iterate over it in the draw event (same occurs in the step event) it shows the correct value only for the top left cell. All other cells show the value stored in the top down cell. I've stored an array in each cell of the grid, acccording to...
  4. C

    GMS 2 Will this cause a memory leak?

    Hi Guys, Help me clear something up, I am using a script to find the nearest object, However I noticed when called it does a DS_grid_create. now usually this may not cause an Issue but im calling the thing ALOT! I take it that this thing firing off every frame is NOT good!? its not major...
  5. D

    GMS 2 Way to store ds_grids within other data structures?

    I'm currently working on a game which uses different maps (not ds_maps, just maps!). Therefore I saved all the tiles of a map in a ds_grid. So I end up with many different ds_grids, that I want to save & load. Is there any way to do this with data structures? I already tried to put them in other...
  6. deathzero021

    Legacy GM <Solved> Console "out of bounds" error

    The error: Grid 0, index out of bounds writing [-1,0] - size is [4,4] Now this implies that I am trying to write to a grid in a position that doesn't exist. I used the debugger and set many break points, going one step at a time until I found the culprit. // Left side if (bx-1...
  7. A

    Any tips on setting up a scrolling background similar to Spyhunter NES?

    I know how to create a scrolling star-field background with random generated pixels for stars, but I can't grasp a good approach on how to make scrollable tiles like the Spyhunter NES game. Not asking how to make a tile-set, but how would someone make the background scroll, and keep collisions...
  8. Dr_Nomz

    GML How do I save a ds_list to a ds_grid?

    I thought I knew how to do this, but lot's of testing shows I have no idea how to do this. for (var o=0; o<4; o+=1){ var _row = scr_DSGAR(save_blue_dialogue); save_blue_dialogue[# save_blue_dialogue_enum.option, _row]=option[|o]; } Basically it should just go through each and every value...
  9. MeltingCat

    GMS 2 Saving a ds_grid in a ds_map

    Hi, I'm having trouble saving my inventory system in a ds_map as part of a JSON. I found this thread: https://forum.yoyogames.com/index.php?threads/adding-a-ds-grid-to-a-ds_map.50573/ where the answer to my question seems to be written, but I can't make it work. As of lack of experience I...
  10. MeltingCat

    GML Navigating through a ds grid

    I made an inventory system a while ago which is based on a ds grid. It all works well and now I decided to add a quick assign of my "equipped item". Basically the goal is to press a button and you will scroll through your items in the inventory without opening it up. So far I've done okay in...
  11. O

    Legacy GM Help with a concept in a tilemap.

    Hello. I've been playing around with a ds_grid based tilemap, random generation and autotiling. My basic idea is to have destructible terrain with some other stored variables like perhaps friction in a ds_map stored within the grid cell corresponding the tile. Now, I have watched some tutorials...
  12. meseta

    Asset - Extension GMDebug: Browser-based debugging

    I originally just wanted a quick and easy way to see my ds_grid data, which GM's debugger doesn't show clearly. I'm aware that there are some marketplace extensions that allow ds_grid printing, but I wanted to do something different. So I built GMDebug, a browser-based tool for inspecting...
  13. P

    GMS 2 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...
  14. 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...
  15. 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...
  16. S

    GMS 2 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...
  17. 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...
  18. camerakid

    GMS 2 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...
  19. MagnumVulcanos

    GMS 2 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...
  20. 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...
Top