User:Hurricaaane/Projects

From Valve Developer Community
Jump to navigation Jump to search
  • REMEMBER:
Write the page
Check if something was forgotten
Add schematic pictures
Correct spelling mistakes

A global idea

When you want to do some specific subject which need entities that is not explained by any tutorial, what you have to do is to study the entities. At least remember the global description of the entities. Then you will be able to select in these entities those which you need in the accomplishment of your task. Write down what you need in your task. Then write what constraints inferfeer in the accomplishment of your task. This is particulary linked on the main entity where you will apply effects of other entities on. Only now you can select the entities you need in order to check the objectives and avoid the constraints.

For example, you want to do a Scanner that spawns manhacks when it photograph you. The main entity is Npc_cscanner. Study this entity: You will see that the output OnPhotographPlayer exists. If you study it clearly, even if you are hidden when the Scanner flashes, the output is triggered. This is the constraint.

You will now think about the idea. You want the OnPhotographPlayer to work when it sees the player, but not when it is not seen. There are two outputs that activates when the Scanner finds the player(OnFoundPlayer), and when it loses him from its line of sight (OnLostPlayerLOS). The problem is that you don't want the scanner to send manhacks when it sees it but when it sees AND it makes a flash.

If you have studied the entities, you would know that the Logic_branch is an entity where you can output when the value is 1(True) or 0(False). We can say in another way: If it's true that the Scanner sees the player, trigger the output.

That's all! Now you have all the bases and you can easily connect the entities theorically:

  • When the scanner sees the player(OnFoundPlayer) : Set the branch value to 1(SetValue 1).
  • When the scanner have lost the player LOS(OnLostPlayerLOS) : Set the branch value to 0(SetValue 0).
  • When the scanner photograph the player(OnPhotographPlayer) : Test the branch.
  • When the test is true(OnTrue) : Enable the Manhack spawner (Npc_template_maker) once only.

These are the outputs we should make:

Object outputs: scanner_tscanner - npc_cscanner
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnFoundPlayer branch_tscanner SetValue 1 0.00 No
Io11.png OnLostPlayerLOS branch_tscanner SetValue 0 0.00 No
Io11.png OnPhotographPlayer branch_tscanner Test <none> 0.00 No


Object outputs: branch_tscanner - logic_branch
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrue maker_tmanhack Enable <none> 1.00 Yes

All you need to do from now is to create it and see if the theory is true. If its not, you have to find why the theory is wrong, or make other decisions.