Components in the Torque Combat Demo
by Shiraz · in Torque X 2D · 02/25/2007 (9:43 pm) · 6 replies
The Torque Combat demo doesn't have a componentSpecs.ed.cs file yet its components work. How's that possible?
About the author
#2
PlayerCollisionComponent pcol = new PlayerCollisionComponent();
player.Components.AddComponent(pcol);
the weird thing is when I tried to create a componentSpecs.ed.cs to add my own components it wouldn't compile.
02/25/2007 (10:03 pm)
Yeah, I just found the code...PlayerCollisionComponent pcol = new PlayerCollisionComponent();
player.Components.AddComponent(pcol);
the weird thing is when I tried to create a componentSpecs.ed.cs to add my own components it wouldn't compile.
#3
02/25/2007 (10:05 pm)
Make sure in the properties panal that the build action is not set to compile. It will automatically be execed by TGBX.
#4
02/25/2007 (10:25 pm)
That got it! Thanks!
#5
02/27/2007 (12:02 am)
If I add the componentSpecs.ed.cs to my project will it just be recognized or do I have to set something? My program's not applying the components listed there.
#6

02/27/2007 (6:45 am)
Visual Studio doesn't do anything with componentSpecs.ed.cs. You don't even need to add it to your project if you don't want to, it just needs to be at the same level as your txproj file. When you open TGBX, it looks for the componentSpec file and loads from it directly. If you aren't seeing it, then you either have the file in the wrong location, it's named wrong, or you don't have that txproj loaded.
Torque Owner Luke Larson