[PLUGIN] Sprite Bank

Post your completed addons to share with the community

Post » Wed Feb 22, 2012 10:32 am

@vtrix

I don't really get your problem, sorry. Maybe I misunderstand the steps.

Executing "Action:Save instances" twice (or more) continued means adding the same object(s) into bank, you can call "Action:Clean bank" to avoid duplicating.
I had try to recognize if instances were saved in sprite-bank, I found an easy way is to clean all and save them again.rexrainbow2012-02-22 10:32:49
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Wed Feb 22, 2012 10:35 am

Update:
Fix text mistake, thank you @vtrix.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Wed Feb 22, 2012 3:42 pm

im sorry i wasnt clear enough, i mean,

i have 2 "s" functions 1 enabled other disabled
now when executing the save works,

when you then disable the working "s" function en enable the other "s" function it doesnt work, the only difference is that its a save with callback, (under: advance:sprite)

so i think theres some error in it or something
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Thu Feb 23, 2012 12:22 pm

@vtrix

I test these two save functions
[code]+ Keyboard: On S pressed[/code]
They all work fine in my computer.
Sorry, I still can not reproduce your problem.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Sat Feb 25, 2012 2:31 pm

did you tried loading the saved objects after each save? with the second save function it doesnt load the objects,
i was only guessing the bug was in save function
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Feb 26, 2012 12:30 am

@vtrix

Strange... I press "S" -> "D" -> "L" -> "S" -> "D" -> "L" ... many times, each "L" (load) seems load instances well.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Sun Feb 26, 2012 6:21 am

i made a simple test, this one doesnt work for me,

two strange things, the destroy action on the callback only destroys one instance, should destroy all

+ none of the instances can be loaded back...


simpletest
ImageImage
B
61
S
19
G
6
Posts: 809
Reputation: 9,028

Post » Sun Feb 26, 2012 7:03 am

@vtrix

Uh. The callback is used to get custom data of "each" instance.

Since sprite bank only can save general properties like "x","y","width","height",..etc. Other properties, for example, "speed" in bullet behavior can not be saved automatically.
When saving instances, each instance will trigger this function (callback) defined in action. User can put this instance's custom data to return[name]. For example, put speed into return["spd"].
Then, when loading instances, each instance will trigger callback function, and put previous saved data (return[name]) to prame(name) by plugin automatically. For example, you can get speed from param("spd")

It looks like passing something from save to load for each instance.
[code]return[name] --> prame(name)[/code]

See the example in first thread.


If you save 5 instances, callback will be triggered 5 times for each instance. That why "the callback only destroys one instance". And the sprite bank is been cleaned in callback when saving.rexrainbow2012-02-26 07:08:13
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Thu Mar 15, 2012 1:04 am

Hey Rex, great plugin. Only one improvement I can think of - also saving the z-order of the sprites. Would that be possible to add?
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Thu Mar 15, 2012 3:20 am

@Arima

I will try when I have time.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests