OP API R2.2 readme.txt

   STAR TREK(r) Starfleet Command 2: Orion Pirates(tm)
   OP API Release v2.2 Readme File
   22 January 2002

Note: Maximize for best viewing format.

v2.2 of the Scripting API was built with code from Orion Pirates v2.5.2.3. Scripts built with v2.2 of the Scripting API should work with all releases of Orion Pirates back to 2.5.0.0, and should be compatible with future versions of Orion Pirates, unless specifically noted in that release.

We recommend all script writers relink their scripts with this new edition of the API for maximum compatibility.

CONTENTS

A. Requirements B. Installing the API C. Installing the VC Addins D. Working with the API E. Running A Script In Game F. ShipList C++ Class Library G. More Information


A. Requirements


In order to create scripts that will function with the STAR TREK(r): Starfleet Command 2: Orion Pirates(tm) (OP, for short) engine, you should meet the following requirements:

1. A Windows 32-bit operating system such as Windows 95/98/Me/NT/2000/XP. 2. Microsoft Visual C++ 6.0 installed. 3. Visual Studio 6.0 Service Pack 5 must be installed. 4. All system requirements required to run SFC2 as described in the manual.



B. Installing the API


To setup the API, please follow these steps:

1. Open the Start Menu -> Programs -> Starfleet Command - Orion Pirates -> Scripting API folder, and click on "Browse to the API folder"

2. Copy the files from "OP API - R2.2\STL\Include" and "OP API - R2.2\STL\LIB" to their respective directories found under the install path of your C++ IDE. These files are updates to Microsoft's Standard Template Library and are necessary in order for the OP scripts to build successfully.

3. Copy the "OP API - R2.2\Scripts" directory from the folder to your work folder. Please note the path to which you copy this. For future reference, let us call this path "LocalDir".

4. Run your Windows registry. To do this, Click Start|Run. Type, "regedit". Once in the Windows registry editor, you will need to make some keys and a string value in the following manner: HKEY_LOCAL_MACHINE/SOFTWARE/Taldren/VCScriptAddins/Settings/ScriptRootPath=X, where X="LocalDir\OP API - R2.2\Scripts\"



C. Installing the VC Addins


It is not necessary to install the Addins supplied with the API. However, it is highly recommended that you do this, especially since the use of these Addins is referred to later in this documentation.

1. Open VC++6 and create a new workspace. We will refer to this as the OP API workspace from this point on.

2. Click Tools|Customize|Add-ins and Macro Files|Browse. Browse for "CreateScript.dll" and make certain that the check box is checked next to the newly loaded Addin. Repeat for the second macro, "ScriptObjectWizardAddin.dll".

3. Staying in the Customize dialog, click on Commands|Category|Add-ins. You should now see two buttons. Drag these buttons to the toolbar of your choice and name them as you see fit. One Addin is for creating a new script. The other is for adding a new OP object.



D. Working with the API


The OP API workspace should now be opened. If not, please read the first part of "Installing the VC Addins" for more information.

The API comes with the various libraries necessary to build a script. It also comes with some example scripts for your copying and pasting convenience.

Now let's create a script:

1. Click on the CreateScript|Script Type. Choose a Script Type. For instance, if you were to create an ISC single player campaign script, you would likely select "ISC"; although, any type will do.

2. Click Script Name and complete the name of this new script.

3. Next, choose the type of template you would like to use. By not choosing either checkbox, the CreateScript Addin will use standard (or most basic/bare-bones) template.

4. Scripts Root Directory should automatically pick up on the path that you had set earlier in the registry editor during installation. If not, fill this in or see "Installing the API" for more information.

5. You should now notice a new project added to the workspace. This project is not yet functional. Do not use this project. Instead, close down the IDE and find the newly created X.dsp file, where X is the name of the script. Delete this X.dsp file and rename the X.dsp.new file to X.dsp. Now reopen the OP API workspace. You should now see an updated version of the new script.

6. Now you are ready to script. View all of the files. Throughout each file you will find comments prefaced by the text, "HELPER NOTE". These "HELPER NOTE"s are actually the documentation interspersed in the appropriate places within the code.

7. Let's say that you wanted to add a new ship to a script. Well, how would you do this? You could either manually create a new .cpp and .h file OR you could use the ScriptObjectWizardAddin Addin. Click on this Addin. Next, click on Ship|Next. Type in the name of the new ship in "Ship Name", then choose "tShipInfo" as the "Parent Ship". Next, click Finish. A pair of newly added files will appear in your current project.

8. Finally, once you are finished writing the custom script, you should build the script. Before you do this, make certain that Run-Time Type Information is set for your project. If you are not certain, click Project|Settings|C/C++|Category|C++ Language. Then, select the name of your project from the list box on the left. Verify that RTTI is enabled on this dialog. Now build the script. The export file should be the name of your script + .scr and it should be found in "LocalDir\OP API - R2.1\Scripts".



E. Running A Script In Game


Now that a script has been created, it is time to run the script.

1. Go to the directory where OP was installed. Take the newly created .scr file and place it in "Assets\Scripts".

2. For scripts that were created for Dynaverse II, make your way to "Assets\Scripts\Campaigns" and create yourself a new .mct file. Replace the names of the scripts with the name of your newly created .scr file. Change other variables as you see fit. Make certain that the trigger prestige is set to 0 and that the trigger mission is the title of your new script if you would like to see your mission appear early in Dynaverse II.

3. Now run OP. You should now see your single player campaign scripts show up as missions on the mission selector in Dynaverse II and you should see your multiplayer scripts show up on the list under the multiplayer setup screen.



F. ShipList C++ Class Library


You will find a useful library inside OP API - R2.2\Scripts\ShipList. This class library was written by MagnumMan and provides an object oriented representation of the shiplist and ftrlist files. This library is used in the Co-op Ace and Sector Assault scripts, also written by MagnumMan. View the readme file in the ShipList subdirectory for more information on how to use the library.



G. More Information


For more information about this API, please visit the forums at:

www.taldren.com

Thank you for your interest in the STAR TREK(r) Starfleet Command 2: Orion Pirates(tm) Scripting API.

-->