Stop dupliate images in export?

Get help using Construct 2

Post » Tue Sep 25, 2012 3:58 pm

Hi, my project is bloated with about 90% unnecessary duplicated images, and so is very slow to download when it should not be.

There seem to be 3 duplicate image problems:

1) A number of cloned images with different names and positions. There is only one actual png file. But for each clone, C2 has a dupliate identical image in the images folder. I would much prefer to use "copy" instead of clone, but then you cant give them different names or behaviors etc.

2) I have 5 animations. For each animations, i see one animation sheet, and one single frame of the animation for no apparent reason.

3) I have deleted a lot of objects from all my layouts, but they are still in the exported project (and still show up in the object picker). How do I purge these old ghosts?nutmix2012-09-25 15:59:13
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Wed Sep 26, 2012 9:48 pm

1. Why not just use instances of the same object?

2. Not sure what you mean here

3. You need to go to the place where you see 'sounds', 'object types', 'families', 'layouts', in folders, etc. Then, go in the 'object type' folder and delete the 'ghosts'.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu Sep 27, 2012 1:09 pm

THanks sqiddster. I would love to use instances of the same object instead of clone, but then you cant name them (if you name one instance, it renames them all. Also, I need to pin one instance to one object, and one instance to anther, and this is not possible as you only see one instance, not two, in the object picker for pin.

Pretty much all my duplicate images (they are just that) end up as cloned sprites. I experimented with using tiled backrounds to represent my dumb UI images, but these are limited in that you cant put them in families etc. I experimented with pining them to a 1px invisible sprite, and putting that sprite into the family, but it was just too complicated to maintain them all.

To be honest, I have found almost no cases where I can use copied instance of the same object, you almost always have to clone them so you can give them different names, or move them to different places etc. The only place I have ever used a copy is when i used it with instance variables, and then only need to operate on them in loops. But usually, you just want to grab a specific instance without the tediousness of looping through them all to find it (especially as the parameter of a function which requires you to pick an object form a list).
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Thu Sep 27, 2012 1:11 pm

[QUOTE=sqiddster]

3. You need to go to the place where you see 'sounds', 'object types', 'families', 'layouts', in folders, etc. Then, go in the 'object type' folder and delete the 'ghosts'.[/QUOTE]

I see this - thanks. Any idea how I see which ones are not used? There are literally hundreds of duplicates in there (struggle with cloning), and I don't see how I can search/see which ones are used or not.

Is my only option to save as project files, and use something like notepad to search each XML file for each object name?
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Thu Sep 27, 2012 1:53 pm

[quote]To be honest, I have found almost no cases where I can use copied instance of the same object, you almost always have to clone them so you can give them different names, or move them to different places etc. The only place I have ever used a copy is when i used it with instance variables, and then only need to operate on them in loops. But usually, you just want to grab a specific instance without the tediousness of looping through them all to find it (especially as the parameter of a function which requires you to pick an object form a list).[/quote]

Have you considered using an Instance Variable to give an instance a name instead of using named clones? You don't need to loop through all instances to find them, just check the variable as part of the condition.

Condition
MyObject -> Compare Instance Variable -> NameVar = WhateverYouNamedThisParticularInstance

Action
Whatever action you would have done to the clone, just apply to the object and it will only apply to the specific instance from the conditionOddConfection2012-09-27 13:55:29
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
27
S
7
G
4
Posts: 314
Reputation: 4,928

Post » Thu Sep 27, 2012 2:02 pm

@oddConfection thats a pretty good tip. Ill try and use that where possible.

Have you found a way of using PIN to object with this? I.e. I have 3 copies of a large backgroud image, and want to pin each to a different specific sprite. Currently, I have cloned the large backround image, which means huge download times. The image needs to move with the objects (I slide them in/out).
B
15
S
5
G
2
Posts: 357
Reputation: 3,691

Post » Thu Sep 27, 2012 2:17 pm

Here's an example capx

https://dl.dropbox.com/u/90589590/PinInstance.capx

I've got 5 instances of the Ball object, but pinned only one to a Player object based on it's instance variable. The Player object has the Platform behaviour.
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
27
S
7
G
4
Posts: 314
Reputation: 4,928

Post » Thu Sep 27, 2012 5:28 pm

That's pretty useful- I didn't know you could do that, thanks!

Shame its not easier - i.e. to be able to rename copied objects would be more logical.
B
15
S
5
G
2
Posts: 357
Reputation: 3,691


Return to How do I....?

Who is online

Users browsing this forum: imothep85, tatogame and 21 guests