Game Development Community

Urgent Help

by Rybo · in Torque Game Engine · 07/07/2007 (5:54 am) · 10 replies

The .cs files, i set to ope with notepad. But now i wish to open the with CodeWeaver instead but it wont let me.

Its changed it from a .cs into a .dso!!!!!

Anyone can help?

#1
07/07/2007 (6:17 am)
Torquescript files (filename.cs) are plain text documents that can be opened in notepad, CodeWeaver or a number of other text editors. Those programs won't change the names or extensions of your scripts without being told to (as in a Save As operation).

Compiled Torquescript files (filename.cs.DSO) are the bytecode compiled version of your script files. The Torque Game Engine itself is what compiles your plaintext Torque scripts into compiled scripts. That's a good thing. It means that when you're ready to ship your game you can remove most (but not all) of the .cs files from your game directories and just leave the .dso files to be installed on your user's computers. This improves game startup speed somewhat, it hinders cheating to some degree and it has a few other benefits.

During development, however, you will need to get in the habit of deleting all the .dso files from your game's directories, since TGE prefers compiled versions of scripts rather than plaintext versions. A common scenario is that a new developer makes important major changes to the player.cs file and then starts his game. But none of the changes to the player datablock seems to be in place. Instead, the in-game player behaves just like it did prior to the script change. That's because it is running off the old script version of player.cs -- just the previously compiled version of it.

Again, in the presense of an old .dso file AND a new .cs file, the engine will completely ignore the new .cs file and use the old .dso script instead.

There should be a batch file in your games root directory that deletes all .dso files from all of the sub folders. Get in the habit of running that script after making any script changes.

As for your other issue, getting your .cs files to load up in CodeWeaver, that's a Windows question, but you should be able to right click on a random .cs file and then click Open With in the popup menu, then look for or browse for CodeWeaver as the default application, then make sure Always Use This Program is checked, then hit OK. That should do it (if memory serves me correctly).

I hope that helps.
#2
07/07/2007 (6:39 am)
Thanks

But when i open the scripts with notepad it just came up as squares rather than what it should.

So i download CodeWeaver

but then it wouldnt let me open a codeweaver becuse it had converted itself into a DSO

Any help with that?
#3
07/07/2007 (6:47 am)
I don't think you've grasped Aaron's post. Have a re-read.

You're not supposed to open the *.dso file, in fact you can't. Open the *.cs file instead.
#4
07/07/2007 (6:47 am)
All raw script files (filename.cs) should load up as a plain text script files. All compiled script files (filename.cs.dso) should load up as unreadable garbage.

That's the way it should be. Delete all your dso files first, before you do anything else. Then open up a .cs file in codeweaver.
#5
07/07/2007 (6:58 am)
To change the file types so your .cs will load with codeweaver do this:

1. Open My Computer
2. Go to 'Tools->Folder Options
3. Click the 'File Types' tab
4. Scroll to where you see CS File (under File Types)
5. Near the bottom where it says 'opens with:' click 'Change'
6. Look for CodeWeaver in the list. If you don't find it click 'Browse' and find the exe on your computer.
Make sure the check mark for 'Always use the selected program to open this kind of file is checkmarked.
#6
07/07/2007 (7:01 am)
Also, be carefull of those batch files...kiddies.


If you're using the SDK and it contains the ShowToolPro MOD....you'll kill those .DSO files[only ones shipped with tstpro...no .cs files], and very effectively break your ShowToolPro program....
#7
07/07/2007 (7:41 am)
@Rex
Good point!
#8
07/07/2007 (9:53 am)
Quote:
Again, in the presense of an old .dso file AND a new .cs file, the engine will completely ignore the new .cs file and use the old .dso script instead.

Actually, that's not true at all. Very occasionally it will fail to recognize a new .cs file, but by design Torque will always ignore .dso files that are older than a .cs file of the same name.

There are multiple cases where for ease of work flow it's a common practice to delete .dso's to ensure you can get a completely clean .dso re-compile, but by design it works as I state above.
#9
07/07/2007 (10:34 am)
It never seems to work that way for me. 9 times out of 10 if I change a script and don't delete DSO's the new changes don't take affect.
#10
07/07/2007 (11:47 am)
Hehe...part of the reason why I say "designed to" and "usual practice".

Normally, what happens in the case you mention is that:

1) you have a compilation error in your new script, so the parser falls back to the last successful compilation--the .dso file.
2) The new code you wrote is dependent on other TorqueScript files in a way that the parser doesn't recognize, causing indeterminstic situations.
3) The timestamps reported by the OS are not within the threshold of "change detection", but this is actually reasonably rare.

Prior to Torsion's pre-compilation, it could be really difficult to recognize script errors (had to open the console, and scroll all the way through it), so it became a good habit to remove the fallback option of 1) above. Re-compilation of all .cs files is fast enough in most projects that the time it takes to simply delete the .dso's is much less than stepping through the troubleshooting list above, as well as recognizing when the code you think worked didn't, so it became a standard practice.

I do feel at my gut level that there are cases where Torque does miss changes, but no one yet has a 100% reproduction case (including us), so we can't prove or fix as of yet.