arrays

  1. J

    [SOLVED] Can function argument be compared to array element?

    I have a 2D array that I'm searching using a function. The array: global.list_rooms_bot_bomp[0,0] = rm_Level4; global.list_rooms_bot_bomp[0,1] = 1; global.list_rooms_bot_bomp[1,0] = rm_Level5; global.list_rooms_bot_bomp[1,1] = 2; etc. ... The function takes room and returns the corresponding...
  2. B

    Legacy GM Enemy AI, if/then or Arrays (or something else)?

    edit: modified title to reflect forum rules Hey everyone, long time lurker first time poster... I've been playing around with GM for a month or so, and have built a basic top down project, to learn the ropes. What I'm looking for a bit of feedback at some of my code regarding NPC/enemy...
  3. phillipPbor

    Legacy GM card RPG

    I need to know, arrays, I think I like to make an 3D RPG for square enix, "CardCraft" a yu-gi-oh based turn based RPG game. you had to ether create your player as a guest with savings (story mode), or an account to play with friends (online). so you can play as your OC (human, bionicle, furry...
  4. Fixer90

    Quick Question About Arrays

    So let's say I have a basic array: example_variable[0] = whatever_1 example_variable[1] = whatever_2 example_variable[2] = whatever_3 My question is, can I use zeroes before the first digit? example_variable[000] = whatever_1 example_variable[001] = whatever_2 example_variable[002] = whatever_3
  5. Joe Ellis

    Legacy GM Are buffers faster than arrays?

    Hi all, I know that arrays are a bit faster than ds_lists, but are buffers faster than arrays? I know how to use buffers, I'm just wondering if its worth converting all my array stuff to buffers at the end of my development to get optimal performance.
  6. Posho

    Legacy GM [Solved] Issues with INI Files

    I'm working on save data. But I'm having some errors I don't understand. I'm trying to save an array into an INI file using this method. Game Start if file_exists("save.ini") { ini_open("save.ini") global.array["1"] = ini_read_real("Array", "1", false) global.array["2"]...
  7. C

    [Solved] Arrays in Game Maker 8.0

    Hey guys, Ctl-F here So here's my problem: I have been making a script bundle to add functionality to Game Maker and one of my core purposes is to make it compatible with all versions of Game Maker from version 8.0 and onward. I have spent several days working on this script bundle making sure...
  8. D

    Legacy GM [SOLVED] 'Else' in a For loop

    Hi all, I've got a create event with a bunch of words in an array set up like so, word[0] = "this"; word[1] = "is"; word[2] = "an"; word[3] = "example"; ... and the idea is that when I type a word in to a box, it checks through the array to see if it exists. Currently I have the loop as...
  9. YellowAfterlife

    Discussion "lightweight" instances

    I recall that this was brought up during 1.x timeframe but put off, so it might be a good time to bring this up again - it would be pretty nice to have separate object-like value type with convenient dot access. Essentially, so that you could do, say, var curvePoint = instance_create_empty()...
  10. W

    Problem indexating arrays in create!

    Hey guys, im new in the program, and i´ve read a lot of the previews "trying to index a variable which is not an array", but none helped me :( I have only 1 room 1 object with different animations and stances and 1 script for walking Object Create event code //global variable countStances = 0...
  11. J

    Legacy GM Help with weapon inventory system

    Hi, i have some trouble doing an inventory system for a top down shooter. I watched some tutorials and posts/threads and i can't find one with what i need. My idea is separate the inventory in primary, secondary, melee and special(Like Counter Strike). I know it's a way with arrays but idk how...
  12. Xer0botXer0

    Question - Code Still only 2D arrays ?

    Hi guys, I haven't gotten around to using my beta key, I'd like to find out if gms 2.0 still only has 2D arrays ?
  13. sercan

    Generating random arrays from a certain group

    Hi, I wonder if there is a simple way to generate random arrays from a group of numbers. For example I have 0,1,2,3,4,5 and want to determine indexes from those numbers randomly. I want to create arrays like this: array[0]= 3; array[1]=0; array[2]=1; array[3]=4; array[4]=5; array[5]=2; or...
  14. S

    Legacy GM Confused by arrays, specifically the way Tom Francis does them

    This is long, sorry. Also, as a heads up, I'm completely new to programming (dabbling in HTML and CSS doesn't really count). I've been following Tom Francis' "Make a Game" youtube series, and have been enjoying it so far. Unfortunately I'm currently a bit stuck with arrays. Here's the video in...
  15. R

    Legacy GM ds_list is an improved array?

    tldr; Are there any benefits using 1d arrays over ds_lists? I came across an old page describing array functions that aren't listed in the manual. While array_set still seems to work, array_destroy doesn't anymore. So I figured arrays are basicly a data_structure too. I'm using array_length_1d...
  16. K

    Legacy GM Generate Instance at Specific Tile Script

    So I have been making my game when I realise how tiresome it is to place my "wall" objects, then I thought, is it possible to create a script to run when the room is generated that it will check the index of the tileset (like the walls are [0,0] and floors are [0,1]) and have it create obj_wall...
  17. F

    Legacy GM How to parse data from text file?

    Hello I'm lost, trying few methods but no progress, I read manual and threads here, but.... Here sample code. This is saved ds_map and json_encode from this map is like this.: { "0": [ [ 1.000000, 128.000000, 160.000000, "obj_man" ], [ 2.000000, 224.000000, 128.000000, "obj_man" ], [...
  18. D

    Legacy GM Once again too stupid for arrays...

    Hi community, i´m trying something i thought would be simple: if (argument0 < gMax_Length_Per_Scriptfile) { if (argument2 == true) // overwrite line { gSCRIPTFILE_ARR[argument0] = argument1; } else { // insert line for (cnt=0; cnt<argument0; cnt++) {...
  19. W

    [SOLVED]FOR loop problem in drawing event

    Hi, I'm having a horrible time trying to get this FOR loop to work correctly, I will explain it first. What it's supposed to do: takes segments from an image and draws them in order 1 time to make a complete new image while background_showcolour=false, then a picture is taken of the image...
  20. D

    I'm trying to understand arrays

Top