grids

  1. flyinian

    SOLVED Best way to change a value of a ds_grid accessor assigned to a instance variables

    Is this a good way to add to a grid? if(mouse_check_button(mb_left) && position_meeting(mouse_x,mouse_y,_Object)) { var increase = ds_grid_get(gridname,1, 1); increase += 10; ds_grid_set(gridname,1, 1, increase); };
  2. flyinian

    (SOLVED)Is there a way to figure out what grid the output window is referring to?

    My output window says grid 4 is out of bounds. I can easily figure this out now, but what happens when I have a lot of grids?
  3. Enes

    GMS 2 Enemies either move very right or spawn only one exemplar

    okay, everyone...I came to a conclusion: whenever I add the "Add some enemies" just below the section where the walls of the grid are created, then the enemy starts to follow the player but it only spawns one examplar....however, if add the "Add some enemies" just below the section where the...
  4. Flashpants

    GMS 2 DS List vs DS grid with embedded arrays

    Hello all Our game is based off of a 120x64 grid and we want to hold multiple variables of information for each grid square (what room type it is, what's on it etc). The information in the variables will have to be accessed every few seconds by 50-100 different objects, so needs to be as fast...
  5. Logan Bevans

    Error When trying to remove remove an item from a grid

    The Error Code is ___________________________________________ ############################################################################################ FATAL ERROR in action number 1 of Draw Event for object obj_smelteryGUI: draw_sprite argument 1 incorrect type (undefined) expecting a...
  6. A

    Grid based system - Nested grids and lists

    Hi everyone, I'm new here on the forums, but I have been reading a lot. Thank you for being such an helpful community. Please be patient, I'm not that much familiar with Gamemaker. I have been trying for a few days to figure out a grid system for an exploration/city building game prototype...
  7. Pfap

    mp grid instance not following path

    My instance always successfully draws the path, but sometimes won't follow it. It seems that it is getting stuck somehow. Grid creation code global.grid_m = mp_grid_create(0, 0, room_width / 8, room_height / 8, 8, 8); mp_grid_add_instances(global.grid_m, wall, false); The above debugs...
  8. N

    GML [GMS:2] [SOLVED] Weird issue regarding arrays and grids

    So, here's my situation: I have created an array to store details about the actions chosen by a player for a turn based combat system. An example of how this was done would be: actions[count,1] = 0; as you can see, the value of this particular array index is an integer, specifically 0...
  9. H

    Legacy GM How to code a grid system in 3D

    Hello! I am trying to make a grid system in GM 3D (similar to Minecraft), but to no success. How would I go about making this? Do the ds_grid functions even work in a three-dimensional space? Any help would be much appreciated!
  10. M

    Legacy GM record x,y positions in grid?

    I've read up on the grids in the game maker manual but I'm only vaguely grasping it. How would I go about adding an objects position in a grid then removing it when that position in the room changes?
  11. VacantShade

    Legacy GM Optimizing a Fluctuating Grid Algorithm

    Hey all! Currently I have a system I'm using for "fog of war" or "vision" in my game. Here is what it looks like: I have a "Vision Grid" where each cell holds a true or false value, stating whether or not it is visible to the player. This is updated only when needed, and is pretty much as...
  12. Pfap

    combining reals

    [SOLVED] I'm pulling values from a grid and then pushing them onto a stack to be pulled from later. I have 6 values and I'm trying to figure out if there's a way to combine them to form a pattern? a = 1 b = 2 c = 3 pattern = a+b+c I want to somehow end up with 123 and not 6. Or maybe a...
  13. Pfap

    Ds_grid clarification

    Do ds_grids always take up the full room? If I have a ds_grid with 4 cells would those four cells be equally sized with pixels throughout the room? or are the cells always 32x32 pixels?
  14. G

    GMS 2 Advice? Collisions with ds_grid vs. objects/tiles

    I'm working on a top-down, turn-based, grid-based game with procedurally generated levels. My next step will be coding a collision system. I seem to have two choices for collisions: (1) Ds_grid: When the actor wants to move in a direction, I can pull the data from the grid to figure out...
  15. zendraw

    Legacy GM Q: Grids

    Does it matter what the size of a grid is? Compared a grid 50x50 with a grid 1000x1000 cells and there was no change in the fps, it just took a while(like 2-3 sec) for the 1k grid to be created and filled(the code for filling is heavy and for testing atm). also is there somthing more one needs...
  16. P

    GML Grid/Inventory creating

    I want to make a system that creates a inventory this is what i hoped would work number = 0 variable = 0 counter_variable = number //counter_0 then becomes counter_1 when variable = 1 and sets first counter_0 = number then sets counter_1 = number then sets counter_2 = number and keeps going in...
  17. K

    problem with php and grids

    Hey, this is my first post on this forum. Iam making some prototype of turn based game, with some data save into database trought php files. I have some experience with php and data bases, so this isnt a issue here. Problem which i have is in GM. I post 2 jpg, screens from GM with scrpits from...
  18. ph101

    Legacy GM where do paths originate within cells on mp_grid_create

    Hi I'm having trouble generating paths that start from and end in the centre of a cell of my grid cell_width = 145; cell_height = 145; offset_w = 0; offset_h = 0; grid = mp_grid_create(offset_w, offset_h, room_width div cell_width, room_height div cell_height, cell_width, cell_height)...
  19. Ariak

     Pathfinding with TileMaps

    Hello! With the complete revamp to tiles I thought i'd have a look at a demo and see how to work with the new set of functions. I noticed the collision in the platformer-demo checked against an invisible tile layer with the tilemap_get functions. These functions return the number of a tile...
  20. L

    Legacy GM Inconsistent Instance Order

    The game takes place on a grid, and one of the objects is an arrow box. When activated, all arrow boxes in the room move one space to the right if there is a free space. The problem is, if the grid space to its right is occupied by another arrow box, it will behave differently depending on their...
Top