[Tutorial] How to use Obsidian Mapadd

Archived Source Engine and Obsidian Tutorials.
skidz
Obsidian Gold
Obsidian Gold
Posts: 3228
Joined: Mon May 29, 2006 6:36 am
Location: Maple Ridge, BC
Contact:

[Tutorial] How to use Obsidian Mapadd

Post by skidz »

Zteer's Mapadd Generator is a great tool for doing this. When you decompile a map and edit and add entities, you save the new vmf and compare it to the decompiled vmf. The program will extract the changed and put them in a mapadd file. Great little program, check it out! :thumbup:

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!
}
As you can see if I want to add comments that the engine will ignore, I use the forward slash twice before typing.

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.

Image

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.

Image

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.

Image

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.

Image

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.

Image

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!

Image

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"
	}
Any weapons added after SpawnItems will be given to each player as the default spawn items.

Remove works like this.

Code: Select all

	Remove
	{
		Classname
		{
			"prop_physics" {}
		}

		Targetname
		{
			"lawlfire1" {}
		}

		Origin
		{
			"178 446 9" {}
		}
	}
Classname will remove all entities under the entity category prop_physics, Targetname will remove all entities with the name lawlfire1 and origin will remove entities with that particular origin.

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"
			}
		}
	}
Same as remove, all entity category npc_combine_s will have those values changed on them. Targetname will change the entity with the name pet_headcrab and Origin will change ents at that origin.

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.
Last edited by skidz on Wed May 30, 2007 9:50 pm, edited 6 times in total.
[JSC]King of the crowbar
prop_static
prop_static
Posts: 69
Joined: Sun Jul 23, 2006 7:05 am

Post by [JSC]King of the crowbar »

skidz... i love you :shock:
skidz
Obsidian Gold
Obsidian Gold
Posts: 3228
Joined: Mon May 29, 2006 6:36 am
Location: Maple Ridge, BC
Contact:

Post by skidz »

You dont have to reset the mod to see your changes, only the map.
Ill write some tutorials explaining the other script files in that folder later, but they are pretty self explanitory.
[JSC][GU]PREDATOR
Obsidian Premium
Obsidian Premium
Posts: 1624
Joined: Mon May 29, 2006 12:06 pm

Post by [JSC][GU]PREDATOR »

This will be a bit difficult if you are going to make this mod in versions because the next one might have new npc's in it and new entity's so people would be behind.
skidz
Obsidian Gold
Obsidian Gold
Posts: 3228
Joined: Mon May 29, 2006 6:36 am
Location: Maple Ridge, BC
Contact:

Post by skidz »

[JSC]_PREDATOR wrote:This will be a bit difficult if you are going to make this mod in versions because the next one might have new npc's in it and new entity's so people would be behind.
I dont see how that changes anything here.
[JSC][GU]PREDATOR
Obsidian Premium
Obsidian Premium
Posts: 1624
Joined: Mon May 29, 2006 12:06 pm

Post by [JSC][GU]PREDATOR »

So does it update automatically?
skidz
Obsidian Gold
Obsidian Gold
Posts: 3228
Joined: Mon May 29, 2006 6:36 am
Location: Maple Ridge, BC
Contact:

Post by skidz »

This is so people can change currently compiled maps to their liking.
Add more npcs, weapons, or maybe a server advert banner.
Automatic updating is possible but pointless in this case. It will update when the map is reloaded.
skidz
Obsidian Gold
Obsidian Gold
Posts: 3228
Joined: Mon May 29, 2006 6:36 am
Location: Maple Ridge, BC
Contact:

Post by skidz »

[JSC]King of the crowbar wrote:Hyperjag3... i love you :shock:
Fixed :wink:
User avatar
Vasili
npc_helicopter
npc_helicopter
Posts: 901
Joined: Wed Aug 02, 2006 8:22 pm
Location: England

Post by Vasili »

This is a bit confusing, but i under stand
Svanrog
Combine Rebel
Combine Rebel
Posts: 1319
Joined: Tue Jul 25, 2006 9:17 pm

Post by Svanrog »

All the scripts you've set up for us are wonderful! I give you a very big plus for that!
I love you all in the Obsidian team! :D
User avatar
Vasili
npc_helicopter
npc_helicopter
Posts: 901
Joined: Wed Aug 02, 2006 8:22 pm
Location: England

Post by Vasili »

I dont have this Image I just get normal ent's
Power-Mad
Combine Rebel
Combine Rebel
Posts: 1219
Joined: Tue Jun 13, 2006 7:24 am
Location: Minnesota

Post by Power-Mad »

This is possbly the most helpful feature I've seen, time to add zombine spawners to deadland :D
Image
destu
npc_helicopter
npc_helicopter
Posts: 995
Joined: Mon Jul 10, 2006 7:17 pm

Post by destu »

Vasili wrote:I dont have this Image I just get normal ent's
That's because you havent configured hammer to use obsidian conflict fgd
User avatar
Vasili
npc_helicopter
npc_helicopter
Posts: 901
Joined: Wed Aug 02, 2006 8:22 pm
Location: England

Post by Vasili »

destu wrote:
Vasili wrote:I dont have this Image I just get normal ent's
That's because you havent configured hammer to use obsidian conflict fgd
I did! I put the text in the right place, and put the fdg in the right place, still dont work
User avatar
Lark
npc_advisor
npc_advisor
Posts: 1077
Joined: Sat Jun 10, 2006 3:21 am
Location: Termina
Contact:

Post by Lark »

I am trying to add 5 lives to the noamz map but how do I add lives mode to the map with the map add?
Post Reply