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

From Arcen Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 +
 +
== 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:
 
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:
  
Line 32: Line 51:
  
 
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===
 +
 +
Is true if the player has the Fleets 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.
 
Is true if the player has the Fleets tab open on the sidebar menu.  There are no special parameters to this one.

Revision as of 19:57, 1 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:

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.

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.

PlayerHasSidebarMenuOpen_Fleets

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