Page 2 of 2

Posted: Mon, 30. Jan 12, 20:50
by CBJ
User Interface

More and more of you are using large, high-resolution screens to play X-Universe games, but until now the in-game menus have remained resolutely small, often taking up only a tiny proportion of the available space. While we were sorting this out, we also took the opportunity to make a few other little changes to make those menus easier to read and use.


All the in-game menus were checked to see which ones could benefit from being bigger. As a result of these checks, many menus remain the same size as before, one or two are fixed in height but are taller than they were before, some will expand to use as much of the available screen height as possible but remain the same width, and a special few expand both height- and width-wise to really take full advantage of your screen.


The menus that have changed the most are the maps. These now expand to fill as much of the screen as possible while still retaining their overall shape.

The Galaxy Map now fills as much of the screen as possible so that you can get a broader overview of where you are in the galaxy. The information panel to its right doesn't have all that much on it, so this doesn't expand. The other big change on the Galaxy Map is that navigation to a sector whose name you know is a lot easier than before. Just start typing the name of the sector you want to find and you will be taken there! If there are several sectors matching the letters you've typed then they will be listed in the information panel; you can either keep typing, or select on one of the names in the list using the normal mouse or keyboard menu controls. Pressing Escape or simply waiting a few seconds will clear the typed text and the list. One final, smaller change in the Galaxy Map is that sectors that are in a state of war are shown in orange.

The Sector Map also now fills as much of the screen as it can. Since the list of objects in a sector can be quite long, the panel to the right of the map itself expands to fill as much of the screen height as possible; it won't, however, overlap your radar, so it may sometimes be a little shorter than the map. Other than that the Sector Map hasn't changed significantly.

If you find that the new large maps sometime block your view too much then you can use the new Resize button (F5 by default) to switch between the old and new sizes. There's also a little resize icon in the bottom right corner of the map that you can click on with the mouse if you prefer.


Familiar menus that now make much more use of of the available screen height include:

• Property
• Trade
• Adjust Station Parameters
• Stock Exchange
• Best Buy/Sell
• Message Log
• Wings
• Controls
• AL Options
• Script Editor
• Mission Director

Like the maps, graphs are also displayed using as much of the available screen space as possible, but the side panel containing the description and key for the graph doesn't expand. You also can't resize graphs down to a smaller size, as this would make most of them pretty much unreadable!

Several menus have also had the same treatment applied to them that was given to the information panel to the right of the Sector Map. In other words, ships are listed next to their icons and more information is shown to help you identify them at a glance. Menus that have had this treatment include:

• Trade (for shipyards)
• Adjust Station Parameters (for the Player HQ)
• Landed Ships
• Owned Ships

[2.0] Oh, and the long-standing frustration of trying to type repeated characters in names and numbers has finally been laid to rest! No more "Thereshal*pause*lbewings".

Posted: Tue, 31. Jan 12, 12:24
by CBJ
Script Commands

With the player account now able to hold a lot more money, new script commands are required to allow scripts to interact with that account. Note that the old script commands to access the player account will still work, but that when reading the player account value using the old script command, any amount over 2 billion credits will be reported as exactly 2 billion credits. Use the new script commands to get the real value.

Code: Select all

• %0get billions of credits in player account
• %0get amount of credits under a billion in player account
• %0get full amount of credits in player account formatted as string: include separators %1, use millions suffix for very large numbers %2
• %0format large number pair as string: billions %1, units %2, include separators %3, use millions suffix for very large numbers %4
The custom menu system has been extended to give scripts even more control over the appearance and behaviour of custom menus.

Code: Select all

• add info line section to menu: %0
• add info line heading to menu: %0, heading=%1
• %0create menu return value: open menu, menu script=%1, script args=%2
• %0create menu return value: run script %1, script args=%2
• add trade bar to menu: %0, text=%1, min=%2, max=%3, current=%4, return value=%5, left text=%6, right text=%7
• add new grouping to menu: %0, text=%1, open=%2
• add end grouping to menu: %0
• set menu option: %0, maximum infolines=%1
• set menu option: %0, page up/down keys for info=%1
• %0create menu return value: command 'Open All Groups'
• %0create menu return value: command 'Close All Groups'
• add non selectable menu item: %0, text=%1
• set menu option: %0, use hover line=%1
• set menu option: %0, maximum menu height=%1 lines
The Script Editor has full access to the graph system. Graphs can be added to, and removed from, the list of available graphs for a given object or type of object, and the entries in that list call further scripts to display the actual graphs. Using the custom menu system, it is also possible for those scripts to present options screens prior to displaying the final data.

Code: Select all

• add player graph: script=%0 pageid=%1 textid=%2 group pageid=%3 group textid=%4 subgroup=%5 \(0-7\)
• remove player graph: script=%0 group pageid=%1 group textid=%2
• add class graph: class=%0 script=%1 pageid=%2 textid=%3 group pageid=%4 group textid=%5 subgroup=%6 \(0-7\)
• remove class graph: class=%0 script=%1 group pageid=%2 group textid=%3
• %0 add object graph: script=%1 pageid=%2 textid=%3 group pageid=%4 group textid=%5 subgroup=%6 \(0-7\)
• %0 remove object graph: script=%1 group pageid=%2 group textid=%3
• show graph using graph data array %0
Script commands can also interact, to a limited extent, with the Stock Exchange.

Code: Select all

• %0 set stock exchange unlock state: %1
• %1%0 get stock exchange unlock state
• %0 get all unlocked stock exchanges
• %1%0 get owned share count
• %0 set owned share count: %1
• set stock exchange corporate reports menu item: Enabled=%0
• set stock exchange company reports menu item: Enabled=%0
• set stock exchange commodity reports menu item: Enabled=%0
• %1%0 is stock exchange accessible
Some handy statistics used by the graph system and the Stock Exchange have been wrapped up into script commands to make the calculations quicker and easier. As a result, your scripts can also access this data.

Code: Select all

• %0get trade stats for sectors: %1, only include these wares: %2, treat docks as producers: %3, include player docks: %4
• %0get trade stats for sector: %1, only include these wares: %2, treat docks as producers: %3, include player docks: %4
[2.0] • %0get player ship usage time: %1
[2.0] • %0get player object killed count: %1
• %1%0 get player object count in sector: class=%2
Fleet control functionality is available through another series of script commands, giving you the option to customise and extend the behaviour of your fleets.

Code: Select all

• %1%0 get fleet ships: only currently with fleet: %2
• %0 set fleet leader: %1
• %0 remove from fleet
• %0 switch fleet leader to: %1
• %1%0 is in fleet
• %1%0 get fleet leader
• %1%0 is fleet leader
• %1%0 is currently with fleet
• %0 set with fleet: %1
The ongoing war between the Terrans and the Commonwealth races includes a certain amount of war state data. You can get information about the current state of the war, and identify ships and stations involved in the war, using a series of script commands. You cannot, however, influence the progress of the war this way.

Code: Select all

• %1%0 get WarObject ID
• %0get name of current War State
• %0get name of next expected War State \(final choice may differ!\)
• %0is player currently observing War State
• %0get progress of current War State
• %0get start time of current War State
• %0get end time of current War State \(may change!\)
• %0did player observe currently active War State
• %0get duration of War State %1
Some script commands have been added which relate to the script system itself. You can now set up custom options menus for your scripts and have them accessible from the main in-game options menu. You can also check for the existence of scripts, and have further options for assigning hotkeys to scripts.

Code: Select all

• add script options: script=%0 pageid=%1 textid=%2
• remove script options: script=%0
• %0does script exist: %1
• %0does script name exist: %1
• %0register hotkey: page=%1 id=%2, to call script %3
• %0get hotkey index, script: %1
• %0register hotkey: page=%1 id=%2, to call script name %3
• %0get hotkey index, script name: %1
There are now well over 150 different game parameters that can be adjusted through the globals.txt file. A new script command gives you access to those values. Note that there is a limitation to this script command, namely that it cannot tell you the internal default value used by the game if there is no corresponding entry in the file.

Code: Select all

• %0get global parameter value: parameter=%1 default=%2
Some script commands just don't fit neatly into any category. These mostly extend your ability to get information about the galaxy and the objects in it.

Code: Select all

• %0get ship class from subtype: %1
• %0get race id for race: %1
• %1%0 mine is armed
• %0set mine armed state to %1
[2.0] • %1%0get complex hangar
• %0find gate: flags=%1, refobj=%2, max dist=%3, refpos=%4 object check=%5
• %1%0 is gate/beacon: %2 jumpable
• %0get minimum, %1, %2, %3, %4, %5
• %1%0 fire all turrets on target: %2, next target filter=%3
• add trade rank based on profit: race=%0 profit=%1
• %1%0 is sector visible
• %0 set job override name: %1
• %0get bullet flags of laser %1 
• %0get colour code: red=%1 green=%2 blue=%3 transparency=%4
• %0get cluster sectors for race %1, startsector: %2, threshold: %3, only include known: %4

Posted: Tue, 31. Jan 12, 13:58
by CBJ
Mission Director

Like the Script Editor, the Mission Director too has been extended to cover relevant in-game functionality. At the same time we have also decided to give you access to our Mission Director debugging tools, to help you to develop your own missions more quickly and efficiently.

New actions that we have added are:

Code: Select all

[2.0] • <set_notoriety> - set the notoriety between non-player races
• <activate_job> - activate a job that is defined in the jobs file as dormant
• <set_war_reports> - enable or disable war reports (the player can override this and disable them completely)
• <set_override_name_flags> - set which parts of an object's standard name will be displayed and/or spoken
• <set_group_override_name_flags> - set which parts of the standard name will be displayed and/or spoken for all objects in a group
Actions that have been extended are:

Code: Select all

• <reward_player> - added a <war> node to adjust the player's "war score", i.e. their contribution to the war effort
• <create_ship> - added "safety" attribute to set whether ship should be moved to a "safe spot" or not on creation
• <find_object> - added "silent" attribute to supress errors when no object is found (applies to all similar actions)
• <find_object> - added "war" attribute to find only war/non-war objects (applies to all similar actions)
• <count_object> - added "silent" attribute to supress errors when no object is found (applies to all similar actions)
• <count_object> - added "war" attribute to count only war/non-war objects (applies to all similar actions)
• <set_objective> - added "active" attribute to make the objective the active one
• <set_state> - can also now be used to lock/unlock Stock Exchange stations
• <warp_object> - added "warp" attribute to determine whether warp effect should be shown
New conditions are:

Code: Select all

• <war_score_changed> - event raised when the player influences a change in the current "war score"
New variables that are available are:

Code: Select all

• {} - billions of credits in the player's main account
• {} - billions of credits in the player's main account, formatted using digit separators
• {} - amount of credits under a billion in the player's main account
• {} - amount of credits under a billion in the player's main account, formatted using digit separators
• {} - full amount of credits in the player's main account, formatted without digit separators
• {} - full amount of credits in the player's main account, formatted with digit separators
• {} - whether speech is currently being played
• {} - priority of currently active speech
• {object.subtype@object} - internal subtype code for object
• {object.warobjectid@object} - WarObject ID for object
• {object.locked@stockexchange} - for Stock Exchange stations, whether it is currently locked
• {object.locked.north@hub} - for the HUB, whether the specified gate is currently locked
[2.0] • {object.realigntime@hub} - earliest time of next gate realignment
• {lookup.type.subtype@typecode} - internal subtype code for typecode
• {lookup.subtype@subtype} - internal subtype code for specified subtype value
• {war.state@statename} - id of specified war state
• {} - name of specified war state
• {war.state.duration@statename} - duration of specified war state
• {war.currentstate} - current war state
• {war.currentstate.starttime} - time current war state started
• {war.currentstate.endtime} - time current war state is expected to end
• {war.currentstate.duration} - total expected duration of current war state
• {war.currentstate.observed} - whether the current war state has been observed by the player (directly or via the map)
• {war.currentstate.progress} - percentage progress of current war state
• {} - name of next expected war state
• {war.nextstate.duration} - total duration of next expected war state
One other change that we've made is to allow Mission Director variables to be used in fields that take boolean values. Examples of how this can be useful can be seen in the various standard and plot missions that are supplied with the game.

Posted: Tue, 31. Jan 12, 14:35
by CBJ

Those of you who want to create your own graphs will need a little more information about how to do so.

Warning: this description is not for the faint-hearted!

The script command to create a graph accepts a single parameter, which is an array containing all the data required to display the graph. The format of the array is as follows:

Code: Select all

graph = { graph-data [, labels [, x-axis [, y-axis [, series-labels [, series-colours ] ] ] ] ] }

graph-data = series-data | { series-data [, series-data [, series-data ... ] ] }
labels = { [ title [, x-axis-label [, y-axis-label [, descriptive-text ] ] ] ] }
x-axis, y-axis = item-labels | axis-range
series-labels { [ series-label [, series-label [, series-label ... ] ] ] }
series-colours { [ series-colour [, series-colour [, series-colour ... ] ] ] }

series-data = { x0, y0 , x1, y1 [, x2, y2 [, x3, y3 ... ] ]  }
xN, yN = number | item-label

item-labels = { [ item-label [, item-label [, item-label ... ] ] ] }
axis-range = { [ min [, max [, step [, factor [, divisor [, format]]]] ] ] }

format = sprintf-format | @strftime-format

series-colour = RGB-colour
x-axis-label, y-axis-label, descriptive-text, series-label, item-label, sprintf-format, strftime-format = text | "{pageid,textid}" | { pageid, textid }
pageid, textid, min, max, step, factor, divisor = number
An example graph data array, which produces a vertical bar graph:

Code: Select all

  // graph data
    // series 1 data
    { "a", 3, "b", 2, "c", 8},
    // series 2 data
    { "a", 7, "b", 3, "c", 5}
  // labels
  { "Title", "X-Axis", "Y-Axis", "This is a sample graph" }
  // x axis (named items)
  { "a", "b", "c" }
  // y axis (numbered with defined start/end but automatic step)
  { 0, 10 }
  // series names
  { "Series 1", "Series 2" }
  // series colours (red and yellow)
  { 0xffd20101, 0xffd2d201 }
The graph display is designed to do as much as possible automatically, so there are very few optional settings. Three basic graph styles are provided; bar graphs, line graphs and plots, with a number of sub-styles. The graph chooses between them automatically depending on the data provided in the array.

A bar graph will be displayed if one (and only one) of the axis datasets contains item labels (text) rather than axis range values (numbers). If it's the x-axis dataset that contains item labels then a vertical bar graph will be displayed; if it's the y-axis then you'll get a horizontal bar graph. With small datasets the bars for different series will be displayed alongside one another, but if they get too narrow then the display will automatically switch to an overlapping format. If there are simply too many bars then they may overflow into the next column and start getting mixed up; there is nothing you can do about this other than reduce the amount of data you are trying to display.

A line graph will be displayed if both of the axis datasets contain axis range values rather than labels and the values on the x-axis of the graph's main point data are in ascending order, i.e. no x value is lower than the previous x value in the same series. If the graph ends up such that several points on a line graph would be very close together then the "x" marks for all points on the graph will be omitted, and just lines drawn.

A simple plot of points will be displayed if both of the axis data arrays contain axis range values rather than labels, but the values on the x-axis of the graph's main point data are not in ascending order. In this case all points are plotted in their exact location, so points in one series can hide points in another. A plot of points will also be displayed if both of the axis data arrays contain item labels (text). In this case point positions are offset slightly between series, within their rows and columns, since the exact position is less important. If there are too many series then they will start to overlap and cease to be easily distinguished again.

For axes defined by item labels, you will need to make sure that all the items you want to be displayed are listed. Points in the graph which do not match any of the item labels will not be displayed, and rows or columns which do not have any corresponding points will remain empty.

If no axis data is provided, or if only a partial set of axis range values is supplied, then the graph display will attempt to calculate sensible axis range values and step size using graph data points provided. If no axis data is provided and the graph data for a given axis contains only names then the graph will use those names and generate a bar graph, or a plot if the graph data for both axes just contains names. If there are any numbers then it will instead work out minimum and maximum values, and try to work a sensible scale of value labels between those. Named values on axes otherwise containing numbers will give strange results!

Note that minimum and maximum axis values will use the full available space, so minimum and maximum values will be at the axis and the side of the graph respectively. For bar graphs this will result in bars whose value is equal to the minimum being invisible, so you will normally want to provide at least a minimum value, lower than any data value, in this case. If you do provide a minimum then values which are less than that minimum will not be visible in either bar graphs or plots. If you provide a maximum axis range value then points on a plot or line graph which are beyond that maximum will not be drawn, while bars on a bar graph will be shown with a few stripes at the end to show that they exceed the maximum value. Lines on a line graph will be drawn even if they go out of range, either below the minimum or above the maximum, and even if that means drawing over the menu title and border!

For numeric axes, in addition to the minimum, maximum and step size, you can also specify a factor and divisor to scale the axis labels up or down. For example, the x axis could use data to an accuracy of 1 minute but the axis labels could display hours by supplying a factor of 1 and a divisor of 60. You can also specify a formatting string indicating how the number should be displayed. As with labels, the format string can be supplied as raw text, a text entry format string in the form "{pageid, textid}" or an array of two elements containing the pageid and textid as integers. If not supplied, the graph uses the standard sprintf "%d" format string to format the number, but this can be replaced with any sprintf format string. If the format string starts with an "@" symbol, then the rest of the format string is instead interpreted as a strftime format string, allowing the axis label to display a variety of date formats. If the "@" symbol has no format string following it then the standard in-game date format for the game's current language is used.

The graph will try to adjust its size to accommodate labels, but space is limited so you need to avoid using long labels in most places. Labels associated with the y axis, both the main axis label and the item labels, have some flexibility but will cause the graph to get narrower. There is plenty of room for the main x axis label, but the item labels for this axis are particularly limited. To reduce the impact of this, the graph will automatically use two lines of text and alternate between them if the labels are too wide to fit in the available space. If this is still insufficient then item labels will simply overlap. Series labels must fit on one line in the information panel, but the descriptive text will flow across as many lines as required.

Note that when choosing series colours, you may find the new script command to get a colour code from red, green and blue components useful.

If you've read this far and are still conscious then congratulations, and good luck with creating your own graphs!