Making a Black Mesa Mod: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{langsp}}
{{langsp}}
{{back | Black Mesa Level Creation}}
{{back | Black Mesa Level Creation}}
{{Tutorial Skill Level | skill=3}}
{{Tutorial Skill Level | skill=3}}


Line 9: Line 8:
Head to your local variation of C:\Program Files (x86)\Steam\steamapps\common\Black Mesa then create a folder with your mod's name, for the sake of the tutorial we will use: myfirstmod.
Head to your local variation of C:\Program Files (x86)\Steam\steamapps\common\Black Mesa then create a folder with your mod's name, for the sake of the tutorial we will use: myfirstmod.


==Setting up the files:==
===Setting up the files===
Navigate into the directory and create the following folders and subfolders:
Navigate into the directory and create the following folders and subfolders:
* resource
* resource
Line 21: Line 20:
{{Note|Use a program like {{vPKEdit|4}} to extract the files from VPK}}
{{Note|Use a program like {{vPKEdit|4}} to extract the files from VPK}}


==Setting up the chapters:==
==Setting up the chapters==
Create a scripts/chapter_manifest.txt inside your newly created scripts folder
Create a scripts/chapter_manifest.txt inside your newly created scripts folder
It should be something like this: Edit it to replace with your map names / the amount of chapters you have
It should be something like this: Edit it to replace with your map names / the amount of chapters you have
<source>
{{codeBlock|<nowiki>
"chapter_manifest.txt"
"chapter_manifest.txt"
{
{
Line 32: Line 31:
}
}


</source>
</nowiki>}}


Next up create a blackmesa.json file inside myfirstmod/campaigns/, modify it to suit your needs.
Next up create a blackmesa.json file inside myfirstmod/campaigns/, modify it to suit your needs.
<source>
{{codeBlock|<nowiki>
{
{
{
{
Line 65: Line 64:
}
}
}
}
</source>
</nowiki>}}
{{Note|The imageSource path is relative to the ui/images folder of your mod and example would be "image://game/ui/campaign/images/chapter1.png"}}
{{Note|The imageSource path is relative to the ui/images folder of your mod and example would be "image://game/ui/campaign/images/chapter1.png"}}
Make sure to replace each #key in the file with the corresponding one in your corresponding localization file (See the next step)
Make sure to replace each #key in the file with the corresponding one in your corresponding localization file (See the next step)


==Setting up the text for chapters:==
==Setting up the text for chapters==
Create a myfirstmod_english.txt in myfirstmod/resources/
Create a myfirstmod_english.txt in myfirstmod/resources/
It should look something like this, modify it to your needs
It should look something like this, modify it to your needs
<source>
{{codeBlock|<nowiki>
"lang"
"lang"
{  
{  
Line 87: Line 86:
}  
}  
}
}
</source>
</nowiki>}}
{{warning|<u>'''This file must be saved in a Unicode format.'''</u>}}
{{warning|<u>'''This file must be saved in a Unicode format.'''</u>}}


{{note|For windows save as '''UTF-16 LE''' In Notepad, under <code>Save As...</code>, this is equivalent to choosing <code>unicode</code> for the <code>Encoding</code> option at the bottom of the dialog.}}
{{note|For windows save as '''UTF-16 LE''' In Notepad, under <code>Save As...</code>, this is equivalent to choosing <code>unicode</code> for the <code>Encoding</code> option at the bottom of the dialog.}}


==Creating the gameinfo.txt file:==
==Creating the gameinfo.txt file==
Now you will need create your gameinfo file inside your myfirstmod folder.
Now you will need create your gameinfo file inside your myfirstmod folder.
Use the following one as a template and modify it to your needs:
Use the following one as a template and modify it to your needs:
<source>
{{codeBlock|<nowiki>
"GameInfo"
"GameInfo"
{
{
Line 179: Line 178:
}
}
}
}
}</source>
}</nowiki>}}


==Creating the BAT file:==
==Creating the BAT file==


Create a file, call it something like myfirstmod.bat
Create a file, call it something like myfirstmod.bat
This is so {{windows|4}} users can launch the mod.
This is so {{windows|4}} users can launch the mod.
<source>
{{codeBlock|<nowiki>
@echo off
@echo off
if exist "%~dp0\bms.exe" (
if exist "%~dp0\bms.exe" (
Line 192: Line 191:
start "" "%~dp0\..\..\..\..\common\Black Mesa\bms.exe" -game myfirstmod %*
start "" "%~dp0\..\..\..\..\common\Black Mesa\bms.exe" -game myfirstmod %*
)
)
</source>
</nowiki>}}


Also create one for the people who want to launch with oldgameui:
Also create one for the people who want to launch with oldgameui:


<source>
{{codeBlock|<nowiki>
@echo off
@echo off
if exist "%~dp0\bms.exe" (
if exist "%~dp0\bms.exe" (
Line 203: Line 202:
     start "" "%~dp0\..\..\..\..\common\Black Mesa\bms.exe" -game myfirstmod -oldgameui %*
     start "" "%~dp0\..\..\..\..\common\Black Mesa\bms.exe" -game myfirstmod -oldgameui %*
)
)
</source>
</nowiki>}}


==Creating the SH file:==
==Creating the SH file==


Create a file, call it something like myfirstmod.sh
Create a file, call it something like myfirstmod.sh
This is so {{linux|4}} users can launch the mod.
This is so {{linux|4}} users can launch the mod.
<source>
{{codeBlock|<nowiki>
#!/bin/sh -e
#!/bin/sh -e
steam -applaunch 362890 -game myfirstmod $@
steam -applaunch 362890 -game myfirstmod $@




</source>
</nowiki>}}


Also create one for the people who want to launch with oldgameui:
Also create one for the people who want to launch with oldgameui:


<source>
{{codeBlock|<nowiki>
#!/bin/sh -e
#!/bin/sh -e
steam -applaunch 362890 -game myfirstmod -oldgameui $@
steam -applaunch 362890 -game myfirstmod -oldgameui $@




</source>
</nowiki>}}


==Final notes:==
==Final polish==
This should be just enough to get your mod working, you'll need to add things like sound manifests, models etc aswell.
This should be just enough to get your mod working, you'll need to add things like sound manifests, models etc aswell.


You could customize the UI further, for example by changing the colors or the actual layout by editing the .qml inside ui/ of bms_misc_dir.vpk
You could customize the UI further, for example by changing the colors or the actual layout by editing the .qml inside ui/ of bms_misc_dir.vpk

Revision as of 21:47, 27 February 2024

English (en)Translate (Translate)
Black Mesa Level Creation
Skill Level

This tutorial expects you to have this amount of knowledge within the topic to follow along smoothly.

Novice Familiar Competent Proficient Expert


This article will discuss the creation of a Black mesa mod

Creating a mod

Head to your local variation of C:\Program Files (x86)\Steam\steamapps\common\Black Mesa then create a folder with your mod's name, for the sake of the tutorial we will use: myfirstmod.

Setting up the files

Navigate into the directory and create the following folders and subfolders:

  • resource
  • scripts
  • mapsrc
  • mapsrc/instances
  • campaigns
  • ui

Inside the newly created resource folder add: clientscheme.res and gamemenu.res from: bms_misc_dir.vpk

Note.pngNote:Use a program like VPKEdit VPKEdit to extract the files from VPK

Setting up the chapters

Create a scripts/chapter_manifest.txt inside your newly created scripts folder It should be something like this: Edit it to replace with your map names / the amount of chapters you have

"chapter_manifest.txt" { yourmapname_a 1 // the 1 at the end means it's part of chapter 1 yourmapname_b 2 // the 2 at the end means it's part of chapter 2 yourmapname_c 2 // Multiple maps can share same chapter }

Next up create a blackmesa.json file inside myfirstmod/campaigns/, modify it to suit your needs.

{ { "author": "mod author", "url": "", "title": "#key", "description": "", "imageSource": "image://game/ui/campaign/images/logo.jpg", "chapters": [ { "title": "#key", "description": "", "imageSource": "yourpathtoimage", "levelName": "yourmapname" }, { "title": "#key", "description": "", "imageSource": "yourpathtoimage", "levelName": "yourmapname" }, { "title": "#key", "description": "", "imageSource": "yourpathtoimage", "levelName": "yourmapname" } ] } }
Note.pngNote:The imageSource path is relative to the ui/images folder of your mod and example would be "image://game/ui/campaign/images/chapter1.png"

Make sure to replace each #key in the file with the corresponding one in your corresponding localization file (See the next step)

Setting up the text for chapters

Create a myfirstmod_english.txt in myfirstmod/resources/ It should look something like this, modify it to your needs

"lang" { "Language" "English" "Tokens" { // CHAPTER TITLE CARDS "MYFIRSTMOD_CampaignName_BMSCP1" "CAMPAIGN" // Title, see blackmesa.json for more info "MYFIRSTMOD_Chapter1_Title" "The First Chapter" "MYFIRSTMOD_Chapter2_Title" "The Second Chapter" "MYFIRSTMOD_Chapter3_Title" "CREDITS" } }
Warning.pngWarning:This file must be saved in a Unicode format.
Note.pngNote:For windows save as UTF-16 LE In Notepad, under Save As..., this is equivalent to choosing unicode for the Encoding option at the bottom of the dialog.

Creating the gameinfo.txt file

Now you will need create your gameinfo file inside your myfirstmod folder. Use the following one as a template and modify it to your needs:

"GameInfo" { game "myfirstmod" gamelogo 1 developer "Developer Name" developer_url "http://www.blackmesasource.com/" type "both" gamelogo 1 SupportsDX8 0 SupportsXbox360 1 nomodels 1 nocrosshair 1 GameData "bms.fgd" InstancePath "myfirstmod/mapsrc/instances/" hidden_maps { } FileSystem { SteamAppId 362890 ToolsAppId 211 // // Search paths are relative to the base directory, which is where hl2.exe is found. // // |gameinfo_path| points at the directory where gameinfo.txt is. // We always want to mount that directory relative to gameinfo.txt, so // people can mount stuff in c:\mymod, and the main game resources are in // someplace like c:\program files\valve\steam\steamapps\half-life 2. // SearchPaths { // First, mount all user customizations. This will search for VPKs and subfolders // and mount them in alphabetical order. The easiest way to distribute a mod is to // pack up the custom content into a VPK. To "install" a mod, just drop it in this // folder. // // Note that this folder is scanned only when the game is booted. game+mod myfirstmod/custom/* game+mod myfirstmod // Black Mesa VPK files. game+mod bms/bms_textures.vpk game+mod bms/bms_materials.vpk game+mod bms/bms_models.vpk game+mod bms/bms_misc.vpk game+mod bms/bms_sounds_misc.vpk game+mod bms/bms_sound_vo_english.vpk game+mod bms/bms_maps.vpk // HL2 VPK files. game |all_source_engine_paths|hl2/hl2_misc.vpk game |all_source_engine_paths|hl2/hl2_sounds_misc.vpk game |all_source_engine_paths|hl2/hl2_textures.vpk game |all_source_engine_paths|hl2/hl2_materials.vpk game |all_source_engine_paths|hl2/hl2_models.vpk // Platform VPK files. platform |all_source_engine_paths|platform/platform_misc.vpk // Now search loose files. We'll set the directory containing the gameinfo.txt file // as the first "mod" search path (after any user customizations). This is also the one // that's used when writing to the "mod" path. game+mod+mod_write+default_write_path |gameinfo_path|. gamebin |gameinfo_path|bin // Load the BMS DLL files, mod will crash without this! gamebin "|all_source_engine_paths|bms/bin" // Add the HL2 directory as a game search path. This is also where where writes // to the "game" path go. game hl2 // Last, mount in shared HL2 loose files game |all_source_engine_paths|hl2 platform |all_source_engine_paths|platform } } }

Creating the BAT file

Create a file, call it something like myfirstmod.bat This is so Windows Windows users can launch the mod.

@echo off if exist "%~dp0\bms.exe" ( start "" "%~dp0\bms.exe" -game myfirstmod %* ) else ( start "" "%~dp0\..\..\..\..\common\Black Mesa\bms.exe" -game myfirstmod %* )

Also create one for the people who want to launch with oldgameui:

@echo off if exist "%~dp0\bms.exe" ( start "" "%~dp0\bms.exe" -game myfirstmod -oldgameui %* ) else ( start "" "%~dp0\..\..\..\..\common\Black Mesa\bms.exe" -game myfirstmod -oldgameui %* )

Creating the SH file

Create a file, call it something like myfirstmod.sh This is so Linux Linux users can launch the mod.

#!/bin/sh -e steam -applaunch 362890 -game myfirstmod $@

Also create one for the people who want to launch with oldgameui:

#!/bin/sh -e steam -applaunch 362890 -game myfirstmod -oldgameui $@

Final polish

This should be just enough to get your mod working, you'll need to add things like sound manifests, models etc aswell.

You could customize the UI further, for example by changing the colors or the actual layout by editing the .qml inside ui/ of bms_misc_dir.vpk