Pathfinder 1e rules question...
A and B are medium sized creatures. A is a ranged character, B is a melee character.
Let's say A readies a ranged attack at anyone that comes into visibility. No enemies are visible nor within range at the moment.
Let's say B (an enemy of A) appears to A as part of their move + attack turn. B appears by moving adjacent to A -- perhaps because B is in fog/stinking cloud and comes within 5 feet, or perhaps the room is in darkness and A only has a candle illuminating 5 feet.
So A gets to use their readied action -- they see B, and they shoot (with appropriate miss chances and such). Does B get an AoO in addition to their planned attack?
I would guess that no, B does not get an AoO, for at least 1 of 2 reasons:
B becomes visible to A as B is entering the adjacent square, and thus I believe A's attack would interrupt B's movement and B is technically not in melee range when the ranged attack is made.
I'm not even sure you can make an attack of opportunity when it is your turn, or, if you can AoO when you are triggering the readied action on your turn. (Can B even take AoOs on their turn in PF1e?)
There is a similar question for 4e supporting my guess, but I'm not familiar with 4e and am unaware of the rules differences. That question is here: If a readied ranged attack action is used against the appearance of a burrowing creature, does the attack provoke an attack of opportunity?
However, I couldn't find a discussion/ruling for PF1e -- either my Google skills failed me or it hasn't been asked.