1 / 14

Adding Weapons to a Half-Life 2 Mod.

Adding Weapons to a Half-Life 2 Mod. 3 Scopes of Chocolate Tutorial. Will not cover Modeling Coding Will cover Taking weapon code and model and putting them into the game. Dude, where’s my Weapon?. To put a weapon into the Mod, you will need one first. Create a new Single Player Mod.

callum-pace
Download Presentation

Adding Weapons to a Half-Life 2 Mod.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Adding Weapons to a Half-Life 2 Mod.

  2. 3 Scopes of Chocolate Tutorial • Will not cover • Modeling • Coding • Will cover • Taking weapon code and model and putting them into the game.

  3. Dude, where’s my Weapon? • To put a weapon into the Mod, you will need one first. • Create a new Single Player Mod. • In the SDK click on the button. Hit Next. • Select the bullet. Hit Next. • Put the Mod anywhere you can remember in 2 minutes, and name the mod anything you like. • Compile the Single Player Mod. • We will be taking a weapon out of the single player game and putting it into your Mod.

  4. Takes Two to Tango • Each weapon has a series of animated models for each action it can do (Reload, fire, Ect.), and a .qc (text file) that links them together and allows to the code to use it. • The ones we will use are located at: (You do not need to go here, or do anything on this slide, feel free to forget everything on it.)

  5. Yonik! • The model files now have to be added to our own Mod. • Open up a command prompt and type in cmd • Navigate to the “sourceSDK” folder in the steam directory.

  6. Clato Naoto Victo? • Then type in this very long command: bin\studiomdl -game “D:\Steam\SteamApps\SourceMods\[moddirectory]" “D:\Steam\SteamApps\[username]\sourcesdk_content\hl2\modelsrc\weapons\v_pistol\v_pistol.qc (that’s all one line in the command prompt using your own directory information)

  7. Script Kittens • Script files contain basic variables dealing with objects in your mod, like guns, cars, and sounds. • They are not needed but make so that you don’t need to recompile your mod after small behavior changes. (forget this page too)

  8. Let There Be Bullets …and Sound. • In your (compiled) Single player(SP) mod, go to the folder called Scripts. • Copy the file called weapon_pistol.txt into your real mods Script folder.

  9. Back in the SP mod Scrip folder, open the called game_sounds_weapons.txt • Search for weapon_pistol.txt • Copy all 8 methods in this file to your mods game_sounds_weapons.txt file. • You can’t just copy the game_sounds_weapons.txt file over

  10. And here I thought I was an art major • Now the weapon must be put into code • Download the file pistol.zip off of my website: www.coe.uncc.edu/~rwhiting/weapon.zip • This file hold the coding for the weapon itself. • Create a file in your own mods (source) directory to hold this file. Name it hl2r, and unzip it in the src\game_shared folder.

  11. 20/20 Visual • Open your mods project in Visual by clicking on the in the src folder of your mods (source) directory. • Open the Solution Explorer (View-> solution Exploer)

  12. In the Client Tab, right click on the folder and click Add->New Folder. Call it HL2R. • Do the same thing under the Server Tab. • Right click on the new HL2R folder in the client Tab, and click . Navigate to the HL2R folder and add both files you put in there. • Do the same for the server tab.

  13. Time to wake up! • Click on Build-> solution • Then wait for the output to give you no errors because you did everything right.

  14. Fin. • Special Thanks to: • MSpaint • HL2Coding.com (example pistol code)

More Related