Compare commits

...

7 Commits

Author SHA1 Message Date
NewSoupVi
d362fa7997 Update world api.md 2024-11-28 21:06:40 +01:00
NewSoupVi
5b7cd09470 I just didn't do this one and then Medic approved it anyway LMAO 2024-11-28 21:05:58 +01:00
NewSoupVi
eeea2bc85d Update world api.md 2024-09-15 19:39:13 +02:00
NewSoupVi
2cbe302a49 Update docs/world api.md
Co-authored-by: Nicholas Saylor <79181893+nicholassaylor@users.noreply.github.com>
2024-09-05 21:14:45 +02:00
NewSoupVi
6609d9f138 Docs: "Menu" -> origin_region_name
https://github.com/ArchipelagoMW/Archipelago/pull/3682
2024-09-05 17:03:24 +02:00
NewSoupVi
b60d0b8f41 Update world api.md 2024-09-05 17:00:33 +02:00
NewSoupVi
6f1a8a30e7 Docs: Mention explicit_indirect_conditions
https://github.com/ArchipelagoMW/Archipelago/pull/3682
2024-09-05 16:59:54 +02:00

View File

@@ -288,8 +288,8 @@ like entrance randomization in logic.
Regions have a list called `exits`, containing `Entrance` objects representing transitions to other regions. Regions have a list called `exits`, containing `Entrance` objects representing transitions to other regions.
There must be one special region, "Menu", from which the logic unfolds. AP assumes that a player will always be able to There must be one special region (Called "Menu" by default, but configurable using [origin_region_name](https://github.com/ArchipelagoMW/Archipelago/blob/main/worlds/AutoWorld.py#L295-L296)),
return to the "Menu" region by resetting the game ("Save and quit"). from which the logic unfolds. AP assumes that a player will always be able to return to this starting region by resetting the game ("Save and quit").
### Entrances ### Entrances
@@ -328,6 +328,9 @@ Even doing `state.can_reach_location` or `state.can_reach_entrance` is problemat
You can use `multiworld.register_indirect_condition(region, entrance)` to explicitly tell the generator that, when a given region becomes accessible, it is necessary to re-check a specific entrance. You can use `multiworld.register_indirect_condition(region, entrance)` to explicitly tell the generator that, when a given region becomes accessible, it is necessary to re-check a specific entrance.
You **must** use `multiworld.register_indirect_condition` if you perform this kind of `can_reach` from an entrance access rule, unless you have a **very** good technical understanding of the relevant code and can reason why it will never lead to problems in your case. You **must** use `multiworld.register_indirect_condition` if you perform this kind of `can_reach` from an entrance access rule, unless you have a **very** good technical understanding of the relevant code and can reason why it will never lead to problems in your case.
Alternatively, you can set [world.explicit_indirect_conditions = False](https://github.com/ArchipelagoMW/Archipelago/blob/main/worlds/AutoWorld.py#L298-L301),
avoiding the need for indirect conditions at the expense of performance.
### Item Rules ### Item Rules
An item rule is a function that returns `True` or `False` for a `Location` based on a single item. It can be used to An item rule is a function that returns `True` or `False` for a `Location` based on a single item. It can be used to
@@ -463,7 +466,7 @@ The world has to provide the following things for generation:
* the properties mentioned above * the properties mentioned above
* additions to the item pool * additions to the item pool
* additions to the regions list: at least one called "Menu" * additions to the regions list: at least one named after the world class's origin_region_name ("Menu" by default)
* locations placed inside those regions * locations placed inside those regions
* a `def create_item(self, item: str) -> MyGameItem` to create any item on demand * a `def create_item(self, item: str) -> MyGameItem` to create any item on demand
* applying `self.multiworld.push_precollected` for world-defined start inventory * applying `self.multiworld.push_precollected` for world-defined start inventory
@@ -516,7 +519,7 @@ def generate_early(self) -> None:
```python ```python
def create_regions(self) -> None: def create_regions(self) -> None:
# Add regions to the multiworld. "Menu" is the required starting point. # Add regions to the multiworld. One of them must use the origin_region_name as its name ("Menu" by default).
# Arguments to Region() are name, player, multiworld, and optionally hint_text # Arguments to Region() are name, player, multiworld, and optionally hint_text
menu_region = Region("Menu", self.player, self.multiworld) menu_region = Region("Menu", self.player, self.multiworld)
self.multiworld.regions.append(menu_region) # or use += [menu_region...] self.multiworld.regions.append(menu_region) # or use += [menu_region...]