In DnD 3.x, if a rogue attacks from a hidden position with a ranged weapon do they get sneak attack damage?
If you are successfully hidden, then yes. But you should be aware that attempting to hide after combat has started is very difficult.
Yes, but you must be within 30' (see sneak attack under Rogue class description in PHB).
As long as your target is unaware of your presence i.e. you have successfully hidden from him, he is therefore denied his Dex bonus so you can add your sneak attack damage if you hit.
You can attempt to hide if you have cover or concealment and are not directly observed (Hide in Plain Sight ability gets around some of these restrictions).
Eh. Sort-of.
Per the description of the Hide skill, if a character is being observed (even casually), then they can't Hide. In combat, even having cover or concealment generally isn't enough, since the target will at least know where they went.
However, the Hide skill does note that a successful Bluff check (whether by the Rogue or by an ally) can create enough of a distraction for the character to hide, provided he can reach cover or concealment in time.
Once the character is successfully hidden, he does indeed get Sneak Attack.
Here's a specific example: it's the second round of combat and the rogue breaks line-of-sight to an enemy, then makes a successful Hide check. Next round, can they step out of hiding and shoot an enemy to get sneak attack damage?
Page references would be fab, but any input is appreciated!
Note that it's not enough merely to "break line-of-sight". The target has to be distracted sufficiently that he's not observing the Rogue even casually (Bluff check, see above), and the Rogue needs to move into an area of cover or concealment relative to his target. So, there has to be an altar to hide behind, an area of shadows, or something of that sort. Simply standing behind the target (or even behind an ally) isn't enough.
Another complication, in a normal surprise round you only get a partial action, so only one shot. During later rounds, you could do a Full Attack option and get multiple sniper shots off. Which seems very powerful.
Normally, as soon as the character makes his first attack, his target becomes aware of him and he is no longer hidden. Therefore, he only gets a single Sneak Attack.
However (per the Hide skill description), the character can make a Hide check at a -20 penalty to remain hidden while sniping. However, doing so is a move action, so even in this case the character would only get a single Sneak Attack in the round.
(I'm not familiar with the Sniper feat off the top of my head, and it's not in the SRD. My guess is that this probably allows the character to make that Hide check as a free action, but I may be wrong about that.)