Jump to content

Help with Arrays


Sir_Skurpsalot

Recommended Posts

Having trouble using arrays like you do in other engines.... the documentation only seems to show how to declare and access specific indexes.

trying to use any of the array methods on this page https://torque-3d.readthedocs.io/en/latest/script/class/ArrayObject.html

gets me an "Unable to find object: ''" warning.

How would I declare an array, and then use one of the functions on that page?

I would like to be able to do something like this:

%testArray = [2,1,6];

%testArray.sortD();

%testArray.echo();

and have it show [6,2,1]

But things don't seem to work like that.

Link to comment
Share on other sites

So I figured some things out... there are both arrays and then ArrayObjects in Torque.

arrays you can't really do much with except loop through I suppose. ArrayObjects which are declared like %testArray = new ArrayObject(); can use all those functions from the link I posted earlier.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...