Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411512 Posts in 69376 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 05:28:00 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Creating an array during the game [maybe solved?]
Pages: [1]
Print
Author Topic: Creating an array during the game [maybe solved?]  (Read 718 times)
sheep herd
Guest
« on: January 31, 2018, 05:04:32 AM »

I'm using gm:s and gml. I'm fairly familiar with both and I've tried google but to no avail.

I want to be able to create a 1d array full of nested 1d arrays but I want the container array to be of variable length.

In my project there is going to be a timeline and each point on the timeline needs to have a list of x and y coordinates (as well as another list of boolean variable) however the length of the timeline will be based on a variable which can be altered in game. Is there a way that I can make it so that the container array is filled with nested arrays based on the timeline length variable?

I am currently using 3 1d arrays (1 for X coordiante, 1 for Y and 1 for bool) and want to have 3 container arrays for each of them. edit: I now realize I only need 1 array that can hold all three pieces of information/

Thanks
« Last Edit: February 01, 2018, 02:44:24 AM by sheep herd » Logged
ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #1 on: January 31, 2018, 07:11:51 AM »

Hi!

I assume that this is a GameMaker question due to the icon of the thread, but unfortunately, that's not enough information for me to be able to help you.

First off, which version of GameMaker are you running, GameMaker: Studio or GameMaker Studio 2? Or an even older version? Are you using drag-and-drop or are you coding in GML?

Secondly, what have you tried? What situation in your game requires you to create a variable or an array dynamically? Have you tried to search for an answer on Google or on the GameMaker forums?

If you provide this information, then someone'll be able to help you.

Cheers!
Logged

sheep herd
Guest
« Reply #2 on: January 31, 2018, 07:33:57 AM »


If you provide this information, then someone'll be able to help you.


ok, thanks and my bad. I'll update the first post.


Logged
sheep herd
Guest
« Reply #3 on: February 01, 2018, 02:43:59 AM »

wait a minute! a 2d array is functionally the same as a 1d array full of nested 1d arrays, right? I'm an idiot
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic