Skip to content

Commit

Permalink
Changes to phrase and substitution expansion (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibetiroka authored Aug 14, 2024
1 parent 086c6d1 commit ab2a55e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions wiki/CreatingMissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ These placeholders will be substituted in any text in the following places:
* the mission description
* dialog messages contained in the mission
* conversations contained in the mission
* custom substitutions defined in the mission **(v. 0.10.9)**

For example, the mission description might be, "Deliver `<cargo>` to `<destination>` by `<date>`."

Expand Down Expand Up @@ -663,7 +664,7 @@ If you want to retrieve passengers or cargo by boarding a ship, set up the missi
ship <model> <name>
```

This specifies a single ship as an NPC. The first argument is the model type (or named variant), such as "Falcon", or "Star Barge (Armed)". The second is the ship's name.
This specifies a single ship as an NPC. The first argument is the model type (or named variant), such as "Falcon", or "Star Barge (Armed)". The second is the ship's name. Beginning in **v. 0.10.9**, phrases and substitutions are expanded NPC ship names.

If you want to customize an NPC (for example, having it start out with a particular cargo), you will need to define a variant of the ship and then reference that variant here. Placing the entire ship definition within the NPC definition is supported (because that is how NPC ships are loaded from a saved game) but will not work properly if the ship definition contains any outfits that are not defined yet when the mission definition is parsed. When loading NPCs from saved games, the rest of the game data has finished loading, but this is not otherwise guaranteed.

Expand Down Expand Up @@ -798,7 +799,7 @@ Beginning in **v. 0.9.15**, if the outfit being gifted has the "map" attribute,
give ship <model> [<name>]
```

Starting in **v. 0.9.13**, missions can gift ships to the player. The named ship model is given to the player. This ship model can be a [ship variant](https://github.com/endless-sky/endless-sky/wiki/CreatingShips#variants). It is optional that the given ship has a name, but if no name is provided then a random name will be generated from the civilian phrase.
Starting in **v. 0.9.13**, missions can gift ships to the player. The named ship model is given to the player. This ship model can be a [ship variant](https://github.com/endless-sky/endless-sky/wiki/CreatingShips#variants). It is optional that the given ship has a name, but if no name is provided then a random name will be generated from the civilian phrase. Beginning in **v. 0.10.9**, substitutions and phrases are expanded in gift ship names.

```html
(give | take) ship <model> [<name>]
Expand Down
2 changes: 1 addition & 1 deletion wiki/CreatingSubstitutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The three types of substitutions, hardcoded, mission-specific, and global, have
<text> <replacement>
```

Substitutions simply search for the text on the left and replace it with the text on the right whenever it is found within a piece of text. As mentioned above, multiple replacements of the same text can be defined, but whichever replacement is evaluated last is the one that gets used.
Substitutions simply search for the text on the left and replace it with the text on the right whenever it is found within a piece of text. As mentioned above, multiple replacements of the same text can be defined, but whichever replacement is evaluated last is the one that gets used. Beginning in **v. 0.10.9**, substitutions can contain phrases and other substitutions as well.

A substitutions node can define multiple text replacements at once.

Expand Down

0 comments on commit ab2a55e

Please sign in to comment.