Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / [SOLVED] How can this be done in AGK Studio

Author
Message
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 8th Apr 2019 07:25
I try to assign an array value to another array.
With AGKS we can create array groups, and to get the value we can use


Any ideas
THanks

The author of this post has marked a post as an answer.

Go to answer

Amon
9
Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 8th Apr 2019 07:48
Imaginations' greatest gift is the knowledge you supply it.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 8th Apr 2019 07:52 Edited at: 8th Apr 2019 07:53
You can just say
MyArray2 = MyArray1
Amon
9
Years of Service
User Offline
Joined: 30th May 2014
Location: Shropshire, United Kingdom
Posted: 8th Apr 2019 07:54
Wow. I didn't know it could be done like that. That's a shortcut and a half.
Imaginations' greatest gift is the knowledge you supply it.
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 8th Apr 2019 08:06
Thanks @Imagination Engineer

Your Idea will work.,
Unfortunate the myarray2 = mayarray1 dont work for me...
Index out of bounds, array emprty Error
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 8th Apr 2019 08:56 Edited at: 8th Apr 2019 08:58
Hi Guys

Thanks for the advice.
But I don't want to fill myarray2 with the values from myarray1

I just need to know the "size" of myarray1 and then make myarray2 the same size (Programmatically)

Currently I look in my.scene file, and see that myarray1 is 286 (For example)

So i my main.agk I want to make myarray2 the same "size" as myarray1. myarray2 will hold different values than myarray1.
Currently I do it manual
eg:
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 8th Apr 2019 09:11 Edited at: 8th Apr 2019 09:13
That was answered in the first post by Imagination Engineer.
To repeat what he said, do this:
DannyD
6
Years of Service
User Offline
Joined: 29th Aug 2017
Location:
Posted: 8th Apr 2019 09:46
This post has been marked by the post author as the answer.
Thanks Scraggle
Miss that part. Working Fine now
Cheers

Login to post a reply

Server time is: 2024-04-18 07:19:01
Your offset time is: 2024-04-18 07:19:01