The Starcraft Editing Bible

Chapter Two: Fundamental Unit Statistics

Reference: Stargraft [sections] continued

Stargraft makes things called PAT files which contain information about how to modify certain areas in the EXE data fork (section). You create PAT files with the patch creator, you load them with the patch loader. Duh. :) Stargraft also has the option of tacking on a PAT file into a SECWAD so that it automatically loads the PAT changes as well as your CWAD changes when you run it. Use the SE-Patch Wizard. (At the moment) This will ONLY WORK to tack on 1.07 and using regular SECWADs created by Stardraft (e.g., it will not work on SECWADs which already have a PAT file in them).

I'm going to work top-down to demonstrate how to create a PAT file with Stargraft and do basic changes. There will probably be more detailed specifications added later when more information becomes available.

Buttons

This tab controls the button sets. Each set (an entry in the list to your left) has a certain number of buttons in it which can not be changed (the number of buttons can't be changed; the actual buttons can be modified). You can, however, add a completely new set of your own making by going to the Edit menu. You can either use an existing one as a template, in which case it will make an exact duplicate of the current group or make a blank one with a variable number of buttons. The names of the button groups are just mnemonic reminders to help you distinguish between groups; they do not determine which group each unit uses (or anything else for that matter). You can rename them by right clicking on an entry.

Commands [slider]: Each tick on the slider is a different button in the set. Move the slider to toggle between the current button being displayed. These buttons are ordered. To add or delete a button on this slider, right-click on it (insertion will add a duplicate of the currently selected button in the next tick; deletion will delete the currently selected button).

Position [text box]: This is the position that the button will appear on the control bar. The first row is 1, 2, 3; the second is 4, 5, 6; and the third is 7, 8, 9. Buttons should be in order (e.g., the button in position 1 should be before the one in position 2), otherwise later ones will be pushed off.

Icon [drop-down menu]: This is the icon that is displayed on the button. (Pointer to a frame in unit\cmdbtns\cmdicons.grp; the image displayed is the particular frame)

Req Type [drop-down menu]: This is the particular requirement type for the button to be displayed. This is similar to the specific button requirements, but is more general (and determines which specific requirements are looked up). For example, a spell button usually will not appear unless the Req Type "Spell is researched" is set. This combines with the Req Var below. Many times, if this requirement is not met, the button will be grayed out.

Action Type [drop-down menu]: This is the action or order that is performed by the unit when this button is pressed. This combines with the Action Var below.

Req Var [text box]: This variable combines with the Req Type to form a complete statement (if necessary). For example, if the Req Type is "Can Create Unit/Building" then the Req Var is the units.dat number of the particular unit. If the Req Type is "Spell is researched" then the Req Var is the techdata.dat number of the particular spell. You can click on the [...] button next to this to get a list of appropriate values to choose from depending on your Req Type.

Action Var [text box]: This variable combines with the Action Type to form a complete statement (if necessary), just like the Req Type and Req Var. For example, if the Action Type is "Create unit" then the Action Var is the units.dat number of the particular unit to be created. You can click on the [...] button next to this to get a list of appropriate values to choose from depending on your Action Type.

String [drop-down menu]: This is the text that is displayed when you hover your cursor over this button and it is active (accepts the first character as the hot-key for this button). Be careful, if you choose none and the game tries to display it, it is liable to crash. (Pointer to a line in stat_txt.tbl)

Req String [drop-down menu]: This is the text that is displayed when you hover your cursor over this button and it is inactive (grayed out). Be careful, if you choose none and the game tries to display it, it is liable to crash. (Pointer to a line in stat_txt.tbl)

Units

Each entry in the Units tab is a unit from units.dat. The information in this tab determines which button set each particular unit uses, in addition to sets for combined groups (like if you select multiple units) at the bottom.

# of Commands [text box]: This determines how many buttons to try to display for this unit. If this number is greater than the number of buttons in the set, the game will crash. If it is less, then it will only display the first X buttons, where X is the number here.

Commands [drop-down menu]: This is the actual button set that the unit uses. (Pointer to an entry in the Buttons tab)

Flags [text box]: Unknown.

Status Bar

I am not yet certain how to manipulate these variables stably. They determine the "functions" used to display information in each unit's status bar (the area with the wireframe, health points, etc.). Mainly, these are used to determine if wireframes will be displayed in the unit if it has passengers (like transports) or if it should display construction/training information when it performs those particular orders (like factory buildings). Here are two useful combos:

[Misc Fn: Unknown 4]+[Display Fn: Unknown 3]: Unit will display its passengers inside.

[Misc Fn: Unknown 3]+[Display Fn: Unknown 2]: Normal building. I.E., will display training info when it builds unit and otherwise display correct information as a building (determined by units.dat).

[Misc Fn: Unknown 2]+[Display Fn: Unknown 1]: Normal man (non-building unit). Will display correct information if it is not a building (determined by units.dat).

Unit Requires

This tab contains a selected group of units from units.dat (as singular entries). You can change which unit each entry refers to by changing the Unit variable. You can add an entry by going to the Edit menu. Each entry has a set of requirements which are used to determine whether the button Req Action "Can Create Unit" is met. A unit must have a Unit Requires entry here, or the conditions of "Can Create Unit" will never be met. When creating a new entry, you can either use a current one as a template, in which case it will create an exact duplicate or make a blank one with a variable number of requirements. You can not change the number of requirements in an entry after it is created.

Unit [drop-down menu]: This determines which unit from units.dat this Unit Requires entry is for. (Pointer to an entry in units.dat)

Requirement # [slider]: Each tick on this slider refers to a particular requirement flag or unit number. Think of it like this: each flag is a condition that must be met (or possibly a logical operator) for the requirement to be satisfied. Some flags require a variable (e.g., a unit) which is the next tick (for example, "Current unit must be [next requirement]"). This is denoted by the [next requirement]. There is also a logical "or" statement that can be made, "[previous requirement] Or [next requirement]." This means that either the requirement before this one is satisfied, or the next one is (or both) and it will still return true. Full example:

Flag:"Current unit must be [next requirement]"
Unit:"Terran Marine"
Flag:"Mode must be broodwar"
Flag:"[previous requirement] Or [next requirement]"
Flag:"Current unit must not be lifted off"

In English this means: The current unit must be a Terran Marine AND the Mode must be broodwar OR the current unit must not be lifted off. To add or delete a requirement on this slider, right-click on it (insertion will add a duplicate of the currently selected requirement in the next tick; deletion will delete the currently selected requirement).

Type [radio buttons]: This determines whether the current requirement tick is a flag or a unit.

Value [drop-down menu]: This determines the actual requirement statement to be made if it is a flag or the unit variable if it is a unit (to combine with the previous requirement flag). (If it is a unit, then it is a pointer to an entry in units.dat)


The Upgrade Requires, Tech Requires (Research), Tech Requires (Use), and AI/Order Requires work exactly the same way as the Unit Requires section, except for upgrade research buttons, technology research buttons, technology use (spell) buttons, and AI/Order execution, respectively. There will of course be a full spec when we get to those sections of the bible for those who don't quite pick up on things so quickly. :)

Copyright (c) 1999-2000 Jeffrey Pang. Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the
Free Software Foundation with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU Free Documentation License".

[an error occurred while processing this directive]