Sprite object disappeared, not accessible

For questions about using Classic.

Post » Sun Nov 24, 2013 10:36 am

Hi again,

an object has vanished from my layout. The code is still there, its still in a subfolder in the project explorer. Its neither visible in the layout editor nor the object explorer.
"Create object" will not spawn it and any code related to that object is not executed.

So far I tried to:

-drag and drop from the project explorer onto the layout. Guess thats not meant to work.

-Move the object into another subfolder
-Sort the object folder from a-z, switch from small icons to list, vice versa
-Try to place the object in another layout.

That didnt do the trick yet. I guess something went wrong with the caps internal object index, or the thing that references it in the object explorer.

Any chance to repair the CAP, or do I have to live with a phantom object and build a new one in the same vain, then adjust the existing code for that object?

Luckily it was not too heavy animation-wise.

Cheers,
the Colonel
Image
B
17
S
5
G
1
Posts: 122
Reputation: 1,930

Post » Sun Nov 24, 2013 11:30 am

PM me the cap file I'll see if I can repair it. I made a python library called capreader that reads cap files and it can be used to debug them.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Mon Nov 25, 2013 5:31 pm

Copying the object from a backup cap into the most recent one actually did the trick.

Thanks though for the offer!
Image
B
17
S
5
G
1
Posts: 122
Reputation: 1,930

Post » Mon Nov 25, 2013 9:50 pm

Ok. In the past I've seen the bug where adding another object removes another and I was able to make a utility to fix it although I'm not sure of the original cause. My hunch is it may be related to copy/pasting between caps in some situations.

Anyway here's the utility I made to fix the issue:
http://www.scirra.com/forum/utility-python-cap-reader_topic42039_post260632.html#260632

On the technical side the cap file keeps track of what id will be used next for object types, object instances, effects, behaviors, and family effects and behaviors. The issue arises when this value is the same as an existing id so when something new is added two things will have the same id and undefined things happen. All the utility does is check all things that have an id and find the highest value, adds one to that and writes it back to a copy of the cap.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756

Post » Tue Nov 26, 2013 5:46 pm

Thanks, that may come in handy at some point in the future, as Im yet not done inserting new objects.
Does it handle R2 caps, or are there significant changes in the format between 0.99.97 and R2?

If not, my excuses for such a blatant display of n00bness [
Image
B
17
S
5
G
1
Posts: 122
Reputation: 1,930

Post » Tue Nov 26, 2013 6:33 pm

The cap file format hasn't changed since 0.99.96, so anything newer than that will work.
B
91
S
31
G
103
Posts: 5,235
Reputation: 67,756


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest