Difference between revisions of "Mini-mod tutorial"

From Valve Developer Community
Jump to: navigation, search
m
Line 54: Line 54:
 
Target entites named: console
 
Target entites named: console
  
Via this imput: Command
+
Via this input: Command
  
 
With a parameter override of:  exec YOURMAPNAME
 
With a parameter override of:  exec YOURMAPNAME

Revision as of 05:43, 29 June 2005

Making your own Mini-mod.

Ok so you don’t know C++ and have no idea what a cpp file is, but that doesn’t limit you to the normal HL2 style game play on you custom single player map.

This tute is going to teach you how to make a CFG file and how to execute it from inside your map.

First thing to think about is that you are only limited by commands you can type in the console. With that said there are a lot of little things you can do to make your map different from others.

For example, you can change the distance the gravity gun can pull from, the speed it throws objects, you can change the max ammo a weapon can carry, you could activate colliding rag dolls, the damage a weapon deals. Anything you can set in the console. So start looking through those commands.


First things first. Open good old notepad.

Now for anything you want to happen for your map, type as you would in the console. In my case the first two lines read:

sv_cheats 1

bind "tab" "incrementvar host_timescale 0.25 1 0.75; incrementvar mat_yuv 0 11"

stupid thing to do.

To string commands together use the ; (semicolon)

If there is any thing else particular to your map that you want to add do that too. Mine looks like this:

sv_cheats 1

bind "tab" "incrementvar host_timescale 0.25 1 0.75; incrementvar mat_yuv 0 1 1"

cl_ragdoll_collide 1

sk_max_ar2_altfire 10


(so I have a bullet time thing set to the tab key as well as a black and white shader for effect & sv_cheats on so the bullet time will work, my rag dolls will not clip each other, and the cool bouncy balls for the assault riffle now max out at 10)

When you go to save, make sure you have "all files" selected in the ‘save as type’ drop down, and save it as YOURMAPNAME.cfg In the following directory:

\steam\SteamApps\[user name]\half-life 2\hl2\cfg


With that done lets open hammer and our 1st map for the Mini-mod.

Add a logic_auto into your map. (I like to keep it next to the player start to keep track of things.) Now add a point_clientcommand next to that. And name it "console"

Then in the outputs for your logic_auto fill it out like this:

Output: OnMapSpawn

Target entites named: console

Via this input: Command

With a parameter override of: exec YOURMAPNAME

What this does is once your map loads the logic_auto tells the point_clientcommand to load the cfg file you chose, essentially typing in all the console commands you entered into that file.

That’s it.. All your changes should be loaded for your player. For added professionalism you could add some game_text entities with little messages like "’tab’ bullet time on/off" So your player knows about the new button changes.


Distribution

All you have to do is make sure you add the cfg file to your achieve folder containing your bsp files and stuff. And make sure you give instructions on moving it to the cfg folder.


Uninstall

Because the bind command is actually binding commands to a key, even without the cfg file in your HL2 directory those commands will be kept.

Make a new cfg file called uninstallyourmapname.cfg And make sure all the key you binded are removed i.e:

bind "tab" ""

That will remove that binding in my example. Distribute this file with you map, and write instructions on performing the uninstall.


Downside

The downside is, your commands will stay loaded even when the player stops playing your map and plays another one like an official HL2 maps. Or even quits HL2 (so use the uninstall method to clean things up. And thirdly im only learning all this and there are some bugs to iron out but you guys can work around em. And if any one knows a way to slow the audio down with console commands I’d love to make that bullet time effect cooler, so let me know.

Regards Treb