I can't think how to achieve this. I want to create a small "sniper nest" that the player can go into and fire out of to kill enemies. The front of the nest would face onto the area of the level where the enemies are likely to come from but they could approach from other angles too. I do not want the enemies to be able to fire into the sniper nest through the front but I do want them to be able to attack the player if they manage to get behind the sniper nest and come in from that angle.
So, what I need is a way of making a line (or something) that lets player shots (projectile and hitscans) cross from one side (inside to outside) but does not let enemy shots (also projectiles and hitscans) cross from the other side (outside to inside).
I can't think of a line blocking type that will do this and I can't just make the player invulnerable while he is in the nest because I want the possibility of him being attacked from other angles. I've a funny feeling that it probably can't be done (at least not particularly efficiently) but if anyone has any ideas, I'd be glad to hear them.
One sided defensible position- how?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Re: One sided defensible position- how?
I've played around and managed to get a one-way obstacle working for both projectile and hitscan attacks. It isn't a pretty solution but it does what it's supposed to. I've attached a working demo/test map if you wish to try it.
This solution revolves around the [wiki=Actor_flags#GHOST]GHOST[/wiki] flag, the [wiki=Actor_properties#Species]species[/wiki] property, and their THRU-flag counterparts ([wiki=Actor_flags#THRUGHOST]THRUGHOST[/wiki]/[wiki=Actor_flags#THRUSPECIES]THRUSPECIES[/wiki]).
Some caveats with this solution:
This solution revolves around the [wiki=Actor_flags#GHOST]GHOST[/wiki] flag, the [wiki=Actor_properties#Species]species[/wiki] property, and their THRU-flag counterparts ([wiki=Actor_flags#THRUGHOST]THRUGHOST[/wiki]/[wiki=Actor_flags#THRUSPECIES]THRUSPECIES[/wiki]).
- A projectile may pass through an actor of matching species if the projectile has the THRUSPECIES flag.
- A hitscan (bullet puff) may pass through a GHOST-actor if the bullet puff has the THRUGHOST flag.
Some caveats with this solution:
- Lots of inheritance is required to add support for a single actor.
- Rockets fired outside the nest can hurt players inside if they're too close to the blast.
- It relies on the GHOST flag which, as I understand it, behaves differently in Heretic.
- It doesn't support nested or opposing sniper-nests. If you're in one nest then you're in them all as far as this solution is concerned.
- Attachments
-
one_way_obstacle.pk3
- One-way sniper nest example for Doom 2 (map01, Doom in Hexen format).
- (6.89 KiB) Downloaded 18 times
Re: One sided defensible position- how?
Wow! That works really well. Thanks for the effort that you put into this. I'm going to look at it to see how easily I can integrate it. One immediately obvious potential problem is that a number of the enemies I am thinking of have the Ghost flag. However, I will see how much of a problem this turns out to be. Thank you.