I haven't contributed anything to the development community in quite some time, so I thought I would write a quick tutorial up on AddOutPut. It is a really awesome output command that can trigger some really cool stuff.
I am by no means good at writing up tutorials, so I will jump straight into the capabilities and explanations, and if you have any questions you can post below.
What should I know before attempting this?
This is fair simple stuff, but I would recommend reading up on the Output tab on entities before proceeding with this as it has a lot to do with it. These commands aren't restricted only to hammer, they can be used via the ent_fire (or your plugins respective replacement) commands and assigned while in game.
Note: On starttouch is actually 1 word. Gamebanana doesnt like to use it as 2 words.
Example Number 1 - Adjusting players health and max health:
Thought adjusting players health and max health levels were limited to plugins only?
With AddOutPut, we can adjust a players health manually without having to heal them (trigger_hurt with negative damage), and adjust a players max health above their norm (100).
To do this, simply create a trigger_multiple (or once) and go to the Outputs tab. Enter the following info in and click apply.
This will assign the player's health, instantly, to 25. But what about more than the max (100)?
That is also very simple; add the following:
This will allocate the players max health to be 150. It will not adjust their health, so you will need to do that with the health command or a trigger_hurt with negative damage. Ideal for a reward in Jailbreak.
Example Number 2 - Adjusting players color and alpha:
The color change is fairly simple, see the example below:
To adjust the alpha, it requires 2 additional outputs for the player.
For more info on rendermodes, go here: https://developer.valvesoftware.com/wiki/Render_Modes
The alpha can be adjusted between 0-255, 255 being completely visible.
Example Number 3 - Gravity and Setting a players team:
It is possible to adjust a players gravity. It is done as a percentage of the servers gravity variable. Example, if gravity on server was 800 and you wanted to so players only had half gravity, you would do the parameter variable as 0.5 etc etc. See example below:
TO change a players team is just as simple as the rest, simply put the following commands attached to whatever u like below (button/trigger etc).
1 = Spectate
2 = Terrorist
3 = Counter-Terrorist
This command is especially good in minigames maps as you can randomly assign a player to a specific team after each round by making the trigger over the whole map and setting it to fire once.
To do this, be sure to enable mp_ignore_round_win_conditions 1 so the round doesnt end until the change is completed. mp_ignore_round_win_conditions 0 is default.
Example Number 4 - Assigning an entity name to a player:
This example is very crucial for you minigame or jailbreak builders. This will assign an entity name (much like a logic_relay or func_door) to a player so you can interact with the player without them having to be present in a trigger. This is useful for filtering buttons so only a specific player can press it, or having an entrance way that only 1 player per team can enter.
Example Number 5 - Interacting with map entites to show no link:
Ever put an epic secret in your map only to have someone break your map security, decompile your map and expose said secret? With Addoutput you can't stop them, but you can make them work a little harder for your hard built secrets!
The method to do this is, instead of creating a direct link to an entity, you have an AddOutPut to link it via parameter override. It won't show the output link directly and you can hide the entities, forcing them to seach each and every entity to find the one with the correct name.
As you can see, there is no direct correlation between the entities, but the door will work as though you put "
On StartTouch MyDoor1,Open" into the Outputs tab!
Example Number 6 - Make a player fly in x direction:
Most mappers will use trigger_push to make their players fly in a specific direction, but what if you could make your player move randomly in random directions on the trigger of, lets say, picking up a weapon?
Using basevelocity, this is possible. Basevelocity is the variable that tracks your movement, so adjusting it suddenly on a player will make it seem like they were launched to that particular speed and trajectory.
Here is an example of a basevelocity, to send a player flying upwards.
This will make the player fly to the heavens. It uses the same x y z as origin, but instead of basing the variables on the players location, x y z shows their view angle. You can get the xyz directions using Hammer then implement it in game.
basevelocity 200 0 100 - will make a player leap forward a longer distance than normal.
basevelocity 1000 0 0 - will make a player slide on the x axis (-/+).
Just remember that the Z axis is height.
Example Number 7 - Teleport a player without trigger_teleport:
This is an extremely handy command if you are like me, and like to exceed the max entity limits in your maps. This allows you to teleport a player by means of a button press, walking into a trigger, opening a door etc. See the command below:
Instead of using
On StartTouch, you can use OnOpen, OnBreak, OnPressed, etc. The possibilities are limitless.
Example Number 8 - Changing your player models on the fly (NO PLUGIN REQUIRED!!!):
This AddOutPut really made my day when i found it. When i made Hide N Seek, I hated that it required plugins that continuously broke down when the game was updated. Now you can change your player model into any MDL file you wish (as long as you pack it into the map if its custom) including fully animated skins.
Since this is in itself a full tutorial, i will simply link you to a tut my friend from DTK made: http://www.dying2kill.com.au/showthread.php/21936-MAP-Changing-Player-Models it is a write up based on work from Enviolinador.
This concludes my AddOutPut tutorial. There are heaps of commands you can utilize in Source. I especially like locking my maps up with this and making the server run a cfg script with the fixes in it, to stop thieves from stealing your unreleased work before its ready.
Anyway, if this tutorial worked for you, let me know, otherwise post your concerns below.