ScriptClass
by Kevin James · in Torque Game Builder · 04/21/2006 (10:02 am) · 3 replies
I'm trying to tie in my scripts (started a new test project) with the level editor. I added these lines to main.cs between exec gui and exec game.cs
16: new ScriptClass(Player);
17:
18: function Player::onAdd(%this)
19: {
20: $Player = %this;
21: }
The numbers are part of the editor. The console.log gives me:
T2D/main.cs Line: 18 - Syntax error.
What am I doing wrong?
Is there an example project that uses the new level editor? Somewhere?
16: new ScriptClass(Player);
17:
18: function Player::onAdd(%this)
19: {
20: $Player = %this;
21: }
The numbers are part of the editor. The console.log gives me:
T2D/main.cs Line: 18 - Syntax error.
What am I doing wrong?
Is there an example project that uses the new level editor? Somewhere?
About the author
Computer security, digital forensics, and platform jumper enthusiast. shells.myw3b.net/~syreal/
#2
Thanks Matt!
04/21/2006 (10:31 am)
Well, I made a really stupid mistake. I stuck your player function in the middle of InitializeProject (main.cs). That's why it threw the error. I got it working now. I'm moving my little g all over the screen, bumping into astroids and its all based on work done in the new level editor. Sweet.Thanks Matt!
#3
04/21/2006 (10:51 am)
Awesome! :)
Torque 3D Owner Matthew Langley
Torque
That shouldn't be causing the error, but it isn't needed, i do that to just keep track of all of my classes.
What version are you using?