Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Var/Agent Command
  • Var/Agent
  • Var/Table
  • Var/Array/Table
  • Var/LoadoutRet
  • Var/Merchant
  • Var/Dealer
  • Var/Merchant/Dealer
  • Var/CarrierRole
  • Var/CommandMenu
  • Var/Galaxy SubType
  • Var/Main Type
  • Var/Available Ware
  • Var/Space Object
  • Var/Player Station Type
  • Var/Property Group
  • Var/Turret Command
  • Var/Object/Turret Command
  • Var/HSAP
  • Var/Time
  • Var/Retired Agents
  • Var/Laser
  • Var/Shield
  • Var/Missile Type
  • Var/Goods
  • Var/Equipment
  • Var/XMLData
  • Var/Ship Command
  • Var/Custom Wing

Diplomacy Tasks

With the new diplomacy system, you can add your own tasks, this works similar to the command console custom commands where you first register a new command, then set the global map, to map that command with a script. To get input for the script, you can also assign a menu script, this will run the menu using the new input system then send the final arguments onto the diplomacy script. Diplomacy command scripts have the first argument as the Diplomat object that's running the command.

To add a new command, you use:

Code Block
themeMidnight
<RetVar> set agent custom command: script=<scriptname>, pageid=<number>, textid=<number>
<RetVar> set agent custom command: script=<scriptname>, pageid=<number>, textid=<number>, menuscript=<scriptname>, cmdcheck=<boolean>

The return value is the id of the command that's added, with the text and page id of the command. The menu script is the event script to create a menu for input.

The cmdcheck boolean will send the "cmdcheck" event to the menu script, which allows you to determine if the command should be available or not.
You will need to add 3 text entries for the agent command, the Command name, the Command Short Description, and the Command Long Description. These are the text id, text id + 1 and text id + 2.

The diplomacy menu event scripts have a few additional states that control how the command is displayed in the diplomacy menu

The cmdcheck event is sent when the menu is displayed, this works the same as the command console cmdcheck scripts you can use, returning one of the CmdConCheck constants. This event is only sent if the cmdcheck boolean value was set when creating the command, otherwise it will be set to CmdConCheck.Available.

The event "influence" displays the amount of influence need for the command. You can return a value, or you can use one of the script commands for creating the return value, these allow you to specify a range or a minimum amount.
The event "isspy" determines if its a espionage mission, these are displayed in a separate section in the diplomacy menu. Simply return TRUE.
The event "allowmultiple" determines if the command can stack multiple tasks, the return should be a string. This string is displayed as a description in the command menu.

There are also some script commands available to display the status of the current agent.

Code Block
themeMidnight
<Agent> set agent task progress: <number>
This displays the current task progress, the number is the percentage of the bar to display

 

Code Block
themeMidnight
<Agent> set agent task status: <string>
This displays a status string for the agent (what the agent is currently doing)

 

Code Block
themeMidnight
<Agent> set agent start time: <boolean>
This displays a timer instead of the progress bar (use this for commands that run permanently)