silent-destroyer / tunic-randomizer-archipelago

A version of the TUNIC Randomizer mod that can be used to play in Archipelago Multiworld servers.
https://rando.tunic.run/
MIT License
8 stars 2 forks source link

start_inventory_from_pool does not function properly with items in the hint list #1

Closed ScipioWright closed 1 year ago

ScipioWright commented 1 year ago

Making the issue here because I can't make it where the apworld is, but this is an ap-side generation issue.

As stated in the title. Failure occurs during slot data. If you start_inventory_from_pool an item, it gets taken out of the item pool. So when you try to use find_item("Magic Dagger", self.player).item after you put the magic dagger in your start_inventory_from_pool list, this step will break it since it can't find the item (since it's not placed on any locations -- it's in your inventory already).

Would need some sort of rewrite to check that the item is actually in the pool, and then gen the hints based off of that. The quick and easy way would be to check what stuff has been put in start_inventory_from_pool and then take those out of the list, and fill in something like "Magic Dagger is in your pocket" or some joke hint. Could do this by writing a helper function to check if the item is in the pool, if it is then return its location name and the player who has it, if it isn't then return "your pocket" and your own player slot. It would be the least intrusive this way, imo, and most likely would not require any changes on the mod-side.

I will probably try to work on this myself since I kinda introduced the issue in the first place.

silent-destroyer commented 1 year ago

I'll try and tackle this, currently stuck on a car ride for 3 hours with nothing better to do :p but if I can't get it to work I'll leave it to you

silent-destroyer commented 1 year ago

This is almost certainly going to require some new logic in the client mod as well since the slot data is used for major hints, so if those items are removed from the item pool those will break as well. Shouldn't be too bad to fix though. I made some changes to the AP side I'll push later/tomorrow

ScipioWright commented 1 year ago

I'm sure it could be made to work without changes to the client. All you return is a string for the location name and the slot number for the player who has it.

So if it's not there you could just return "your pocket" or something similar for the location name and your own slot number for the player who has it.

Though, I guess (at least in the current version I have) the major hints aren't really working right anyway, so client changes need to happen regardless

silent-destroyer commented 1 year ago

The major hints use the location name to lookup a tunic scene name if the slot matches your own player slot, so probably just that would need to be accounted for, which again should be pretty simple. And yeah I fixed the major hunt issue a while back but haven't pushed it yet (soon:tm:)

silent-destroyer commented 1 year ago

Closing this as it has been fixed in 0.0.2