Half-Life: Anti-Climax is my take on the "battle you have no chance of winning" the G-Man offers you once you decline his job offer at the end of the Half-Life campaign. Is there truely no chance to win or can you lead Gordon to victory and freedom?

Post tutorial Report RSS Random Trigger

Vanilla Half-Life has no trigger_random entity, so if you want to trigger a random event, you'll have to get creative!

Posted by on - Advanced Mapping/Technical

Vanilla Half-Life has no trigger_random entity, so if you want to trigger a random event, you'll have to get creative! The only entity in HL being capable of randomness is an env_beam, so we're going to exploit that for our needs!

First, create an env_beam. Name it 'randombeam' and the StartEntity should also be 'randombeam'. The EndingEntity is 'randombeam_target'. Make sure the Damage is set to 999, Life to '2' and Strike Again to '5'. Make sure the RandomStrike flag is checked.

In this tutorial we're going to use 3 random options, so we'll create 3 func_buttons at 90 degree angles of our env_beam. For the first button, we'll give it the target 'target1' and check the Don't Move flag. Give it Health '1' so it becomes shootable. We only want this setup to pick a random target once, so Delay before Reset should be '-1'. If you want the system to be retriggerable, set this to '4'. Now create copies of the func_button and change the targets to 'target2' and 'target3'.

Behind each button (relative from the env_beam) place an info_target and name them 'randombeam_target'. The beam will randomly fire at one of these targets, triggering the button in the process.

Now set up 3 things you want to randomly target and call them 'target1', 'target2' and 'target3'. I'm using these 3 func_wall_toggles for this tutorial. You should now have something silimar to this:

random

Finally, add a way to start the sequence. I'm using a trigger_once and target the 'randombeam'.

Because I've set this up to only work once (I don't want to to pick another target every x seconds) I might as well kill the env_beam after it has picked. So set up a trigger_relay with name 'randombeam', KillTarget 'randombeam' and a Delay of '2'. Since the trigger_relay shared the name of the env_beam, put the trigger_relay on the same origin of the env_beam.

That should do it! Trigger the sequence and watch it pick a random target. Example map can be download from the Files page or the link below!

Random Trigger Example RMF

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Report Profile
Icon
Half-Life
Game
Half-Life
Creator
Hezus
Contact
Send Message
Release date
Mod watch
Follow
Tutorial
Tags
Anti, Climax, Half, Life
Browse
Tutorials
Report
Report
Share
Related Games
Half-Life
Half-Life First Person Shooter