Torque script wont work?
by Robert Carroll · in Hardware Issues · 08/11/2009 (7:09 pm) · 5 replies
I Have the TGB just 2d i guess and i try to get the torque script to work ive tried about 28 times and it still wont work i even copyed the codes from the GG website. And i think im doing every thing right. First i make a new Text document copy the code into it then save it as "example.cs" then go to the Game.cs and put "exec/example.cs" where its supposed to go the i go and change the pictures class to 'example" and click save then play.
About the author
Stay Up all night playing PS3 ;) add me PSN: RCBASEBALL13.
#2
08/12/2009 (11:42 am)
Well i just found out about the console thing im a noob thats why was asking so no i can find the errors.
#3
08/12/2009 (12:49 pm)
Nothing wrong with being a noob- it's how we all start out. Check the Support > Documentation area of the site to find tutorials, and those can help you get the hang of scripting. Also, there's loads of information in the forums, and the search function can bring up posts on all sorts of issues and ideas. Hope that helps!
#4
Now, when you say you put "exec/example.cs" in your game.cs folder, do you mean that exactly? Exec is a function, as such a call to it should look like this: functionname();. This one also requires parameters, so it would look like "exec(%something);". You would place the relative path of the file you wish to execute where '%something' is. In this case, that line should look like " exec("./example.cs"); ". The period indicates that the file is in the same folder that this function is being called in, while a ~ would indicate that the file is in the folder containing the folder that this function is being called in.
Hopefully, this mouth full helps, it took me a while to figure this out. You can find documentation on TGB here: http://www.garagegames.com/documentation/tgb
08/14/2009 (12:25 pm)
You may need to make a modification to one of your files to view your console. In your "Common" folder, there should be a file called "CommonConfig.xml". Open that with a text editor, and where it says "<ConsoleKey>~</ConsoleKey>", replace the ~ with a key or combination of keys you would like to use to open up the console. I use "ctrl z" for my projects. After making that modification save and close the file, then right click it and click 'properties', then check the "Read only" box so it can't be modified. Now, when you say you put "exec/example.cs" in your game.cs folder, do you mean that exactly? Exec is a function, as such a call to it should look like this: functionname();. This one also requires parameters, so it would look like "exec(%something);". You would place the relative path of the file you wish to execute where '%something' is. In this case, that line should look like " exec("./example.cs"); ". The period indicates that the file is in the same folder that this function is being called in, while a ~ would indicate that the file is in the folder containing the folder that this function is being called in.
Hopefully, this mouth full helps, it took me a while to figure this out. You can find documentation on TGB here: http://www.garagegames.com/documentation/tgb
#5
08/24/2009 (8:49 pm)
In your "example.cs", add the line echo("hello");. Do you see that in the console? If so, it's working. IF not, then there's something not working correctly.
Torque 3D Owner Ted Southard