Scripting question
by Minako · in General Discussion · 08/02/2002 (6:21 pm) · 4 replies
Ok, I opened up the player.cs file, screwed with a few settings that should be very obvious like the jump height, jump delay, max angle you can climb, etc, but when I ran the game the changes didn't seem to have taken hold. Do I need to compile it somehow or something?
Minako
Minako
#2
You can also go to the console while in game, hit the tilde (~) key, and type 'exec("path/to/script/file.cs");' and it'll compile the script if its newer than the .dso and then load it. This is exactly what the init scripts do when they start up.
As for your specific problem, I'm not sure what it would be. Just make sure that the script you are editing is indeed the one that's being used. You can search through the project for "player.cs", or whatever the name of the file is, and make sure that the one you are editing is exec'd somewhere.
Messing with variables of the player was one of the first things I changed in the game when I was getting started, so I know it works.
08/03/2002 (10:57 am)
No, you don't have to delete the .dso files for it to recompile it. It works the way 'make' does, if the file is newer than the last time it was compiled it recompiles it. Everyonce in a while I do come across a problem where it doesn't work like it should, but for the most part it works fine. You should be able to just make the changes and when you run the game again it should just work.You can also go to the console while in game, hit the tilde (~) key, and type 'exec("path/to/script/file.cs");' and it'll compile the script if its newer than the .dso and then load it. This is exactly what the init scripts do when they start up.
As for your specific problem, I'm not sure what it would be. Just make sure that the script you are editing is indeed the one that's being used. You can search through the project for "player.cs", or whatever the name of the file is, and make sure that the one you are editing is exec'd somewhere.
Messing with variables of the player was one of the first things I changed in the game when I was getting started, so I know it works.
#3
08/03/2002 (11:07 am)
Scroll the console back up to the beginning and make sure that you haven't introduced any errors into the script. When changes to a script don't appear to be working, it usually means there was an error when the script file was compiled.
#4
08/03/2002 (11:12 am)
Turning on console logging helps with this. It will usually give you the error with a line number in the offending script.
Torque Owner Nathan Martin
TRON 2001 Network
Also here's a good tip: Whenever you wish to release like really cool scripts and all, but you don't want to give out the source to it just yet then just release the compiled version of the scripts which their extension is .dso, enjoy!