As you may know, vanilla Half-Life maps cannot directly detect the current difficulty selected by the user. Unlike Quake 1, Half-Life does not have the "Not in *" family of spawnflags, except for "Not in Deathmatch".
This example shows how to leverage monster health defined in skill.cfg to detect whether the difficulty is easy, normal, or hard (
cvar equal to 1, 2, and 3 respectively).
It is able to determine the difficulty in 1 second. Attempts to make it faster resulted in loss of precision and unreliable difficulty detection. If you've been able to shrink that time even further, please upload the modified map and notify me, so that I can leave a link.
The setup has been tested once with the following framerate caps: 15, 30, 45, 60, 100, 500, and worked properly on each.
As long as you don't have any entities colliding with the names used used in the
setup, you may remove the
setup and straight up copy the rest of the map over, then use the "hook" Target names listed below.
In case you've discovered an issue, contant me. Leave a comment preferably. I read them.
There are two groups of entities:
skselect: The main skill selection mechanism. It triggers the following Targets (as a kind of hooks), corresponding to the detected skill. To use the setup, name whatever entity you want to be triggered if a specific skill level is detected as one of these values:
skgauge: The "gauge" or indicator that uses the skill selection mechanism and shows what difficulty is selected as soon as the process is over.