• Register

The Orange Block is a game built on the TGE (Torque Game Engine). It allows single and multiplayer gaming, which you can build structures from Lego bricks then play around with them with weapons for a DM and other items (including a jet ski, car and plane!) for RPing or RPGing. The game has over 50 maps to play and you can design your own using the TGE map making tools. The game also supports moding and is easy to mod if you know Torque Scripting. It has an active forum which anything (Even non-game related) things are discussed.

Post tutorial Report RSS How to Execute a File

Teaches the very basics of scripts used by TGE, and explains how to get files authored by you for modding recognized and loaded into the game's active working memory. Adapted from a similar tutorial on the forum by EmperorWiggy.

Posted by on - Intermediate Client Side Coding

There are two types of script files used by the Torque Game Engine:

1) .cs: These are the 'source code' files. These are the files one opens up, modifies, and generally changes.

2) .dso: These are the compiled forms of the .cs's. These are not used by the user. Torque Game Engine, when asked to exec a file, uses the compiled .dso file, because that is what it reads. If there is no .dso file, TGE compiles the .cs file into a .dso and uses that.

Anyways, to properly exec a script:

1) First confirm you have made the proper changes to the .cs file. Confirm that you have made all the necessary changes, and check it for any syntax errors or missing semicolons.

2) Now, to exec the file. There are two methods to do so:
a) The simpler method: Restart TOB. When the engine opens it compiles everything the game uses. This has its downsides (i.e., when running a server, doing this closes the server), but it is certainly easier.
b) The faster method: Manually exec the file. Go to the console and type:

Code:

exec("filelocation.cs");



Replace filelocation with the file's location, such as

Code:

exec("dtb/server/scripts/game.cs");



This is definitely faster, and thus is the recommended method. It's also easier to find errors using the console.

3) If something goes wrong, open the console. It should give you an error location. Use that to locate and fix the error and re-exec the file.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Report Profile
Icon
The Orange Block
Platforms
Windows
Developer & Publisher
The Orange Block
Contact
Send Message
Release date
Game watch
Follow
Tutorial
Browse
Tutorials
Report
Report
Share
Related Games
The Orange Block
The Orange Block First Person Shooter
Related Engines
Torque Game Engine
Torque Game Engine Commercial
Related Groups
The Orange Block
The Orange Block Developer & Publisher