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 / Array Group Help

Author
Message
TamBam
12
Years of Service
User Offline
Joined: 29th Nov 2011
Location: India
Posted: 12th Jul 2021 06:06
In AppGameKit Studio if I use 4 sprite character and add in a array group its take 0 1 2 3 as they created .
Now if some reason I delete 2nd chr which is array 1 and I create new character and I want I work as same as that chr which I delete . but in this time the new sprite takes array 3 and the 2nd number array shift to array 1 and 3rd array shift to array 2nd .
any solution ?



in this pic I replace 3nd pic from bottom which was array 2 but after replace top 4th chr takes array 2 and 3rd replaced chr take array 3rd . what is solution .

Attachments

Login to view attachments
hosch
Developer
2
Years of Service
User Offline
Joined: 25th May 2021
Location:
Posted: 12th Jul 2021 10:30
How do you remove the character? If you use the array function array.remove this is expected behaviour. You could however use array.insert(value, index) to address/manipulate a specific sprite in your array.

You can do awesome things with arrays in AGK.
https://www.appgamekit.com/documentation/guides/12_array_changes.htm
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 12th Jul 2021 16:31
@TamBam

The "assign array" button seems to have a mind of its own sometimes, it adds sprites in an odd order and I have found it to be somewhat unreliable, try clearing the array and reassign the sprites or change the array name, you can edit it manually, close AppGameKit and open the scene file in NPP and scroll to the bottom, there is all the data AppGameKit used to build the code for the scene file, edit, save repoen AppGameKit and the changes will take effect, be careful tho as its really easy to mess the file up.

Login to post a reply

Server time is: 2024-03-28 11:36:39
Your offset time is: 2024-03-28 11:36:39