arrays

  1. Veemonic

    GMS 2.3+ Vagante inspired inventory

    GM Version: Studio 2 Target Platform: Windows Download: see below Links: n/a Summary: Hello, i decided to share my inventory ive done "inspired" by vagante (if you dont know vagante, its a good game too you should try it) the inventory is small sweet and simple, ill be only focusing on the...
  2. I

    FIXED - Array/Grid problem - array_set changing values for all arrays in the grid

    Hi, I'm having some trouble with randomizing the first entry in an array which is stored in a grid. I think I've setup the grid and list correctly and have tried to run some code in the room start event to randomize the values in a for loop. The 3x2 grid has an array in each cell and the first...
  3. L

    Legacy GM [RESOLVED] HELP with Playlist of audio/songs

    Something simple that I need but having trouble to implement it. So in my project I have this button, when the button is pressed with the mouse I want audio to start playing and when that audio is finished it would move to the next audio file in line. And when the entire playlist is finished I...
  4. P

    GMS 2.3+ Array not set before reading (Bug?)

    Hi GMC! I have a question about arrays that I'm not getting and I think it's best explained with a demonstration. Consider the following code in the Create Event of a newly created object called objArrayTester: //Example #1 function addOne(array) { array[0] += 1; } a = array_create(1, 0)...
  5. FoxyOfJungle

    GML Search Items In An Array (for inventory)

    GM Version: GMS 2+ Target Platform: ALL Download: N/A Links: N/A Language: GML Summary: Search for items in an array. I write a string, and it will find all items matching the search. Tutorial: Do you want to make an inventory or a list of some store/shop or a highscore list and want to...
  6. L

    Arrays to draw Text

    Hello everyone, I am currently working on a Point and Click Adventure in GM2. As I am still new to GML I am having quite a few problems with the coding language. Some of you might know, that clicking on an item usually triggers a text in Point and Clicks. At the moment I coded it this way: The...
  7. FoxyOfJungle

    SOLVED How to get many values from 3d array? (or multi?)

    Hello! First time trying to use 3D arrays, it may seem a little stupid but you learn by making mistakes. šŸ˜… I have this situation: array[0][spr_sprite][2] = "Text 1"; // [index] [sprite] [sprite_subimage] = "Text"; array[1][spr_sprite][3] = "Text 2"; array[2][spr_sprite][4] = "Text 3"...
  8. If Programable_Matter

    Finding the Sum of an Array in the Step event

    I've tried to find the sum of an array by using the following code CREATE EVENT for loop...... value[1] = 1 value[2] = 1 all the way to value[40] and every single one is worth the value one STEP EVENT for i=1; i<=40; i++) { global.sum = global.sum + value } The problem is (like expected) it...
  9. gnysek

    GMS 2.3+ Accessors - how to remember their symbols, how to use them

    GM Version: 2.3+ Target Platform: ALL Download: N/A Links: N/A Summary: GameMaker Studio have several accessors, which are shorter way to read data from data structures and structs. Tutorial: In GameMaker Studio, we have several data types, which can be read in alternative - shorter - way...
  10. EvanSki

    SOLVED (Solved in 2.3.1) Need help on how to unpack an array to use as arguments in a function

    This is a job for big brains, mine is smooth so that is why me is ask for the big helps. Heres the walkthrough I get a script name and arguments for that script like so [scr_scriptname] [argument_array_here] The first set of brackets hold the script name in a string that is converted to the...
  11. T

    GMS 2.3+ Trying to copy RPG-stats from one array to another... help?

    Hello! I'm not always the best at wording things, so I apologize if this gets confusing. I've been reworking the battle system for my turn-based RPG, so that I can easily change the stats and appearance of different types of enemies. The way I've been trying to implement this is by storing all...
  12. 2

    Most CPU Efficient/Fastest Method for Recording 1000s of Instances to "Grid"

    I'm planning on making a spawning/despawning system. Because the initial data grab is likely increase lag/load time to start the level I need to know the fastest way of grabbing whether a desired object (or it's child) is at grid intervals and 4-5 of it's user made variables. The lists must be...
  13. P

    GMS 2.3+ What is the best data_structure to store Tile Info?

    Hello everybody, I have previously make a thread asking wheter structures(GMS 2.3) are good for storing info about tiles, and even without receiving a positive answer I decided to use them in the Level Editor to test before implementing in new Games. But now when I am done with Level Editor and...
  14. mcglubski

    GMS 2 Array for Collisions HELP! [SOLVED]

    Can someone help me simplify this into an array or something else? Even with years of experience with GMS I still struggle to understand simple arrays, especially after coming back to it since buying GMS2. I feel like this should be easy but everything I try doesn't work. If someone could...
  15. H

    GMS 2 Problem With Array list of weapons

    Hi, i have a problem with my weapons arrays. When i want to shot, my weapon ammo change from 5 to 4 and back to 5, then i can't shot anymore, when i change my weapon to a Bow, reload (auto reload) cant be completed and start over an over. When i reload, my ammo is subtraction from EQ but Weapon...
  16. flyinian

    SOLVED Receiving "unable to convert string to int64" error.

    I'm getting the error, "unable to convert string "Count 2" to int64" when I run the below code. I'm just learning arrays so, I don't fully understand how they operate yet. I am trying to create an array that checks to see if all the items in the array returns all zeros or not. var array...
  17. aristhemage

    SOLVED Saving and Loading Arrays (please dont 'dont use arrays, use ds_map' copy pasta me)

    Hi, I know, I know, don't use arrays to save, use maps. But the tutorials and help are all implying that the variable that stores the array isn't the core functionality of the game. I'm making a sandbox game and the way I have it is that there is a variable called world, an array worth about ten...
  18. 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...
  19. 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...
  20. 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...
Top