• Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!

arrays

  1. Octopus_Tophat

    Am I doing this "arrays of arrays" correctly?

    So I have a script that returns an array of arrays. Not a 2D array, but specifically 2 separate arrays. My reason for doing this is a bit tricky to explain. It's for inventory management. Basically I am building this array with the script, and then looping through a list of instances, and...
  2. S

    GMS 2 2 arrays with the same index?

    My game is pretty complex and would be probably confusing to people who aren't me, but I don't think I need to show much of everything else to bring up a bizarre bug that happened. This is the relevant code; cgv1 gets the variable for an array that stores information about a "skill" There are...
  3. P

    Passing 2 argument with one DS

    Hello Everybody! Im new to Gamemaker 2 so and programming at all so i dont know if there was a way to pass 2 arguments in function with ONE data structure(of any type). I mean imagine for example that you have to create an object with fixed X and Y coordinates that are always same, but is there...
  4. MaxLos

    Legacy GM [Solved] Check if sprite index is equal to one of many array values

    So.. I'm working on a platformer/fighter and I have my attacks for my characters set up like this: //Create Event basiccombo[1,0] = spr_attack_1; //Sprite basiccombo[1,1] = 4; //Frame to chain into next attack basiccombo[2,0] = spr_attack_2; basiccombo[2,1] = 3; basiccombo[3,0] =...
  5. oturtmurr

    GMS 2 Trio Partner System - Switching Positions w/ Arrays & Warping Rooms

    Hello GMC! I’m working on a project dealing with a partner following system with 3 objects. It has 1 leader, and 2 followers. These 3 individual objects are persistent, and are stored in arrays that allow me to change who’s who. In this system, they are able to switch roles, just like in the...
  6. Drago the Shinigami

    GMS 2 [SOLVED] Array Trouble

    Hello, I'm currently working on a script to determine turn order for a turn-based battle system. Unfortunately, I keep getting the same error message, and I can't see how it's happening. Here's the code for the script: global.BattleOrder = 0 var templist =...
  7. iChunkiMunki

    Are you tired of pointers left in your duplicated arrays?

    Hey guys, often when you are making a complex game we use arrays like objects holding many different variable types and even arrays. Sometimes we have arrays nested in arrays, nested in another array, ..... nested in yet another array. Is there a limit to how deep the rabbit hole goes? I often...
  8. Annoyed Grunt

    GMS 2 Is the array reference accessor supposed to be used outside of scripts?

    For the longest time, I believed that the array reference accessor "@" would only work inside of scripts and would be useless outside of them. After reading around and doing some personal testing, it seems however that the behaviour described for scripts - arrays are passed as references in the...
  9. 2

    GMS 2 Copy Each Tile in Tilemaps and Produce Copy Maps Later

    I need to collect data on what each tile is in tilemaps in order to remake the tilemaps later and perform a few operations on them. I also need to do this for how many ever tilemaps are in a room. Given that I have the data on which tilemaps exist in the room how do I store what each tile is...
  10. Frisk17

    GML How, when and where to use arrays and lists

    GM Version: GMS2 Target Platforms: ALL Download: N/A Links: N/A Summary: This is a GMS2 tutorial explaining first of all how to use arrays and DS lists for beginners. Followed by where and when to use 'em. Tutorial:
  11. E

    GML Cool program that lets you track points on your sprite, and also im a noob!

    hey all, i came accross this program called thundertracker that lets you track points in your sprite and turn that data into arrays i wanna use this to for a customization system (hats and helmets etc) in my game but i dont really understand the explanation they gave :c , and googling hasnt...
  12. Heavybrush

    GML [SOLVED] triple parallax starfield

    Hi guys, I have a new project, and I would like to figure out how to make a triple parallax starfield for now i made this: start event /// @description create starfield //inputs starField = 3; starDepth[0] = 100; starDepth[1] = 110; starDepth[2] = 120; stars = 0; maxStars = 1000; spd[0] =...
  13. L

    GML [SOLVED] Pseudo Room Problem - Space Game

    Hello all, this is my first post so apologies if this is in the wrong place or badly formatted. In my game, you fly a spaceship. This spaceship has multiple levels, but the ship as a whole stays in the same room (so your position in space and other objects in space don't change). I have sprites...
  14. R

    *SOLVED*mutli-switch locked door, need pointers!

    EDIT: FOR CLARIFICATION: IM USING GAME MAKER 1.4 PRO Hey all! Im making a re-imagining for a beloved PS1/Sega Saturn/3DO classic, "CASPER", and I have most everything figured out and working already (Item pickups, health, teleporting, basic switch and door functions, chests, locked key doors...
  15. aelyrin

    GML [SOLVED] Quick Array Issue...

    I feel like this should be pretty easy for most people to solve, but I can't seem to find an answer. I've searched through the manual and the forum to no avail, so I'm giving in and posting this. I keep getting "Assignment operator expected" and "malformed assignment statement." On the lines...
  16. FacesOfMu

    Accessing nested array variables

    Hi there, I'm looking for some guidance on how to access a variable that is nested in a 1d array of 1d arrays. I've run the following tests: arr = []; show_debug_message("\nTest 1: Print out this nested array"); arr[0] = ["a", "b", "c"]; arr[1] = ["1", "2", "3"]; show_debug_message("1...
  17. Pfap

    variable argument scripts

    I have been over the manual sections about scripts and passing arrays to scripts. Maybe I missed something, but I'm making this posting not because I'm having trouble finding a solution I already know of several work arounds. I'm making this posting, because I want to finally figure out how to...
  18. Gresse

    Windows Save data

    Hey I created a game in which the player has the option to play a mission (he has to reach a specific height with a limited amount of fuel(and other variables)) so because I don't have the time to manualy test all combinations of the settings and what height is possioble with them and all write...
  19. B

    Windows Arrays for RPG stats for each level?

    Hello, I am interested in making an array for each of my 4 RPG party characters to determine their stats. The array should go from level 1 to level 99, and use a calculation to determine the MAX HP, ATTACK, and MAGIC statistics for each level. For example, maybe they all raise by a flat value...
  20. ConstaChymic

    Discussion Strange array accessor behavior

    I think that how arrays are done in Studio 2's GML need some work, they act very odd (at least when compared to other languages), and I think the biggest tweak they need is to the fact that you can only use array accessors after a variable name, and pretty much nowhere else (to my knowledge)...
Top