Before we start, let me explain valves script format abit. Brackets like these { } act like code blocks. They tell the engine where to look for information on the category above it.
Example:
We have a Classname keyword you use to search for a specific classname to edit or remove.
Code: Select all
Classname
{
//Put information here!
}
Manual Tutorial
Obsidian mapadd scripts allow you to make changes to current maps and add new entities such as NPCs or physical objects.
Scripts are located in the obsidian\maps\cfg folder.
First off lets add a new npc to a map.
Since you may not have the source to the map you will need to get coordinates for the object you want to place. Please keep in mind that you can decompile a map and get coordinates without having to do any real work in-game. Download VMEX to decompile maps.
To manually get coordinates in-game, move to the location you want your ent to spawn, and type status in the console. To open the console press the tilde key (~). This looks like a good place, on the snow hill.
If the console doesn't come up go into options and under keyboard press advanced...
Turn on Enable Developer Console in this window and close. Back in game the console should come up with the tilde key (~).
Now when you type status in console you will get a window that looks like this.
The area I have boxed in red is what you need, shows your current location in the map.
Now what shall we put here...
A citizen named joe thats red and has an smg weapon.
For entity information open Valve Hammer and create a new map. In this map create an npc_citizen or whatever you want and in its properties type in anything you want.
Now save this map with the new ents to the desktop or a place you can access it. Open the VMF file in notepad.
This is what you should see.
The area I have highlighted is what you need. Now create a new txt document. Name it, [mymap]_modify
Replace [mymap] with the name of your map.
Place this document in the obsidian\maps\cfg folder.
Open and inside it should look like this, based off the information from the VMF file you exported from hammer.
In place of origin fill in the location you got from the console as I have in the screenshot above.
Save this file and load up the map.
And look what we have here, our red citizen ready for action!
Other useful commands in the modify scripts are Modify, Remove, and SpawnItems.
Spawnitems works like this.
Code: Select all
SpawnItems
{
"weapon_smg1" "1"
"weapon_uzi" "2"
"item_battery" "1"
"item_ammo_smg1" "3"
"weapon_healer" "1"
}
Remove works like this.
Code: Select all
Remove
{
Classname
{
"prop_physics" {}
}
Targetname
{
"lawlfire1" {}
}
Origin
{
"178 446 9" {}
}
}
Modify works like this.
Code: Select all
Modify
{
Classname
{
"npc_combine_s"
{
"rendermode" "2"
"renderamt" "200"
}
}
Targetname
{
"pet_headcrab"
{
"targetname" "txtcrab"
}
}
Origin
{
"64 -424 14"
{
"angles" "0 0 90"
"rendermode" "2"
"renderamt" "150"
}
}
}
For a good example of how this should all look in the txt files open the map modify files in the obsidian\maps\cfg folder.
Please keep all further questions about this in this thread.