[Plugin] instance bank2

Post your completed addons to share with the community

Post » Wed Mar 06, 2013 3:16 pm

This is a sampe capx to save & load specific instance to/from instance bank.

There are 3 sprites in this capx with different private variable "i".
1. save each instance into an empty instance bank, then save the content of instance bank (JSON string) into dictionary. (replace dictionary to webstorage if required)

2. destroy all sprites

3. load content from dictionary into instance bank then load all sprites
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Thu Mar 07, 2013 12:08 am

Update:

Fix bug at clean bank. Thanks for @Joannesalfa 's notification.

Now previous sample will save one instance directly.
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Thu Mar 07, 2013 12:33 am

@rexrainbow Thank you! :) finally, it's great plugin to manage the instances to keep logic performance.
B
96
S
25
G
20
Posts: 3,053
Reputation: 22,640

Post » Thu Mar 07, 2013 7:39 pm

Hi rexrainbow!

I have a issue.


As sprites spawn on screen a event saves all instances of that sprite into the instancebank.
Then i destroy the sprites by clicking on them.
Then i press load, and the sprites are loaded from the bank and appear on screen again.

Because of the event that says to save when i spawn the sprites, it creates doubles.
So i added a extra action when i press load, to first clean the instance bank, then wait a second then save all instances.

But it seems like the instancebank is not cleaning.
Because i stil get doubles.

Strange...
Do u have a sollution?
Kind Regards.
Savvy001Savvy0012013-03-07 19:41:26
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Thu Mar 07, 2013 8:16 pm

Update.

I cheated the plugin a bit to make it work.
I added another instance bank which i left empty.
Then to clean the first instance bank i load a json from the second instance bank.
Which is empty

Now i dont have doubles with the above explained issue.

Kind Regards.
Savvy001 Savvy0012013-03-07 20:17:00
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Thu Mar 07, 2013 11:55 pm


Hi, can't DL the example files, server problem ?

thx
B
17
S
7
Posts: 147
Reputation: 2,572

Post » Fri Mar 08, 2013 7:35 am

@Savvy001

"the instancebank is not cleaning" , yes, it is a bug I had fixed. You might download this plugin again.
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Fri Mar 08, 2013 2:08 pm

Thanx rexrainbow!

Just downloaded, i indeed had the old version.

Kind regards.
Savvy001
B
56
S
20
G
13
Posts: 778
Reputation: 13,204

Post » Fri Mar 08, 2013 3:00 pm

@Savvy001

Sorry, my bad.
B
97
S
22
G
177
Posts: 4,113
Reputation: 103,531

Post » Fri Mar 08, 2013 9:37 pm

Hi Rex,
First off, great job on your plugins, you made some really amazing tools!
I am using Instance Bank, to save and load my levels out of a big layout, it works good on everything except for moving platforms with sine behavior, i have some platforms with different 'Sine period offset' value, to sync their movement, when i reload these instances their movement is out of sync, i can bypass this problem by adding another var with this value, i just wondered if you are aware of this problem and if it is something you might consider fixing.
Image
B
59
S
21
G
11
Posts: 480
Reputation: 10,714

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: Sobieski74 and 1 guest