Difference between revisions of "AI War 2:Tutorial Step Conditions"

From Arcen Wiki
Jump to navigation Jump to search
Line 20: Line 20:
 
Here's a full list of all the conditions that can be added to any tutorial step, and the data that goes with them, among some other things:
 
Here's a full list of all the conditions that can be added to any tutorial step, and the data that goes with them, among some other things:
  
=== PlayerViewIsOnGalaxyMap ===
+
=== Player View ===
 +
 
 +
==== PlayerViewIsOnGalaxyMap ====
  
 
Is true if the player is looking at the galaxy map.  There are no special parameters to this one.
 
Is true if the player is looking at the galaxy map.  There are no special parameters to this one.
  
=== PlayerViewIsOnAnyPlanet ===
+
==== PlayerViewIsOnAnyPlanet ====
  
 
Is true if the player is NOT looking at the galaxy map (aka is looking at some planet).  There are no special parameters to this one.
 
Is true if the player is NOT looking at the galaxy map (aka is looking at some planet).  There are no special parameters to this one.
  
=== PlayerHasSidebarMenuOpen_Local===
+
==== PlayerViewIsOnSpecificPlanet ====
 +
 
 +
Is true if the player is in the planetary view (not galaxy map) looking at a specific planet.
 +
 
 +
* Parameters:
 +
** planet_by_index: starting at 0, references planets in the order they were added to the map.  One way of saying which planet you mean.
 +
** planet_by_name: the name of the planet, instead.  An easier way of saying which planet you mean, unless you're letting it name planets procedurally (in which case you have no idea what their name is).
 +
** Use only ONE of the two parameters above.
 +
 
 +
* Text properties available:
 +
** PlanetName: assuming that this is the first condition, you can use {c1.PlanetName} in your text to show the name of this planet.  If it was the second condition you'd use c2, etc.
 +
 
 +
=== Player Sidebar Status ===
 +
 
 +
==== PlayerHasSidebarMenuOpen_Local====
  
 
Is true if the player has the Local tab open on the sidebar menu.  There are no special parameters to this one.
 
Is true if the player has the Local tab open on the sidebar menu.  There are no special parameters to this one.
  
=== PlayerHasSidebarMenuOpen_Build===
+
==== PlayerHasSidebarMenuOpen_Build====
  
 
Is true if the player has the Build tab open on the sidebar menu.  There are no special parameters to this one.
 
Is true if the player has the Build tab open on the sidebar menu.  There are no special parameters to this one.
  
=== PlayerHasSidebarMenuOpen_Tech===
+
==== PlayerHasSidebarMenuOpen_Tech====
  
 
Is true if the player has the Tech tab open on the sidebar menu.  There are no special parameters to this one.
 
Is true if the player has the Tech tab open on the sidebar menu.  There are no special parameters to this one.
  
=== PlayerHasSidebarMenuOpen_Hacking===
+
==== PlayerHasSidebarMenuOpen_Hacking====
  
 
Is true if the player has the Hacking tab open on the sidebar menu.  There are no special parameters to this one.
 
Is true if the player has the Hacking tab open on the sidebar menu.  There are no special parameters to this one.
  
=== PlayerHasSidebarMenuOpen_Merc===
+
==== PlayerHasSidebarMenuOpen_Merc====
  
 
Is true if the player has the Mercenaries tab open on the sidebar menu.  There are no special parameters to this one.
 
Is true if the player has the Mercenaries tab open on the sidebar menu.  There are no special parameters to this one.
  
=== PlayerHasSidebarMenuOpen_Intel===
+
==== PlayerHasSidebarMenuOpen_Intel====
  
 
Is true if the player has the Intel tab open on the sidebar menu.  There are no special parameters to this one.
 
Is true if the player has the Intel tab open on the sidebar menu.  There are no special parameters to this one.
  
=== PlayerHasSidebarMenuOpen_Fleets===
+
==== PlayerHasSidebarMenuOpen_Fleets====
 +
 
 +
Is true if the player has the Fleets tab open on the sidebar menu.  There are no special parameters to this one
 +
 
 +
=== Player Ship Counts Anywhere ===
 +
 
 +
==== PlayerHasCountOfSpecificShipAnywhere ====
 +
 
 +
Is true if the player has at least X ships of the specified type anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
 +
 
 +
* Parameters:
 +
** entity_type: one of the types of ship/structure, by the name property in the xml.  "CombatEngineer" would be one example.
 +
** count: the number of this type of ship that are required.
 +
 
 +
* Text properties available:
 +
** EntityName: this is the display_name of the ship/structure that you asked it to find.
 +
** CountRequired: this is just equal to count, aka how many you said you want.
 +
** CountFound: this is how many it has actually found.
 +
** CountRemaining: this is how many fewer have been found than are required.  Will not go less than 0.
 +
 
 +
==== PlayerHasCountOfSpecialEntityTypeAnywhere ====
 +
 
 +
Is true if the player has at least X ships of the specified SpecialEntityType anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
 +
 
 +
* Parameters:
 +
** special_entity_type: one of the [[AI_War_2:_SpecialEntityType|SpecialEntityType enum]] values, such as "Frigate."
 +
** count: the number of this type of ship that are required.
 +
 
 +
* Text properties available:
 +
** CountRequired: this is just equal to count, aka how many you said you want.
 +
** CountFound: this is how many it has actually found.
 +
** CountRemaining: this is how many fewer have been found than are required.  Will not go less than 0.
 +
 
 +
==== PlayerHasCountOfShipTagAnywhere ====
 +
 
 +
Is true if the player has at least X ships of the specified tag anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
 +
 
 +
* Parameters:
 +
** ship_tag: any arbitrary "tag" that is applied to a ship/structure via the "tags" xml attribute.
 +
** count: the number of this type of ship that are required.
  
Is true if the player has the Fleets tab open on the sidebar menuThere are no special parameters to this one.
+
* Text properties available:
 +
** CountRequired: this is just equal to count, aka how many you said you want.
 +
** CountFound: this is how many it has actually found.
 +
** CountRemaining: this is how many fewer have been found than are requiredWill not go less than 0.
  
=== PlayerViewIsOnSpecificPlanet ===
+
==== PlayerHasCountOfAnyShipAnywhere ====
  
Is true if the player is in the planetary view (not galaxy map) looking at a specific planet.
+
Is true if the player has at least X ships of ANY type anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
  
 
* Parameters:
 
* Parameters:
** planet_by_index: starting at 0, references planets in the order they were added to the map.  One way of saying which planet you mean.
+
** count: the number of ship that are required.
** planet_by_name: the name of the planet, instead.  An easier way of saying which planet you mean, unless you're letting it name planets procedurally (in which case you have no idea what their name is).
 
** Use only ONE of the two parameters above.
 
  
 
* Text properties available:
 
* Text properties available:
** PlanetName: assuming that this is the first condition, you can use {c1.PlanetName} in your text to show the name of this planetIf it was the second condition you'd use c2, etc.
+
** CountRequired: this is just equal to count, aka how many you said you want.
 +
** CountFound: this is how many it has actually found.
 +
** CountRemaining: this is how many fewer have been found than are requiredWill not go less than 0.
 +
 
 +
=== Player Ship Counts On Specific Planets ===
  
=== PlayerHasCountOfSpecificShipAnywhere ===
+
==== PlayerHasCountOfSpecificShipOnPlanet ====
  
 
Is true if the player has at least X ships of the specified type anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
 
Is true if the player has at least X ships of the specified type anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
  
 
* Parameters:
 
* Parameters:
 +
** planet_by_index: starting at 0, references planets in the order they were added to the map.  One way of saying which planet you mean.
 +
** planet_by_name: the name of the planet, instead.  An easier way of saying which planet you mean, unless you're letting it name planets procedurally (in which case you have no idea what their name is).
 +
** Use only ONE of the two parameters above.
 
** entity_type: one of the types of ship/structure, by the name property in the xml.  "CombatEngineer" would be one example.
 
** entity_type: one of the types of ship/structure, by the name property in the xml.  "CombatEngineer" would be one example.
 
** count: the number of this type of ship that are required.
 
** count: the number of this type of ship that are required.
  
 
* Text properties available:
 
* Text properties available:
 +
** PlanetName: assuming that this is the first condition, you can use {c1.PlanetName} in your text to show the name of this planet.  If it was the second condition you'd use c2, etc.
 
** EntityName: this is the display_name of the ship/structure that you asked it to find.
 
** EntityName: this is the display_name of the ship/structure that you asked it to find.
 
** CountRequired: this is just equal to count, aka how many you said you want.
 
** CountRequired: this is just equal to count, aka how many you said you want.
Line 82: Line 146:
 
** CountRemaining: this is how many fewer have been found than are required.  Will not go less than 0.
 
** CountRemaining: this is how many fewer have been found than are required.  Will not go less than 0.
  
=== PlayerHasCountOfSpecialEntityTypeAnywhere ===
+
==== PlayerHasCountOfSpecialEntityTypeAnywhere ====
  
 
Is true if the player has at least X ships of the specified SpecialEntityType anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
 
Is true if the player has at least X ships of the specified SpecialEntityType anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
Line 95: Line 159:
 
** CountRemaining: this is how many fewer have been found than are required.  Will not go less than 0.
 
** CountRemaining: this is how many fewer have been found than are required.  Will not go less than 0.
  
=== PlayerHasCountOfShipTagAnywhere ===
+
==== PlayerHasCountOfShipTagAnywhere ====
  
 
Is true if the player has at least X ships of the specified tag anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
 
Is true if the player has at least X ships of the specified tag anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
Line 108: Line 172:
 
** CountRemaining: this is how many fewer have been found than are required.  Will not go less than 0.
 
** CountRemaining: this is how many fewer have been found than are required.  Will not go less than 0.
  
=== PlayerHasCountOfAnyShipAnywhere ===
+
==== PlayerHasCountOfAnyShipAnywhere ====
  
 
Is true if the player has at least X ships of ANY type anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.
 
Is true if the player has at least X ships of ANY type anywhere in the galaxy.  DOES count ships inside transports, stacks, undeployed drones, etc.

Revision as of 12:11, 2 October 2019

Using A Conditional

Here's an example of some xml that has a tutorial step with a single condition in it:

    <tutorial_step text_to_show="Please switch your view over to look at the planet {c1.PlanetName}!">
     <condition type="PlayerViewIsOnSpecificPlanet" planet_by_index="0"/>
    </tutorial_step>

You can have up to 9 conditions per step (though goodness, more than 1-3 is excessive). The conditions can have data on them accessed based on their number, so for instance the planet that is referenced here is the 0th planet (the first one in the galaxy). The first condition is c1, so using c1.PlanetName in curly brackets in the text_to_show on the tutorial step will write out the name of the planet. If the first condition didn't exist, it would just write the curly bracketed text out. If the first condition didn't link to a planet, it would just write null.

The items below specify what extra data needs to be sent to the condition other than just the type, if any. And then they also specify what properties you can access for textual purposes, again if any. the first big bunch of conditions are not really specific to any special location or ship or whatever that might be unique, so they neither have parameters nor have any text you can get about them.

It's assumed that you'll write some flavor text in the text_to_show, so the actual conditions are invisible rather than trying to write out auto-generated junky sort of text about what your conditions are for the next step. A lot of the conditions in the game are things like "ship doesn't exist here for the enemy," and that could be because you captured it or hacked it or whatever else, and you can tell the players what you want them to do in your own words.

It's also worth noting that in a lot of cases you can refer to things like planets by one of two methods, but you don't need to do both. You can refer to them by index (starting at 0), or you can refer to them by name. If you've hand-designed a galaxy and know the names, then it's a lot easier to use the names to match. Much easier to follow. If you're letting it auto-generate the names of planets, then you probably want to use indexes instead.

Actual Conditions

Here's a full list of all the conditions that can be added to any tutorial step, and the data that goes with them, among some other things:

Player View

PlayerViewIsOnGalaxyMap

Is true if the player is looking at the galaxy map. There are no special parameters to this one.

PlayerViewIsOnAnyPlanet

Is true if the player is NOT looking at the galaxy map (aka is looking at some planet). There are no special parameters to this one.

PlayerViewIsOnSpecificPlanet

Is true if the player is in the planetary view (not galaxy map) looking at a specific planet.

  • Parameters:
    • planet_by_index: starting at 0, references planets in the order they were added to the map. One way of saying which planet you mean.
    • planet_by_name: the name of the planet, instead. An easier way of saying which planet you mean, unless you're letting it name planets procedurally (in which case you have no idea what their name is).
    • Use only ONE of the two parameters above.
  • Text properties available:
    • PlanetName: assuming that this is the first condition, you can use {c1.PlanetName} in your text to show the name of this planet. If it was the second condition you'd use c2, etc.

Player Sidebar Status

PlayerHasSidebarMenuOpen_Local

Is true if the player has the Local tab open on the sidebar menu. There are no special parameters to this one.

PlayerHasSidebarMenuOpen_Build

Is true if the player has the Build tab open on the sidebar menu. There are no special parameters to this one.

PlayerHasSidebarMenuOpen_Tech

Is true if the player has the Tech tab open on the sidebar menu. There are no special parameters to this one.

PlayerHasSidebarMenuOpen_Hacking

Is true if the player has the Hacking tab open on the sidebar menu. There are no special parameters to this one.

PlayerHasSidebarMenuOpen_Merc

Is true if the player has the Mercenaries tab open on the sidebar menu. There are no special parameters to this one.

PlayerHasSidebarMenuOpen_Intel

Is true if the player has the Intel tab open on the sidebar menu. There are no special parameters to this one.

PlayerHasSidebarMenuOpen_Fleets

Is true if the player has the Fleets tab open on the sidebar menu. There are no special parameters to this one

Player Ship Counts Anywhere

PlayerHasCountOfSpecificShipAnywhere

Is true if the player has at least X ships of the specified type anywhere in the galaxy. DOES count ships inside transports, stacks, undeployed drones, etc.

  • Parameters:
    • entity_type: one of the types of ship/structure, by the name property in the xml. "CombatEngineer" would be one example.
    • count: the number of this type of ship that are required.
  • Text properties available:
    • EntityName: this is the display_name of the ship/structure that you asked it to find.
    • CountRequired: this is just equal to count, aka how many you said you want.
    • CountFound: this is how many it has actually found.
    • CountRemaining: this is how many fewer have been found than are required. Will not go less than 0.

PlayerHasCountOfSpecialEntityTypeAnywhere

Is true if the player has at least X ships of the specified SpecialEntityType anywhere in the galaxy. DOES count ships inside transports, stacks, undeployed drones, etc.

  • Parameters:
    • special_entity_type: one of the SpecialEntityType enum values, such as "Frigate."
    • count: the number of this type of ship that are required.
  • Text properties available:
    • CountRequired: this is just equal to count, aka how many you said you want.
    • CountFound: this is how many it has actually found.
    • CountRemaining: this is how many fewer have been found than are required. Will not go less than 0.

PlayerHasCountOfShipTagAnywhere

Is true if the player has at least X ships of the specified tag anywhere in the galaxy. DOES count ships inside transports, stacks, undeployed drones, etc.

  • Parameters:
    • ship_tag: any arbitrary "tag" that is applied to a ship/structure via the "tags" xml attribute.
    • count: the number of this type of ship that are required.
  • Text properties available:
    • CountRequired: this is just equal to count, aka how many you said you want.
    • CountFound: this is how many it has actually found.
    • CountRemaining: this is how many fewer have been found than are required. Will not go less than 0.

PlayerHasCountOfAnyShipAnywhere

Is true if the player has at least X ships of ANY type anywhere in the galaxy. DOES count ships inside transports, stacks, undeployed drones, etc.

  • Parameters:
    • count: the number of ship that are required.
  • Text properties available:
    • CountRequired: this is just equal to count, aka how many you said you want.
    • CountFound: this is how many it has actually found.
    • CountRemaining: this is how many fewer have been found than are required. Will not go less than 0.

Player Ship Counts On Specific Planets

PlayerHasCountOfSpecificShipOnPlanet

Is true if the player has at least X ships of the specified type anywhere in the galaxy. DOES count ships inside transports, stacks, undeployed drones, etc.

  • Parameters:
    • planet_by_index: starting at 0, references planets in the order they were added to the map. One way of saying which planet you mean.
    • planet_by_name: the name of the planet, instead. An easier way of saying which planet you mean, unless you're letting it name planets procedurally (in which case you have no idea what their name is).
    • Use only ONE of the two parameters above.
    • entity_type: one of the types of ship/structure, by the name property in the xml. "CombatEngineer" would be one example.
    • count: the number of this type of ship that are required.
  • Text properties available:
    • PlanetName: assuming that this is the first condition, you can use {c1.PlanetName} in your text to show the name of this planet. If it was the second condition you'd use c2, etc.
    • EntityName: this is the display_name of the ship/structure that you asked it to find.
    • CountRequired: this is just equal to count, aka how many you said you want.
    • CountFound: this is how many it has actually found.
    • CountRemaining: this is how many fewer have been found than are required. Will not go less than 0.

PlayerHasCountOfSpecialEntityTypeAnywhere

Is true if the player has at least X ships of the specified SpecialEntityType anywhere in the galaxy. DOES count ships inside transports, stacks, undeployed drones, etc.

  • Parameters:
    • special_entity_type: one of the SpecialEntityType enum values, such as "Frigate."
    • count: the number of this type of ship that are required.
  • Text properties available:
    • CountRequired: this is just equal to count, aka how many you said you want.
    • CountFound: this is how many it has actually found.
    • CountRemaining: this is how many fewer have been found than are required. Will not go less than 0.

PlayerHasCountOfShipTagAnywhere

Is true if the player has at least X ships of the specified tag anywhere in the galaxy. DOES count ships inside transports, stacks, undeployed drones, etc.

  • Parameters:
    • ship_tag: any arbitrary "tag" that is applied to a ship/structure via the "tags" xml attribute.
    • count: the number of this type of ship that are required.
  • Text properties available:
    • CountRequired: this is just equal to count, aka how many you said you want.
    • CountFound: this is how many it has actually found.
    • CountRemaining: this is how many fewer have been found than are required. Will not go less than 0.

PlayerHasCountOfAnyShipAnywhere

Is true if the player has at least X ships of ANY type anywhere in the galaxy. DOES count ships inside transports, stacks, undeployed drones, etc.

  • Parameters:
    • count: the number of ship that are required.
  • Text properties available:
    • CountRequired: this is just equal to count, aka how many you said you want.
    • CountFound: this is how many it has actually found.
    • CountRemaining: this is how many fewer have been found than are required. Will not go less than 0.