Game Development Community

Experiencing problems with default schema

by Will O-Reagan · in Torque X 2D · 07/15/2007 (1:52 pm) · 3 replies

[TorqueXmlSchemaType(DefaultValue = "true")]
        public bool Active
        {
            get { return _active; }
            set { _active = value; }
        }

Note sure if this is a known issue or not, but having a component thats been working for awhile, I tried adding this public property to it and the default schema didn't apply properly. This is the second time I've tried to deploy an new public variable with an xml schema attached, and its gone bunk on me. The errors been pretty easy to fix, I just click and unclick the true/false in the editor.

About the author

I have a degree in dramatic art, and literature, from UC Santa Barbara. I've worked for a few studios, also at Animax Ent in 2008, and some smaller studios. Currently studying Computer Science at CSU Channel Islands.


#1
07/19/2007 (7:40 pm)
Could you be more specific about exactly what's happening?
Is it not applying the default value in TXB when you create a new component of that type?
#2
07/19/2007 (11:03 pm)
No. These are objects and components which are ALREADY in the editor and APPLIED to scene objects. I'm then trying to accomplish two things.

1. Add a new public property

2. Have the default schema value applied, so that it automatically takes for true on each object, saving me the time of hunting down each object in the scene.


The bug appears to change all the values, for objects which already have the component, but in the txscene file, the new property is false, unless i then "uncheck" and "check" each component.
#3
07/26/2007 (3:45 pm)
When you say "uncheck" and "check" each component, do you mean each property?

That does seem pretty wierd... so if you add a new property to an existing component, reload your component schema, then it appears with the new property with its correct default value, but then if you save the level it appears with the wrong default value in the xml file? What if you then reopen the file?