VERC: Monster Health Last edited 3 years ago2019-04-21 12:29:44 UTC

Changing health without coding

entities required: This is something I use when I want to make a mini-boss (a monster stronger than his fellows) but it would work as well to weaken a monster so that he gets killed faster. The main trick about this is to use the damage factor of the moving brush-based entities. The func_door entity has a "damage inflicted when blocked" value -- this is normally used when you get stuck in a door, and in most cases it gibs you awfully. However, I discovered that there was nothing in the code to prevent from using negative values in order to increase health.

So, in order to get this working, we need to put our monster in a 'sandwich' between a func_door with a negative damage value (or positive if you want to hurt him) and a wall (It is better to make a func_wall next to the monster or he will be pushed by the door). The door and the wall need to have a name (targetname), the same name, for example "heal". the trigger_auto will trigger "heal" after a delay of 1 or 2 seconds (0 can be bad on large maps, you must let enough time to spawn all of the entities or it may not work).
User posted image
You must make sure the door is oriented in the right angle, facing the monster and the wall. After the trigger_auto triggers the door, it will move toward the monster and 'crush' it, giving it extra health. Finally, when the door comes back to position, it must remove itself and the wall too. This is easily achieved by setting the "killtarget" value of the door to "heal". And that's it! you now have a monster ready for a duel of anthology!
This article was originally published on the Valve Editing Resource Collective (VERC).
TWHL only archives articles from defunct websites. For more information on TWHL's archiving efforts, please visit the TWHL Archiving Project page.


You must log in to post a comment. You can login or register a new account.