| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  | # Archipelago Triggers Guide
 | 
					
						
							| 
									
										
										
										
											2021-12-31 14:12:22 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | This guide details the use of the Archipelago YAML trigger system. This guide is intended for a more advanced user with | 
					
						
							|  |  |  | more in-depth knowledge of Archipelago YAML options as well as experience editing YAML files. This guide should take | 
					
						
							|  |  |  | about 5 minutes to read. | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## What are triggers?
 | 
					
						
							| 
									
										
										
										
											2021-11-30 19:34:39 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-31 14:12:22 -05:00
										 |  |  | Triggers allow you to customize your game settings by allowing you to define one or many options which only occur under | 
					
						
							|  |  |  | specific conditions. These are essentially "if, then" statements for options in your game. A good example of what you | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | can do with triggers is the [custom mercenary mode YAML | 
					
						
							|  |  |  | ](https://github.com/alwaysintreble/Archipelago-yaml-dump/blob/main/Snippets/Mercenary%20Mode%20Snippet.yaml) that was | 
					
						
							|  |  |  | created using entirely triggers and plando. | 
					
						
							| 
									
										
										
										
											2021-12-31 14:12:22 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | For more information on plando, you can reference the [general plando guide](/tutorial/Archipelago/plando/en) or the | 
					
						
							|  |  |  | [A Link to the Past plando guide](/tutorial/A%20Link%20to%20the%20Past/plando/en). | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## Trigger use
 | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | Triggers may be defined in either the root or in the relevant game sections. Generally, the best place to do this is the | 
					
						
							|  |  |  | bottom of the YAML for clear organization. | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | Each trigger consists of four parts: | 
					
						
							|  |  |  | - `option_category` specifies the section which the triggering option is defined in. | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  |     - Example: `A Link to the Past` | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  |     - This is the category the option is located in. If the option you're triggering off of is in root then you | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  |       would use `null`, otherwise this is the game for which you want this option trigger to activate. | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | - `option_name` specifies the name of the triggering option. | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  |     - Example: `shop_item_slots` | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  |     - This can be any option from any category defined in the YAML file in either root or a game section. | 
					
						
							|  |  |  | - `option_result` specifies the value of the option that activates this trigger. | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  |     - Example: `15` | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  |     - Each trigger must be used for exactly one option result. If you would like the same thing to occur with multiple | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  |       results, you would need multiple triggers for this. | 
					
						
							|  |  |  | - `options` is where you define what will happen when the trigger activates. This can be something as simple as ensuring | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  |   another option also gets selected or placing an item in a certain location. It is possible to have multiple things | 
					
						
							|  |  |  |   happen in this section. | 
					
						
							|  |  |  |     - Example: | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  |   ```yaml | 
					
						
							|  |  |  |   A Link to the Past: | 
					
						
							|  |  |  |     start_inventory:  | 
					
						
							|  |  |  |       Rupees (300): 2 | 
					
						
							|  |  |  |   ``` | 
					
						
							| 
									
										
										
										
											2021-12-31 14:12:22 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | The general format is: | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |   ```yaml | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  |   category: | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  |     option to change: | 
					
						
							|  |  |  |       desired result | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ### Examples
 | 
					
						
							| 
									
										
										
										
											2021-12-31 14:12:22 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  | The above examples all together will end up looking like this: | 
					
						
							| 
									
										
										
										
											2021-12-31 14:12:22 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  |   ```yaml | 
					
						
							|  |  |  |   triggers: | 
					
						
							|  |  |  |     - option_category: A Link to the Past | 
					
						
							|  |  |  |       option_name: shop_item_slots | 
					
						
							|  |  |  |       option_result: 15 | 
					
						
							|  |  |  |       options: | 
					
						
							|  |  |  |         A Link to the Past: | 
					
						
							|  |  |  |           start_inventory: | 
					
						
							|  |  |  |             Rupees(300): 2 | 
					
						
							|  |  |  |   ``` | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | For this example, if the generator happens to roll 15 shuffled in shop item slots for your game, you'll be granted 600 | 
					
						
							|  |  |  | rupees at the beginning. Triggers can also be used to change other options. | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | For example: | 
					
						
							| 
									
										
										
										
											2021-12-31 14:12:22 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-02 23:55:50 -05:00
										 |  |  |   ```yaml | 
					
						
							|  |  |  |   triggers: | 
					
						
							|  |  |  |     - option_category: Timespinner | 
					
						
							|  |  |  |       option_name: SpecificKeycards | 
					
						
							|  |  |  |       option_result: true | 
					
						
							|  |  |  |       options: | 
					
						
							|  |  |  |         Timespinner: | 
					
						
							|  |  |  |           Inverted: true | 
					
						
							|  |  |  |   ``` | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | In this example, if your world happens to roll SpecificKeycards, then your game will also start in inverted. | 
					
						
							| 
									
										
										
										
											2022-01-09 14:13:00 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | It is also possible to use imaginary values in options to trigger specific settings. You can use these made-up values in | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  | either your main options or to trigger from another trigger. Currently, this is the only way to trigger on "setting 1 | 
					
						
							|  |  |  | AND setting 2". | 
					
						
							| 
									
										
										
										
											2022-01-09 14:13:00 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | For example: | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-09 14:13:00 -06:00
										 |  |  |   ```yaml | 
					
						
							|  |  |  |   triggers: | 
					
						
							|  |  |  |     - option_category: Secret of Evermore | 
					
						
							|  |  |  |       option_name: doggomizer | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  |       option_result: pupdunk | 
					
						
							|  |  |  |       options: | 
					
						
							|  |  |  |         Secret of Evermore: | 
					
						
							|  |  |  |           difficulty: | 
					
						
							|  |  |  |             normal: 50 | 
					
						
							|  |  |  |             pupdunk_hard: 25 | 
					
						
							|  |  |  |             pupdunk_mystery: 25 | 
					
						
							|  |  |  |           exp_modifier: | 
					
						
							|  |  |  |             150: 50 | 
					
						
							|  |  |  |             200: 50 | 
					
						
							|  |  |  |     - option_category: Secret of Evermore | 
					
						
							|  |  |  |       option_name: difficulty | 
					
						
							|  |  |  |       option_result: pupdunk_hard | 
					
						
							|  |  |  |       options: | 
					
						
							|  |  |  |         Secret of Evermore: | 
					
						
							|  |  |  |           fix_wings_glitch: false | 
					
						
							|  |  |  |           difficulty: hard | 
					
						
							|  |  |  |     - option_category: Secret of Evermore | 
					
						
							|  |  |  |       option_name: difficulty | 
					
						
							|  |  |  |       option_result: pupdunk_mystery | 
					
						
							|  |  |  |       options: | 
					
						
							|  |  |  |         Secret of Evermore: | 
					
						
							|  |  |  |           fix_wings_glitch: false | 
					
						
							|  |  |  |           difficulty: mystery | 
					
						
							| 
									
										
										
										
											2022-01-09 14:13:00 -06:00
										 |  |  |   ``` | 
					
						
							| 
									
										
										
										
											2021-12-31 14:12:22 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-10-10 09:10:01 +02:00
										 |  |  | In this example (thanks to @Black-Sliver), if the `pupdunk` option is rolled, then the difficulty values will be rolled | 
					
						
							| 
									
										
										
										
											2022-01-17 15:37:34 -05:00
										 |  |  | again using the new options `normal`, `pupdunk_hard`, and `pupdunk_mystery`, and the exp modifier will be rerolled using | 
					
						
							|  |  |  | new weights for 150 and 200. This allows for two more triggers that will only be used for the new `pupdunk_hard` | 
					
						
							|  |  |  | and `pupdunk_mystery` options so that they will only be triggered on "pupdunk AND hard/mystery". |