Due to a sudden burst in spammer activity, account creation has been temporarily disabled. Sorry for the inconvenience to any new potential contributors.

Option

From AGEWiki

Jump to: navigation, search

These are player-selectable choices that appear in the Ledger during gameplay.

Not all scenarios contain selectable options.

Contents

The Selection Value of an Option

In the game, when a player chooses an option by clicking on it, a "selection value" is set. This value is evaluated by the command CheckOption

By default, any option not chosen has the selection value = 0
A "simple option" in the ledger when chosen has a value = 1
A "Multiple Choice" event (really an option), the value is set equal to the choice taken (1,2,3 etc)

Valid Options Categories

Valid GameActors

Valid Aliases:

$gmaOptionMil
$gmaOptionVar
$gmaOptionDip
$gmaOptionCol
$gmaOptionTech
$gmaOptionTrade
$gmaOptionGov
$gmaOptionSoc
$gmaOptionRel
$gmaOptionInd
$gmaOptionNav
$gmaOptionPop
$gmaOptionReinf
$gmaOptionPol
$gmaOptionFin

To determine which pages are valid for a game, examine contents of UserInterface.opt (found in \Settings)

Example from RUS:

// Game Option:
ledGameOptVal1 = $gmaOptionReinf // Value for Game Options type 1
ledGameOptVal2 = $gmaOptionPol // Value for Game Options type 2
ledGameOptVal3 = $gmaOptionDip // Value for Game Options type 3
ledGameOptVal4 = $gmaOptionVar // Value for Game Options type 4
ledGameOptVal5 = -1 // Value for Game Options type 5
ledGameOptVal6 = -1 // Value for Game Options type 6
ledGameOptVal7 = -1 // Value for Game Options type 7
ledGameOptVal8 = -1 // Value for Game Options type 8


Military Options Screen ($gmaOptionMil)

The Military Options Screen contains a description of all Military Options open to a player along with the cost of these options (in terms of Victory Points). These options will vary according to the scenario being played. Not all scenarios contain selectable Military Options.

The Message Log indicates when Military Options are (or become) available. Players take advantage of these options by left-clicking the option text on the Ledger screen. A signature appears next to the option to indicate that it has been selected. Certain options may be selected multiple times (as long as the player can afford the associated costs).

Diplomatic Options Screen ($gmaOptionDip)

The Diplomatic Options Screen contains a description of all scenario options open to a player along with the cost of these options (in terms of Victory Points). These options will vary according to the scenario being played. Not all scenarios contain selectable Options.

See Simple Option Example Spreadsheet

Options Cost

In games prior to the release of AJE, the "cost" to implement an option had to be described in a separate tooltip text.

This requires the Script Writers to make careful checking of text vs. options events.

Imbedded Options Costs

In game engines dated on or after June 27, 2012:

It is now possible to have the code 'understand' the price of an option you click on. Before, you checked 'recruit German cavalry' and the costs were not updated anywhere (except in hosting where the expense was done). Now, the code has a means to understand the cost, and so your current money, morale, etc. is reduced immediately in the interface.

Also, you now see in the tooltip of the option, the cost is indicated. So there is no need to put it 'hard coded' in the tooltip text localizations.

Here is an example of the modified German Cav option from AJE:

ChangeActorPool = $gmaOptionMil;MaxUse;1;ImageID;Event-img_Mercenary08.png; Money;10;EP;5; 
Title;opt_title_SEV_Hire_GermanMercCav;MsgString;opt_desc_SEV_Hire_GermanMercCav;ToolString;
opt_hint_SEV_Hire_GermanMercCav;SubType;SEV_Hire_GermanMercCav;

As you see, nothing complicated, you add an entry and a value.

The valid assets that are understood are:

Money, VP, Prestige, Morale, EP, Inflation, Conscript, Warsupply, WSU, Capital, Steel, Coal, Good, Goods, Mineral, Oil, Diplomat

Options Costs Scripting Commands

With the new imbedded costs, there are now 2 new Script Commands

CanPayOption
PayOption

Thus, when you want a faction to spend resources, you don't have to make a series of EvalMoney, etc. and then in actions block a series of ChangeMoneyPool, etc. Instead you can check if an option can be paid, and then in the Actions block you make the faction pay. This allow also a better consistency, as the only costs you have to enter is when you define an actor. When you spend resources, you no longer have to specify a cost, that sometime differ with the initial cost because of an unspotted change in another line.

The correct usage is to always use CanPayOption in the Conditions block, if you intend to use PayOption in the Actions block, except if you plan to use PayOption with ForceSpend.


Multiple Choice Events

MC events are shown as pop-up messages in the interface. They are scripted with the same command as the Historical options, except that you'll provide several text and tooltips for the command. You'll also need in addition to create a GenMCEvent command. As for their processing, it follows the same logic as single choice event: instead of reacting to one possibility (one event dealing with the fact the player clicked on the option), you'll need to check the choice made by the player and create an event for each possible choice.

See MC Event Example Spreadsheet

Multi-choices Events in VGN

  1. Its also possible in VGN (only) to have MC options which are not shown in the message panel, but instead in a ledger screen. Several screens of the ledger handle one type of historical options (example the Goverment screen handle Laws & Reforms options). In this case, you can create a MC event which is not of the MCEvent type ($gmaOptionGov e.g), and don't need to have a link created toward the message panel with a GenMCEvent command. The MC option will appears only on the ledger screen and will generate a pop-up when clicked upon.
  2. Valid GameActors for VGN ledger MC Events are:
$gmaOptionMil
$gmaOptionVar
$gmaOptionDip
$gmaOptionCol
$gmaOptionTech
$gmaOptionTrade
$gmaOptionGov
$gmaOptionSoc
$gmaOptionRel
$gmaOptionInd
$gmaOptionNav
$gmaOptionPop
$gmaOptionReinf
$gmaOptionPol
$gmaOptionFin
$gmaMCEvent
$gmaNotify
See Ledger Multiple Choice Option Example Spreadsheet

AACW Options System

AGEOD's American Civil War (AACW) has a significantly different option structure (and are basically deprecated) See the AACW Wiki for specifics

Scripting and commands used

  1. You have first to define the option, so it is shown to the player. For that you'll need to issue a ChangeActorPool command, specifying various parameters, for example the text and tooltip of the option. Understand though that this command does not handle the outcome, when the player activate the option.
    1. For MC options, you also have to issue a GenMCEvent command.
  2. That the option is single choice or multi-choices, the logic is the same: Once the option is defined, it is shown to the player in the interface. If this is a single choice option, it will be shown in a dedicated page of the ledger. if this is a MC option, it will show as a red message (pop-up) in the Messages Panel.
  3. The outcome of an option is handled within the script engine, during hosting, but only if you planned for that via writing additional events. If you don't, as the definition of an option with ChangeActorPool doesn't handle its outcome (what happens when the player clicks on it), then nothing will happen. This is an important concept: options are handled by a script you do, not by the code itself.
  4. In the case of a single choice event, you'll thus make a single event. First, you'll want to check if the Actor is enabled, i.e if the option was defined before anything, for that, use ActorEnabled. Then you'll check if the player (or AI) has chosen the option (some can be shown for a long time before the player chose it). For this test, use CheckOption. A value of 0 means the option is not chosen, a value of 1 means choice 1 (the only choice for single choice options) is chosen. For a MC event, this is really the same logic, with a value of 2 checking that choice 2 is made, and so on.
  5. If both conditions are met, then you'll handle the outcome of the event in the Actions block, as with other events. In addition to the script you'll add to handle the game effect, it will be necessary, most of the time, to disable the option. Use ChangeActorPool (really a Set in fact) to set the MaxUse of the option to 0, thus disabling it. Failing that, and the options will remain the next turn (This can be on purpose, to have an option that can be activated each turn).
  6. For a MC event, you'll need one event for each possible choice, with also perhaps an event handling choice 0, i.e the absence of choice, is encountered (say the player forgot or did not want to chose anything in your MC event!).
  7. The AI logic will also be handled by you, by event. Often these events are called 'AIActivate', i.e you create an event deciding when the AI choose an option, and at which level. The rest will be the same, with the events handling the outcome applying to the AI as if a human player.
  8. You can also encounter an event structure called 'Regen', standing for 'Regenerate', it is an event handling the logic of regenerating, i.e representing, the event (with a ChangeActorPool with a MaxUse of 1).
Forums