GameMaker: Studio

GameMaker: Studio

Vis statistikk:
Insygnia 25. des. 2017 kl. 9.30
How to use 2D array in script
when i make

var1=array[0,1] //IN AN OBJECT

it gives an error because it says i am trying to refer to a non-existant array eventhough I have a script with the array
Sist redigert av Insygnia; 26. des. 2017 kl. 4.22
< >
Viser 12 av 2 kommentarer
MrDave 25. des. 2017 kl. 10.15 
You can’t access any variable before you have declared it atleast once (otherwise the computer doesn’t know what value it should have)

If you are trying to read it in the script the error means you need to set it before you read it.

If you are trying to ready it in an object you can use: return array; in the script to pass the variable back to the object. This works with 2D arrays.
Insygnia 25. des. 2017 kl. 10.23 
Opprinnelig skrevet av MrDave:
You can’t access any variable before you have declared it atleast once (otherwise the computer doesn’t know what value it should have)

If you are trying to read it in the script the error means you need to set it before you read it.

If you are trying to ready it in an object you can use: return array; in the script to pass the variable back to the object. This works with 2D arrays.


to specify, this is on an object
< >
Viser 12 av 2 kommentarer
Per side: 1530 50

Dato lagt ut: 25. des. 2017 kl. 9.30
Innlegg: 2