This is a list of all of the scripts (.cs files) in Marble Blast Gold. It describes what each script does without going into too much detail.
I'll assume you know some of the basics of TorqueScript. If e.g. you're not sure what a datablock is, you may want to read a TorqueScript tutorial before attempting to edit scripts.
All directories given are within marble/. common/ has not been included because its scripts are not too useful for mods, but if you need to use a script in common/, let me know and I will investigate its purpose.
This list is MBG-specific. Mods will obviously change these scripts, sometimes making this list inaccurate. In the case of MBP, almost none of the original .cs files are distributed, so it would be futile to try to determine the scripts' purpose.
main.cs: This is the main script, run when the program first opens. Console arguments (when you run MB from a console) are processed here. For example, this script handles the use of the -test command for interior testing. The actual test mission itself is created in client/init.cs. There is also an unused mod-loading system here.
data/: This folder stores all of the sounds, models, textures, levels, etc.
data/init.cs: This script is used to define materials and assign them to textures. A material defines the way an object behaves. Friction, restitution, and force (for bumpers) are defined here. Then, each texture has a material corresponding to it.
server/: This folder stores everything that the server running the game needs to know. Note that remnants of the client-server mechanic are preserved even though there is no longer any functional multiplayer. The scripts in this folder keep track of gameplay mechanics.
server/defaults.cs: This mostly has to do with the planned and abandoned multiplayer system.
server/init.cs: Ditto. This seems to be used to start a dedicated MBG server.
server/prefs.cs: This is not THE prefs.cs; this stores properties related mainly to servers.
server/scripts/: Keep in mind that most modifications will use this folder a lot.
server/scripts/audioProfiles.cs: This script has two main purposes. It defines audio descriptions, which describe a particular type of sound based on its location properties and whether it's supposed to loop. AudioDefault3D is used for most things. The other purpose is to define several of the audio profiles, which are how sounds are stored within the game's memory. Most of the in-game sounds (countdown, spawn, finish, help trigger, OOB) are defined here.
server/scripts/bumpers.cs: Rather obviously, this is where bumpers are defined. The angleBumper datablock is also defined, which has no apparent use other than to throw an error. It was probably an old bumper type that was removed.
server/scripts/buttons.cs: This defines the unused but functional PushButton datablock. A sound effect is defined, but there is no .wav file with the proper name (ButtonClick.wav). If ButtonClick.wav is created, the sound effect will work with no script modifications required.
server/scripts/camera.cs: This (obviously) defines several properties of the camera.
server/scripts/centerPrint.cs: This defines some methods used with an old message system, used to message clients in a server-run game. The same system was originally used by MBP's teleporters.
server/scripts/commands.cs: This is where the functions mapped to keyboard commands are defined. They mostly involve the camera.
server/scripts/fireworks.cs: This is an entire script dedicated to the programming of the finish pad fireworks effect.
server/scripts/game.cs: This is the big script for gameplay mods. It does the following:
-Runs all of the other gameplay scripts.
-Handles the start and end of a game.
-Calculates final time from time travel bonuses/penalties.
-Controls game states, such as whether the marble has been released yet.
-Controls the bonus/penalty time adjustment.
-Controls what happens when the marble enters/leaves a pad.
-Controls what happens when the marble goes OOB.
-Handles gem finding.
-Handles checkpoints (in an old and unused system).
-Counts all of the gems in the level.
server/scripts/gems.cs: This defines gem models and sound effects, the datablocks involved, and handles gems disappearing/reappearing.
server/scripts/hazards.cs: This is where most hazards (trapdoors, fans, tornadoes, mines) are defined.
server/scripts/inventory.cs: Methods for handling player inventory are defined here. Note that most of this has strong echoes of the FPS demo Marble Blast was built off of. There isn't much use in changing this script.
server/scripts/item.cs: This defines a few methods that items you pick up will follow. Nothing special.
server/scripts/marble.cs: This is where the marble's particles, sounds, properties, and methods are found. It can be very useful.
server/scripts/markers.cs: These markers seem useless and are remnants from the FPS example.
server/scripts/pads.cs: This is where the start and end pad datablocks are defined.
server/scripts/pathedInteriors.cs: This is where some methods and triggers for moving platforms are defined. If I were you, I wouldn't mess with them.
server/scripts/platformPart.cs: This seems to be a remnant of an unused system. Either that, or it involves moving platforms again.
server/scripts/powerUps.cs: This scripts defines the powerups. Both inventory and non-inventory powerups are defined here.
server/scripts/radiusDamage.cs: This is where a method is defined that I think has to do with force fields. I'm not sure.
server/scripts/shapeBase.cs: I have no idea what this is for. It involves applying damage, which doesn't make sense in the context of MBG and may be left over from the FPS example.
server/scripts/signs.cs: This is where the sign datablocks are defined, including the hand signs, caution signs, and finish sign.
server/scripts/staticShape.cs: This defines some basic methods for static shapes. Don't mess with them.
server/scripts/triggers.cs: This is where the help triggers and in-bounds/out-of-bounds triggers are defined. For moving platform triggers, see pathedInteriors.cs.
client/: This is where everything not directly gameplay-related is defined. In a client-server multiplayer setup, the client folder would be everything your own copy of the program processes. This includes GUI, help, demos, etc.
client/defaults.cs: This is where the default settings for most things are defined.
client/init.cs: This script runs the other client scripts and loads the GUI files. It handles interior testing and the main menu loading.
client/prefs.cs: This is where best times and preferences are stored. Be warned that it is overwritten every time you run the game, so some changes made here may not stay. However, you can use it to e.g. change the resolution to one not offered in the options menu.
client/scripts/audioProfiles.cs: This is where the audio descriptions and profiles for the menus are defined. This is also where the shell music is handled, so by changing this script, you can change the shell music.
client/scripts/centerPrint.cs: This is probably related to printing messages like in the server equivalent of this script. I wouldn't mess with it.
client/scripts/chatHud.cs: This defines a bunch of chat-related multiplayer-based functions that were left unused. The important function here is addHelpLine, used for help triggers.
client/scripts/client.cs: None of this really matters too much. It's basically a few miscellaneous functions that aren't too useful.
client/scripts/default.bind.cs: This is where the keyboard and mouse controls are defined. You can define new shortcuts this way.
client/scripts/endGameGui.cs: This script is almost entirely useless. I wonder why an empty method warrants a separate script.
client/scripts/game.cs: This is where best times are handled, including getting the best times, adding new ones, formatting the text in the end game dialog, and formatting a time into a nice string.
client/scripts/helpCredits.cs: This is where most of the help screen is defined.
client/scripts/loadingGui.cs: This script is not as useless as endGameGui.cs, but it might be close. It appears to be related to the loading screen, but there isn't much use in modifying this script.
client/scripts/messageHud.cs: I'm not sure what this does, but I don't see any use in modifying it.
client/scripts/missionDownload.cs: This deals with the loading of the level. By modifying the methods here, you can change the behavior of the loading bar.
client/scripts/optionsDlg.cs: There are a lot of methods related to the options screen here.
client/scripts/playGui.cs: This is where the in-game HUD is controlled. Gem count, for example, is handled here. With a combination of editing this script and editing the GUI file, you can e.g. add a third gem count digit, like in PQ.
client/scripts/serverConnection.cs: These methods seem mainly related to old server stuff. I'm not sure if they're useful.
client/scripts/version.cs: This is used to check if there are updates to MBG. I wouldn't advise taking advantage of this.
client/ui/defaultGameProfiles.cs: This is where some profiles are defined, mainly controlling e.g. the font that text uses.
That's all of them, unless I missed any. If you have any additions or corrections, let me know and I'll edit this post. If you want one of the scripts explained further, you can post in this topic, and I will reply, but this will not be added to this post, as this post is intended as a short summary.