I bet you've all met the situation, where the game spawns/sends enemies in your back, trying to final you in a sneaky way, or at least make one-two cheap shots. This is especially typical in City Interactive games, and given a limited amount of medikits, this may prove to be fatal eventually (and extremely annoying). When enemies come out of nowhere, it's outright cheating, however, sometimes this phenomenon can be reasonable (enemies arriving by teleport, paradrop, or previously locked areas).
I was trying to come up with an item, that can successfully counter these sneak-attacks. Of course, Invulnerability is the best way, but it's rare, and technically it nullifies the purpose of sending enemies to your back - if they can't kill you, what's the point. Tripmines or proximity mines are an adequate response in most games, however, they can easily backfire if you're caught in an ambush and try to retreat. Something new is needed.
What I need is an item, which works a lil'bit like the Radiation suit (its effect lasts for, let's say, 20 minutes), and when you collect it, a medium-sized radius zone is formed around you, in a spherical form (invisible of course). If any hostile entity enters this zone around you, you'd get a howling siren sound effect, or perhaps a Quake4-styled warning message "Proximity alert!", this way you'd know that an enemy is in your close vicinity. Obviously, this item would also give an alert when an enemy is in front of you, but when nobody is, and you hear the siren, you'll be well-prepared for an assault coming from either side of you, let it be ground or aerial enemy. The device's spherical radius would also detect enemies behind walls, and may prove to be an extremely valuable help in pitch black areas, when you can't find any Image Intensifier Visors. I wonder if such collectible item can be coded - and hopefully solve the all-mighty "enemies coming from nowhere always rape you" problem.
Proximity warning
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.
- Caligari87
- Admin
- Posts: 6233
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Proximity warning
Could be accomplished by giving enemies some kind of "check distance to target" function and if they're within a certain radius they give the player's inventory a marker object. The powerup then is constantly scanning the player's inventory, and if the player has this item, it sounds the alarm.
I'd give function examples if I weren't at work, but sounds fairly straightforward and I'm sure you could find everything you need on the Wiki under the DECORATE section, no scripting required. The only hard part would be adding the range checks to every monster you want to use, but even that's fairly trivial and would just take time.

I'd give function examples if I weren't at work, but sounds fairly straightforward and I'm sure you could find everything you need on the Wiki under the DECORATE section, no scripting required. The only hard part would be adding the range checks to every monster you want to use, but even that's fairly trivial and would just take time.

Re: Proximity warning
Very well, it's not urgent at all, and seems like it can be accomplished somehow. Unfortunately, I'm totally dumb for coding, I can create the auditory and graphic parts of the item (and the possible messages, if there are any). This device can effectively counter the constant problem of looking behind after every second step, looking for recently spawned enemies, or ambushes behind an innocent-looking door. Sure it would not work against very distant enemies with hitscan weaponry, but it'll still be an effective countermeasure to enemies deliberately spawned at your back.
-
- Posts: 4
- Joined: Wed Jul 16, 2014 1:54 pm
Re: Proximity warning
IMO, a siren would be even more annoying than getting stabbed in the back. Perhaps a silent arrow or a pointy-shaped glow in the HUD pointing downwards (indicating your back) would be even better.
It is also possible to detect if an actor is within the player's field of view. That could be useful to avoid doing obvious alerts on monsters already in your sight.
It is also possible to detect if an actor is within the player's field of view. That could be useful to avoid doing obvious alerts on monsters already in your sight.
Re: Proximity warning
You got a point, yes, a klaxon will be pretty annoying,especially if many enemies are scouting the level. A silent arrow, or a flashing message would be better. In Quake 4, when the Strogg baddies launched heatseeker missiles at you, the klaxon was annoying alrighty, but the "incoming missile" flashing was useful. So if this Proximity scanner can be coded, perhaps a flashing message on the top center would be more plausible.
Also, the coding must hold an exception for launched projectiles, so it must not alert up when a fireball, rocket etc. is passing by you, only at enemies.
Also, the coding must hold an exception for launched projectiles, so it must not alert up when a fireball, rocket etc. is passing by you, only at enemies.
- Caligari87
- Admin
- Posts: 6233
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Proximity warning
Like I said, it should be fairly trivial with either one of two things:
1) Enemies call an ACS script and pass their position to it during their walk/wander cycle. The script checks the distance to the player and gives the warning if inside a certain radius. This is probably the cleaner option, less decorate jumps to worry about.
2) Enemies check the distance to their target (the player) in DECORATE and give an inventory item to the player if in range. The player's warning powerup gives the warning if it detects the inventory item. Less clean, more DECORATE duplicated across many monsters, but no scripting required.

1) Enemies call an ACS script and pass their position to it during their walk/wander cycle. The script checks the distance to the player and gives the warning if inside a certain radius. This is probably the cleaner option, less decorate jumps to worry about.
2) Enemies check the distance to their target (the player) in DECORATE and give an inventory item to the player if in range. The player's warning powerup gives the warning if it detects the inventory item. Less clean, more DECORATE duplicated across many monsters, but no scripting required.

Re: Proximity warning
A warning message display on the screen is also possible? Not the usual Doom-styled "you got the shotgun" message, but rather a distinct, animated message on top center, maybe.
- Attachments
-
- Proximity warning
- Proximity_warning_example.gif (48.14 KiB) Viewed 397 times
- Caligari87
- Admin
- Posts: 6233
- Joined: Thu Feb 26, 2004 3:02 pm
- Preferred Pronouns: He/Him
- Contact:
Re: Proximity warning
Yep, just either play a sound, or do a graphical HudMessage. Both are possible.


Re: Proximity warning
Excellent,excellent!
Thank you for your help. I hope this item will provide a sufficient counter to the evergreen "enemies coming from nowhere always rape me from behind" problem without trying to learn where are those damn monster-summoning triggers on the level 

