Valve Developer site is best for scripting. If you have an entity in mind that you want to work with just take a look at the link below for all the entities and their values.
https://developer.valvesoftware.com/wik ... f_entities
You can write your scripts in any word/text editor, I suggest you to use notepad or notepad++ which is ideal for scripts.
All scripts must be saved in the directory below and as a ".cfg" format.
"Steam\steamapps\YOUR USER NAME\half-life 2 deathmatch\hl2mp\cfg"
"Name_of_script.cfg"
All your scripts can be executed by using the command below in the HL2:DM Console.
exec Name_of_script
You do not need to put in the extension. ".cfg"
To open up your console watch the tutorial down below.
http://www.youtube.com/watch?v=rJdd1SLz3_Y
http://www.area51cheatserver.com/scriptbuilder.html
Anything with <...> must be filled in.
bind <Key> "exec <Name_of_script>"
Entities
ent_create <entity name>
Keyvalues
ent_fire <name> addoutput "<keyvalue> <value>"
Inputs
ent_fire <name> <input> <value>
Outputs
ent_fire <name> addoutput "<output> <name>,<input>,<value>" OR
ent_fire <name> addoutput "<output> <name>,addoutput,<keyvalue> <value>"
Waits
wait 100;ent_fire <name>
Ent_setname <Name> - A command which sets an entities name.
Ent_fire - A command which can allow you to give/change entities properties.
Npc_create <Name of entity> - A command which creates an NPC to where ever you are pointing to with your crosshair.
Give <Name of entity> - A command which creates an entity right under neath your feet.
Wait <Amount>; - Wait commmand allows to make something happen after a certain time. (100 = 1 sec)
Kill - Delete's the entity.
!activator - The one that activate it.
!self - Yourself.
!picker - Where you are looking. (Doesn't work in Multiplayer.)
!player - Player entity. (Doesn't work in Multiplayer.)
!caller - Object itself.
Classname - is a key value to change an entities class name so other players cannot change or delete your entities. This makes your entity unique and none of other players can change the entities properties by using "ent_fire" to change any key values. Unless they know your targetname and classname.
Keep in mind that different entities have different key values and may not be exactly the same and you cannot make up your own.
If you have an entity in mind that you want to work with just take a look at the link below for all the entities and their values.
https://developer.valvesoftware.com/wik ... f_entities
The syntax for key values.
ent_fire <name> addoutput "<keyvalue> <value>"
Let's start of with a simple key value.
ent_fire npc adddoutput "rendercolor 255 0 0"
The key value is "rendercolor 255 0 0"
That example will make any entity named "npc" change it's color to red.
When ever you want to add a key value to an entity always type in "addoutput" after "ent_fire <name>" this adds an output and will let you manipulate with the entity to your preferable settings by using key values.
Ent_create <Name of entity> - A command which creates an entity to where ever you are pointing to with your crosshair.
Npc_create <Name of entity> - A command which creates an NPC to where ever you are pointing to with your crosshair.
Give <Name of entity> - A command which creates an entity right under neath your feet.
prop_dynamic_create <Root of model/object> - A command which allows you to create a dynamic object.
prop_physics_create <Root of model/object> - A command which allows you to create a physical object.
npc_create uses a very simple syntax, and is simply "npc_create npc_name". An example of this.
npc_create npc_gman
This spawns a Gman to where ever you are pointing to with your crosshair.
Let's make a object now, what you will need to know is the syntax of creating the object and the root of the object.
prop_dynamic_create <Root/object> - A command which allows you to create a dynamic object.
prop_physics_create <Root/object> - A command which allows you to create a physical object.
When you type in "prop_physics_create" you are already in the models folder so the only thing you need to do is to give the root of the model you want to spawn.
We will now spawn a blastdoor because it is one of the most used and popular props to build any sorts of buildings. The root and the name of the object is down below.
props_lab/blastdoor001c.mdl - Folder_in_models_folder/Another_folder/model.mdl
You can also bind the syntax of making the blastdoor to a key so it's faster to build a building.
bind <key> "prop_physics_create props_lab/blastdoor001c.mdl"
npc_create npc_gman - Creates NPC Gman.
ent_setname gman - Names the entity "gman" (Must be looking at the Gman to setname it.)
ent_fire gman addoutput "rendercolor 255 0 0" - Changes the color of the entity to "red 255 0 0".
The link below is a good place to find your colors that you are looking for. Remember that when ever you want to set a color to something use the RGB rule.
http://www.generateit.net/color-schemes/
For example
ent_fire <name> addoutput "rendercolor RED GREEN BLUE"
ent_fire <name> color "RED GREEN BLUE"
If you ever want to set the color of your self then use the syntax down below.
Code: Select all
ent_fire !self addoutput "rendercolor R G B"
http://www.mediafire.com/?k6m1gp6drv3r5mw
The command is.
wait <Amount>;
For example.
wait 100;ent_fire !self addoutput "rendercolor 255 0 0" - After 1 second your color will change to red.
wait 200;ent_fire !self addoutput "rendercolor 0 255 0" - After 2 seconds your color will change to green.
wait 300;ent_fire !self addoutput "rendercolor 0 0 255" - After 3 seconds your color will change to blue.
First you need to know the Syntax's of making a explosion script.
ent_create <entity name>
ent_fire <name> addoutput "<keyvalue> <value>"
ent_fire <name> <input> <value>
wait 100;ent_fire <name>
The syntax's above is now your structure to make a explosion script.
First what you need to know is the entity name to make a explosion which is "env_explosion"
Anything with <...> must be filled in.
ent_create env_explosion
Now we will need to name and class name it. Make sure the targetname and classname are the same, it will just be easier to keep the same.
ent_fire env_explosion addoutput "targetname <name>"
ent_fire <name> addoutput "classname <name>"
Once we done that now we can add key values and inputs.
Here is the list of key values and inputs you will need to use in order to make a successful explosion script.
The key values and inputs should be used like this.
ent_fire <name> addoutput "<Keyvalue> <value>"
ent_fire <name> <input>
iMagnitude - Key value, The amount of damage done by the explosion.
iRadiusOverride - Key value, The radius in which the explosion damages entities.
explode - Input, triggers the entity to explode.
Once you done the key values and inputs, you now must delete the explosion by using this simple syntax with a wait command so it doesn't delete the explosion straight away otherwise there will be no explosion.
wait 100;ent_fire <name> kill
Congratulations you just made your first script, your script should look something like this.
ent_create env_explosion
ent_fire env_explosion addoutput "targetname <name>"
ent_fire <name> addoutput "classname <name>"
ent_fire <name> addoutput "<Key value> <Value>"
ent_fire <name> addoutput "<Key value> <Value>"
ent_fire <name> explode
wait 100;ent_fire <name> kill
Ant_8490
Nick_6893
http://www.area51cheatserver.com/data/scripts.php
Learning from scripts is a good idea too if you know what you are doing.
If I have made a mistake somewhere please write down what's wrong.