Here's a basic .proto I'm currently using:

package levelFormat;

message vec3
{
    optional float x = 1;
    optional float y = 2;
    optional float z = 3;
}

message quat
{
    optional float x = 1;
    optional float y = 2;
    optional float z = 3;
    optional float w = 4;
}

message entity
{
    optional string type = 1;
    optional string name = 2;
    //! BUG
    // attribute #3 fails to save/load
    optional string script = 4;
    optional vec3 position = 5;
    optional quat rotation = 6;
    optional vec3 scale = 7;
}

message level
{
    repeated entity entities = 1;
}

Notice how I skip attribute #3 - if I used attribute #3, it would fail
to load.  Meaning, if I used has_script(), it would return false (even
though I clearly saved it via set_script("blah") previously).  I
previously had the same trouble with the type/name of the entity
message, but it seems I've found some magic combination of attribute
numbers that currently work.

I tried to update my "level format" by abstracting some things away -
for example, script/position/rotation/scale go in their own message,
which is an optional field of the entity message.  However, after
saving 2 entities in level::entities, the script fails to load (again,
has_script()).  I cannot quite figure out what is going wrong... any
ideas?

PS. is there a reason the compiler turns camelCaseFields into
noncamelcasefields, but messageNamesAreStillPreservedWithCamelCase?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to