Game Development Community

A couple questions about TorqueScript.

by C. N. · in Torque Game Builder · 08/31/2005 (3:08 pm) · 6 replies

Hi,
I'm having some problems with TorqueScript. It's just this: changes I'm making in the client.cs file sometimes don't take effect. For example, commenting out function calls in the script doesn't seem to make that function cease being called. Or I'll load an image and at first it works, but when I change the filename that I use to load the image to a different filename/picture, it still loads the image that I had in there before, instead of the new one. I save the script everytime I make a change to it, but this still seems to happen alot.

At first I thought maybe my script editor was bad (crimson editor) but it happens no matter which editor I use (notepad, wordpad, etc..) Anyone have an idea what's happening?

Also, (sorry, one more) what are the .dso files?

Thanks.

#1
08/31/2005 (3:14 pm)
.dso files are stored in the same folder as the .cs-file, if you're using windows. (not sure about other platforms.)
Personally, I use a .bat file like this to start my game, makes sure that all compiled files always get deleted.

del *.dso config.cs prefs.cs console.log /s
start T2D.exe -mod thenameofyourmod
exit

Just place it in the same folder as t2d.exe
#2
08/31/2005 (3:30 pm)
Hi.
The .dso files that you see are a compiled version of the .cs files.
Everytime you launch T2D, it checks the date of the .cs and the corresponding .dso files, and if the .cs date is older than the .dso files, then the .dso file is loaded and executed.
If you have modified the .cs file, then it will have a newer date than the .dso so T2D tryes to compile it (creating a new .dso file) and execute it.
If there is an error in the .cs file then the old .dso file will not be modified, so even if you changed the .cs file, T2D will execute the older version (this is why it seems that your changes are ignored).

Everytime that this happens, read the console and you will surely find some errors that will help you locate the problem and correct it.

Hope that this helps you.

Have fun!

Jacopo
#3
08/31/2005 (4:16 pm)
Ah! That's exactly whats happening... So I need to delete the .dso's everytime, eh? Stefan's post above suggests .bat's to do this, but I don't know how to make those.

Thanks, that was really throwing me for a spin...
#4
08/31/2005 (4:35 pm)
Just create a .txt file with those lines in it, and save it as "whatever.bat".
#5
08/31/2005 (4:42 pm)
Making a .bat file is easy.
Just launch your text editor and copy (or type) the three lines in Stefan's post:

del *.dso config.cs prefs.cs console.log /s
start T2D.exe -mod thenameofyourmod
exit

Save this file as somename.bat in the directory where t2d.exe is located. Now you can execute somename.bat by just doubleclicking it or using the command prompt.
This will work only if you are using windows, so if you are a Mac or Linux things will be different.

However, you don't need to delete .dso files everytime. You can do it, if you want, but I think that you just need to read all the console output, looking for errors, (they are in red) after you have made changes to some .cs scripts. If you find errors, then T2D is executing the old version of the script.

Bye,
Jacopo
#6
08/31/2005 (4:56 pm)
Superb. Thanks alot you guys. :)