How to advance encounter when an object is placed?

I know there is the wait_for_requirements_met encounter type. It is used in a few quests.
For example, the quests to advance to tier 2 uses this encounter type, to detect if you have the monuments or not.

But because the object I’m trying to detect is not owned by the player, this encounter is useless in this specific case. It only detects objects owned by the player.

I even tried changing the ownership of the object to the player, so I could adapt and use that encounter, but for some reason the encounter did not worked…

Here is the code piece used:

"wait_for_requirements_met_info": {
	"requirements": {
		"has_container": {
			"item": "exists_in_world",
			"uri": "archipelago_biome:monsters:fake_container",
			"value": true,
			"type": "deny_if_not"

The object is even white now when I hover it (meaning it belongs to my town, yellow when it is from a neutral source and red from enemies) so I’m not sure why this above code is not working either.

Essentially I’m trying to create some kind of if/else in my campaign. I would have two of those encounters, one testing for the existence of the object, and another testing for the opposite, each one with a different dialogue following. So if the object is there, say A, if not say B.

1 Like

I understand now why even when I changed the ownership of the object to be mine it was not detecting it.
It is because it was in the world, but not in the inventory of the town.

The encounter only checks for items in the player town inventory.

So as I created the object through a custom script, it was placed in the world, but not counted.
I could fix this by adding the item to the town inventory.

It would be better though if the encounter just detects if the item existed anywhere in the world (as suggested by its name) instead of looking only in the player town inventory counter. And also enable to look at other factions too, maybe you want (as my case) to detect an item that is placed in the world but it is not yours.

For now, I will make a custom script to do what I wanted.

Are you doing some kind of trojan horse encounter? :slight_smile:

Yes! :stuck_out_tongue: It is already in the archipelago campaign. I’m just refining it. More precisely, I need to catch the case where the player does not open the container and teach him how to do it, so the quest can advance (even though there is just a dialogue after it, for now)

1 Like

I better try your campaign out soon. watched another player on youtube that played a bit of it, and it looked great! :merry: