Game Development Community

Space Warrior Tutorial Problem

by Matthew Gregory-Browne · in Torque X 2D · 09/23/2008 (8:48 pm) · 2 replies

Hello,

I am currently doing the Space Warrior Tutorial and stuck at the end of step 2. My project does not compile it throws these errors:

Error 6 'GarageGames.Torque.ShipControlsComponent._OnRegister(GarageGames.Torque.Core.TorqueObject)': cannot change access modifiers when overriding 'protected internal' inherited member 'GarageGames.Torque.Core.TorqueComponent._OnRegister(GarageGames.Torque.Core.TorqueObject)' C:\Users\matt\Documents\Visual Studio 2005\Projects\SpaceWarriorTutorial\SpaceWarriorTutorial\Torque\ShipControlsComponent.cs 136 33 Torque

Error 7 'GarageGames.Torque.ShipControlsComponent._OnUnregister()': cannot change access modifiers when overriding 'protected internal' inherited member 'GarageGames.Torque.Core.TorqueComponent._OnUnregister()' C:\Users\matt\Documents\Visual Studio 2005\Projects\SpaceWarriorTutorial\SpaceWarriorTutorial\Torque\ShipControlsComponent.cs 176 33 Torque

Error 8 'GarageGames.Torque.ShipControlsComponent._RegisterInterfaces(GarageGames.Torque.Core.TorqueObject)': cannot change access modifiers when overriding 'protected internal' inherited member 'GarageGames.Torque.Core.TorqueComponent._RegisterInterfaces(GarageGames.Torque.Core.TorqueObject)' C:\Users\matt\Documents\Visual Studio 2005\Projects\SpaceWarriorTutorial\SpaceWarriorTutorial\Torque\ShipControlsComponent.cs 183 33 Torque


I can get it to compile if I remove the "override" in front of the _OnRegister, _OnUnRegister, and _RegisterInterfaces. If I do this however, it breaks the movement component and gives a series of warnings similar to this:

Warning 6 'GarageGames.Torque.ShipControlsComponent._OnRegister(GarageGames.Torque.Core.TorqueObject)' hides inherited member 'GarageGames.Torque.Core.TorqueComponent._OnRegister(GarageGames.Torque.Core.TorqueObject)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword. C:\Users\matt\Documents\Visual Studio 2005\Projects\SpaceWarriorTutorial\SpaceWarriorTutorial\Torque\ShipControlsComponent.cs 136 25 Torque

I assume that the overrides are needed, but I can't get the code to compile without removing them. I thought I might have made a typo in copying the code from the tutorial so I went back and copy/pasted all the code. I also noticed that TXB is detecting two different ShipControlsComponent's, but there is only one ShipControlsComponent.cs file in my project. I don't know if that is relevant, but I include the detail because it seemed odd.

Can anyone point me in the right direction?

Thanks,

Matt Gregory-Browne

About the author

Recent Threads


#1
09/25/2008 (3:02 am)
There are two versions of the tutorials - did you make sure to have the correct ones (for TX 2.0)?
#2
09/25/2008 (11:30 am)
I am using the version of the tutorial that is located here:

http://www.garagegames.com/docs/tgb/official/