Difference between revisions of "AI War 2:Tutorial Step Conditions"
X4000Chris (talk | contribs) |
X4000Chris (talk | contribs) |
||
Line 87: | Line 87: | ||
* Parameters: | * Parameters: | ||
− | ** special_entity_type: one of the SpecialEntityType enum values, such as "Frigate | + | ** 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. | ** count: the number of this type of ship that are required. | ||
Revision as of 11:56, 2 October 2019
Contents
- 1 Using A Conditional
- 2 Actual Conditions
- 2.1 PlayerViewIsOnGalaxyMap
- 2.2 PlayerViewIsOnAnyPlanet
- 2.3 PlayerHasSidebarMenuOpen_Local
- 2.4 PlayerHasSidebarMenuOpen_Build
- 2.5 PlayerHasSidebarMenuOpen_Tech
- 2.6 PlayerHasSidebarMenuOpen_Hacking
- 2.7 PlayerHasSidebarMenuOpen_Merc
- 2.8 PlayerHasSidebarMenuOpen_Intel
- 2.9 PlayerHasSidebarMenuOpen_Fleets
- 2.10 PlayerViewIsOnSpecificPlanet
- 2.11 PlayerHasCountOfSpecificShipAnywhere
- 2.12 PlayerHasCountOfSpecialEntityTypeAnywhere
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.
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.
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 type 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.