Carriers At War v1.02 Utility Windows

Please post here for questions and discussion about scenario design and general game modding.
Post Reply
User avatar
alexs
Posts: 417
Joined: Wed Aug 27, 2003 3:54 pm
Location: Sydney
Contact:

Carriers At War v1.02 Utility Windows

Post by alexs »

The v1.02 release of Carriers includes a new system of Utility windows.


What Are Utility Windows
Utility windows are information windows that are displayed above the map. The number of windows shown depends on both the screen size (ie the resolution the game is played at) and the width of the windows chosen to display.
The game will always display the game time and game speed windows, but the area to the left of those windows is left to the user to decide which windows to display.


Choosing Utility Windows
An extra page has been added to the options screen labelled "Utility Windows". There, you can find 2 lists of windows - Available windows (ie windows that aren't currently being used), and Used windows. The used windows list also has a control at the top left to allow the alteration of window order.
When the game starts or the resolution is changed, the game starts showing the selected windows starting from the top of the list until it runs out of room.

Editing Utility Windows
Utility windows are specified by using an XML file stored under the "Utility Windows" subfolder (off the main game folder). XML files are simply a way of formatting data. They can be edited with any text editor to alter the information displayed and the look of the window.
A quick look inside the "Accident Free" window folder shows 2 files - the xml file (named exactly the same as the folder name), and a custom picture file.

Opening the xml file with a text editor (such as notepad) shows the structure - it consists of several lines of commented text and displays the hours since the last aircraft prang.

The file is heavily commented, so it should give you a good tutorial on what is possible with the system.

Developing Utility Windows
Whilst developing utility windows, it is useful to have the game open in a window, whilst opening the xml file that is being edited in another window. After saving any changes made to the xml file, if you select the carriers window, move the mouse over the window (make sure it's selected to be displayed) and hit F-5, the utility window will be reloaded, with any changes to the xml file reflected.

Window Options
The window tag has the following options available
description This is the description shown in the options screen, as well as the mouseover help text of the window.
width The width of the utility window

Commands

Drawpicture Options
x The x value the picture should be displayed (relative to the left of
the window).
y The y value the picture should be displayed (relative to the topof
the window).
or Are the equations that determine whether this command is shown compared with an 'or' operator (otherwise 'and' is used).
picture The picture to display. Can be a file in the same directory as the utility window xml file, or an in-game specified one.



Drawtext Options
x The x value the picture should be displayed (relative to the left of
the window).
y The y value the picture should be displayed (relative to the topof
the window).
or Are the equations that determine whether this command is shown compared with an 'or' operator (otherwise 'and' is used).
font The font to be used. Values can be "arial", "tahoma", "times new roman", "courier new" or "trebuchet". (default = arial)
size The size of the font to be used. (default = 22)
keylinesize The size of the outline used for the text. (default = 0)
color The color the text as a hexdecimal representation - ie white is 0xFFFFFFFF, black is 0xFF000000, red is 0xFFFF0000 etc. (default = 0xFFFFFFFF)
weight The boldness of the text. Values can be "bold", "semi" or "normal". (default = normal)
text The text to display


DependsOn Options
DependsOn are equations that are attached to the above 2 commands. If they evaluate to true, the command is displayed.

left The left side of the equation
right The right side of the equation
compare How are the sides compared. Possible values are "less than", "less than or equal", "equal", "greater than", "greater than or equal", "not equal", "string equal". Default = "equal".


Game Variables
Game variables may be inserted in any of the above options. Game variables are enclosed between $'s and may be any from the list below.
Please note - variables marked with a * are variables that accept parameters (ie text inside () - a list of possible values is given )

/////////////////////
// Scenario / Time //
/////////////////////
scenario name - The name of the current game
warroom name - The warroom of the current game (unless random scenario has been chosen)
scenario start date* - The scenario start date
scenario current date* - The scenario current date
scenario finish date* - The scenario finish date
remaining time* - The remaining time
time period - The current time period. May be "Day, Dusk, Night or Dawn"

////////////////////
// Victory Points //
////////////////////
total vps* - The total vps for the side. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us".
side winning* - Is a side winning. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us". Return values are "true" or "false"
ship vps* - The ship vp's for the specified side. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us".
plane vps* - The plane vp's for the specified side. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us".
victory by - The current number of victory points past the last victory level you are. Ie if your side is 50 points past a decisive victory, this returns "50"
is conditional active - Are any conditional conditional effects currently active
victory type - The current victory type. Can return "Allied Decisive", "Allied Marginal", "Draw", "Axis Marginal" or "Axis Decisive"


/////////////////////
// Graphics / Side //
/////////////////////
small seaforce flag* - Returns the small seaforce flag graphic for the side specified. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us".
small landforce flag* - Returns the small landforce flag graphic for the side specified. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us".
small panel flag* - Returns the panel flag graphic for the side specified. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us".


////////////////////////
// Strike Information //
////////////////////////
total ordnance hit on strike missions percentage
total ordnance hit on strike missions
total ordnance dropped on strike missions
total ordnance carried on strike missions
total number planes destroyed on strike missions
total number strikes sent
total number planes on strikes sent
tonnage sunk* - the total number of tonnes of ships sunk by the side specified. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us".
ships sunk* - the total number of ships sunk by the side specified. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us".
planes downed* - the total number of planes downed by the side specified. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us".


/////////////////////////
// General Information //
/////////////////////////
number of prangs - The total number of plangs for your side.
hours since last prang - the number of hours since the last prang.
is selected baseofops - Is the selected object a plane base (ie a landbase or taskgroup)
is selected landbase - Is the selected object a landbase
is selected taskgroup - Is the selected object a taskgroup
cap planes - The total number of cap planes that are in the air for the selected object.
stowed planes - The total number of stowed planes for the selected object.
awaiting repair planes - The total number of planes awaiting repair for the selected object.
awaiting arming planes - The total number of planes awaiting arming for the selected object.
awaiting fuelling planes - The total number of planes awaiting fuel for the selected object.
awaiting taking off planes - The total number of planes awaiting takeoff for the selected object.
awaiting landing planes - The total number of planes awaiting landing for the selected object.
search planes - The total number of searching planes for the selected object.
arming fuelling planes - Are there any planes arming and or fuelling for a mission on the selected object.
side* - Returns the side of the specified parameter. Parameters passed may be "Us" (ie your side), "them" (ie the enemy side), Allies" or "axis". Default is "us". Return values may be "Axis" or "Allies"
Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Carriers At War v1.02 Utility Windows

Post by Unhappy »

Alexs,

I don't really understand what this is all about, however, I'd like to know if it is possible to set it up so that it will display the warcards currently active by taskgroup/landbase. That would be a useful feature, I think, for designing/testing scenarios.

Just curious. Thanks.
User avatar
alexs
Posts: 417
Joined: Wed Aug 27, 2003 3:54 pm
Location: Sydney
Contact:

RE: Carriers At War v1.02 Utility Windows

Post by alexs »

I didnt have debugging in mind when designing the utility windows (therefore, there are no functions that return current warcard etc), but i can look at adding them - it shouldnt be too hard as the system is pretty flexible.

The Utility window system above is a way for modders to include information panels above the map. I've included a sample one in the latest patch - an 'accident free' panel which shows the number of hours since the last friendly prang. To display it in the game, go into the options screen, select the "Utility Windows" section on the left, and the controls to show utility windows (and specify the order in which their shown) are there. The only thing to take care of is if your running in the lowest screen resolution (ie 1024x768) - If this is the case, you will have to replace one of the default Utility Windows with the one you want to show (as there is no spare real estate in the section above the map).

Happy to answer any more questions on the subject.

Edit : There is a way to display the currently selected warcards in play.
There is a hotkey you can assign to display the warcards that the computer is currently using, though it's not bound by default (as its really only useful as a debugging tool). To assign :
1. Go to the options screen and select the "Hotkey Options" section.
2. In the "Command" combobox, scroll to the bottom and select the "DEBUG - Show Warcard(s)" option.
3. Select a key to bind the command to in the "Key" combobox (and set whether the ctrl key must be pressed using the ctrl checkbox).
4. Hit the "Add" button.

Thats it. When you return to the game, hitting the key you assigned should bring up the warcard for the currently selected taskgroup/landbase, or the warcards for all computer controlled units if no taskgroup / landbase is selected.

Unhappy
Posts: 124
Joined: Fri Jun 08, 2007 9:38 pm

RE: Carriers At War v1.02 Utility Windows

Post by Unhappy »

Hey! Thanks Alexs, that Hotkey Debug - Show Warcard(s) thing is perfect. Exactly what I wanted. Except now I can see that my TG's aren't doing what I intended...so back to tweaking.

Thanks again.
Post Reply

Return to “Mods and Scenarios”