Bug: `point_proximity_sensor` don't fire output `Distance` if target wasn't spawn with entity
Describe the bug
Found this when was working on workshop addon for Black Mesa. I decided to use point_proximity_sensor with math_counter instead of triggers so as not to compile the map later (xen levels take hours to compile). When I finished logic creating and started porting it to bm_c4a3c2 using VIDE - I noticed that my logic doesn't work when I create objects with the required target names. As it turned out - for some reason point_proximity_sensor don't fire output Distance if objects were not created at level initially. Because of this I had to add two invisible nonsolid dynamic objects at 0 0 0 coordinates; I also needed to add logic_timer that fires every 5 seconds to attach those two dynamic objects to targets. As a result, congest level of this addon a little higher than originally planned (this level is already very congested).
I also found that point_proximity_sensor don't fire output Distance if kill and spawn target, however it fire if point_proximity_sensor was spawned with point_template or created by ent_fire console command. Also can be fixed with SetTargetEntity input (even if target with same name was seted in point_proximity_sensor keyvalue).
Example when I was creating the logic.
https://github.com/StrataSource/Engine/assets/103366204/e73360f0-ad53-45ae-96bc-86330337dbd1
Example in test map.
https://github.com/StrataSource/Engine/assets/103366204/a4f47a8a-28a0-4825-b859-0fb228cd3f17
Problem available in any Source Engine game.
To Reproduce
- Open my test map. devtest_prox.zip
- Use the red button to spawn the cube.
- Bring the cube to the sprite and notice that sprite does not change its color, despite that target already seted for
point_proximity_sensor.
Issue Map
Technically any with point_proximity_sensor. devtest_prox.zip
Expected Behavior
If target entity appears - point_proximity_sensor fire output Distance.
Operating System
Any.