Sin Episodes - Tutorial - info_challenge in Arena Mode

From Valve Developer Community
Jump to: navigation, search
SiN Episodes Level Creation
Skill Level

This tutorial expects you to have this amount of knowledge within the topic to follow along smoothly.

Novice Familiar Competent Proficient Expert

The goal for this tutorial is for the player in an arena mode map to be able to trigger a mutagen gas leak from some pipes when the challenge level is 0.5 or higher.

Setting up the foundation

Ok, so when you have a room and your spawn point setup, start placing the important pieces of the puzzle.

  1. Anywhere in the room place a small raised platform that a character can move around on.
  2. On the platform create another brush, tie it to a trigger_once trigger.
  3. Then go ahead and place a logic_timer entity with the name timer1.
  4. Create an info_challenge entity and name it info_gas.
  5. Next do a logic_compare entity with the name compare1.
  6. Finally an env_poison_gas entity named gasleak - gas will spawn at its location.
Note.pngNote: It's optional if you want to put a model for pipes or something in here.

Working challenge system

Now that we have the foundation, it's time to stitch it all together and get it working correctly - so the trigger brush is basically what is going to to set off your whole system, kind of like knocking over the first domino and watching the others all fall after it. For this trigger you want to add the following output:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTouchStart timer1 Enable <none> 1.00 No

Let's move onto setting up the timer and you will notice that it already has an input, since the trigger is outputting to it. The timer is an entity that fires output events at regular or random intervals. It can also be set to oscillate between a high and low end, in which case it will fire alternating high/low outputs each time it fires. You want to add a new output like with the trigger, where this is what is going to actually get the initial challenge from the game:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTimer info_gas GetInitialChallenge <none> 0.00 No

Now it's time to setup the challenge entity. For this one we are going to have to set up two outputs instead of just one. What these two are going to do is take the initial challenge value the entity have stored and forward it as a parameter for the compare entity to decide on, which is automatically done when the output type OnInitialChallenge is called, so lets get started:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnInitialChallenge compare1 SetValue <none> 0.00 No
Io11.png OnInitialChallenge compare1 Compare <none> 0.00 No

Now it's time to setup the compare entity. Two extra things that need to be done before we set up the outputs. Where you set the name you will see two other options "Initial Value" and "Compare Value." Both of these values need to be set to "0.5". For this one we are going to just setup 1 output. This will be what actually takes the value and sets off the gas if it is high enough:

My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnGreaterThan gasleak TurnOn <none> 0.00 No
Note.pngNote: You do not have to change anything for the poison gas entity.

Saving and Testing

Now that the entities are created and connected, it is time to save and test if everything works properly. Do that by making sure the map's name starts with the arena_ prefix before compiling it, then afterwards open the game and click the Arena Mode button on the main menu. Set the challenge indicator either half or all the way up, select the map you created in the list and click on begin. You should now be able to stand on the platform, look to where your env_poison_gas was set and see gas actually appear after a second. If you see that, congratulations! You have successfully implimented a challenge depended system, though be sure to go back and start a new game with the challenge all the way down to check it does not appear on any lower difficulty levels.