Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get HL2SB compiling #7

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 33 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
DisableFormat: true
# TODO: Consider enabling formatting, e.g:
# BasedOnStyle: Google
# SortIncludes: false # Important, or sorting includes will break some dependencies
# IndentWidth: 2
# TabWidth: 2
# UseTab: Never

# SpaceBeforeParens: ControlStatements
# SpacesInParentheses: true
# SpacesInAngles: true
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: true
# SpaceBeforeAssignmentOperators: true
# SpacesInConditionalStatement: true

# ColumnLimit: 0
# AlignTrailingComments: true
# IndentCaseLabels: true

# AllowShortFunctionsOnASingleLine: Empty

# BreakBeforeBraces: Allman
# BraceWrapping:
# AfterClass: true
# AfterControlStatement: true
# AfterEnum: true
# AfterFunction: true
# AfterNamespace: true
# AfterStruct: true
# AfterUnion: true
# BeforeCatch: true
# BeforeElse: true
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Path to your steammods mod directory ending without a \
STEAM_MOD_DIR="C:\Program Files (x86)\Steam\steamapps\sourcemods\hl2sb"

# Path to your Source SDK Base 2013 Multiplayer directory ending without a \
STEAM_SDK_DIR="G:\SteamLibrary\steamapps\common\Source SDK Base 2013 Multiplayer"
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Visual Studio (Code)
.vscode/
.vs/
*.suo
*.user
*.sln.docstates
*.obj
*.pch
*.tlog
*.log
*.scc
*.exp
*.ilk
*.lastbuildstate
vc100.pdb
ipch
*.sdf
*.opensdf
*.idb
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
*.vcxproj.vpc_crc
*.sln
*.sentinel
src/**/Release_mod_hl2mp/*
src/**/Release/*

# OSX/Linux build products
*.mak
*.mak.vpc_crc
*.xcodeproj/
obj*/
!devtools/*.mak
!utils/smdlexp/smdlexp.mak

# Specific Source build products
client.pdb
client.dll
client.lib
server.pdb
server.dll
server.lib

client.so
client.so.dbg
server.so
server.so.dbg
server_srv.so
server_srv.so.dbg

client.dylib
client.dylib.dSYM/
server.dylib
server.dylib.dSYM/

*.sentinel

# files generated by running a mod
config.cfg
game/mod_hl2mp/**/*.cache
game/mod_hl2mp/**/*.dat
game/mod_hl2mp/stats.txt
game/mod_hl2mp/voice_ban.dt
game/mod_hl2mp/cfg/server_blacklist.txt
game/mod_hl2mp/maps/graphs/*.ain
game/mod_hl2mp/textwindow_temp.html

# shader files
*.tmp

# config file different for each user
.env
69 changes: 69 additions & 0 deletions GETTING_STARTED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Getting Started

## Requirements

- Source SDK 2013 Multiplayer Base (Installed through Steam)
- Visual Studio 2022 (or newer)
- [Visual Studio 2013 (for the Source SDK 2013 solution)](https://archive.org/details/en_visual_studio_community_2013_with_update_5_x86_dvd_6816332)

*[» See the Source SDK 2013 documentation for more information.](https://developer.valvesoftware.com/wiki/Source_SDK_2013)*

## Getting started

1. Go into the `src/` directory and generate the Visual Studio solution.

```bash
cd src
creategameprojects.bat
```

2. Open the created `games.sln` solution in Visual Studio 2022 (or newer).

> [!WARNING]
> Despite building in Visual Studio 2022, the Source SDK 2013 solution requires Visual Studio 2013 to be installed.

3. Build the solution in `Release` mode.

4. After the build is complete make a symlink from the `game/mod_hl2mp` directory to your `steamapps/sourcemods` directory. E.g:

```bash
mklink /J "C:\Program Files (x86)\Steam\steamapps\sourcemods\hl2sb" "<path to this repo>\game\mod_hl2mp"
```

## Extras

<details>

<summary>Attaching the debugger</summary>

1. First generate the Visual Studio solution as described above.

2. Copy the `.env.example` file in the root of this repo to `.env`.

```bash
cp .env.example .env
```

3. Fill the `.env` file with the described values

4. Then run the `setupprojects.sh` script in `src` to modify the Visual Studio project files.

```bash
cd src
./setupprojects.sh
```

This will setup the Client Visual Studio project for debugging.

5. Start the Visual Studio solution

6. Set the `Client` project as the startup project

7. Press `F5` to start the debugger

> Alternatively for a manual approach: [check the official docs and use values like this:](https://developer.valvesoftware.com/wiki/Installing_and_Debugging_the_Source_Code)
> - Command: `C:\Program Files %28x86%29\Steam\steamapps\common\Source SDK Base 2013 Multiplayer\hl2.exe`
> - Command Arguments: `-allowdebug -dev -sw -game "C:\Program Files (x86)\Steam\steamapps\sourcemods\mod_hl2mp"`
> - Working Directory: `C:\Program Files %28x86%29\Steam\steamapps\common\Source SDK Base 2013 Multiplayer`

</details>
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Half-Life 2: Sandbox is an open-source sandbox modification of the Source Engine which provides Lua as a scripting platform for developers to quickly prototype game ideas. The minimalistic game includes a sandbox gamemode for playing with the many aspects of the Source Engine.

**📚 Find out how to build this project [here](./GETTING_STARTED.md).**

### Proudly powered by

[![ARGG](http://media.moddb.com/images/downloads/1/6/5011/profile.jpg "ARGG")](https://web.archive.org/web/20150222194420/http://skew.telefragged.com/mods/hl2/ARGG/)
Expand Down
Binary file added game/mod_hl2mp/bin/lua51.dll
Binary file not shown.
52 changes: 52 additions & 0 deletions game/mod_hl2mp/cfg/360controller.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
joy_name "Xbox360 controller"
joy_advanced 1
joy_advaxisx 3
joy_advaxisy 1
joy_advaxisz 0
joy_advaxisr 2
joy_advaxisu 4
joy_advaxisv 0
joy_forwardsensitivity -1
joy_sidesensitivity 1
joy_pitchsensitivity 1.0
joy_yawsensitivity -1.25
joy_autoaimdampenrange 0.85
joy_autoaimdampen 0.5
joy_lowend 0.65
joy_lowmap 0.15
joy_accelscale 1.4
joy_response_move 5
joy_response_look 1
joyadvancedupdate
crosshair 0
hud_draw_fixed_reticle 1

bind "Z AXIS POS" "+attack2"
bind "Z AXIS NEG" "+attack"

bind "JOY1" "+jump"
bind "JOY2" "+reload"
bind "JOY3" "+use"
bind "JOY4" "impulse 100"

bind "JOY5" "+speed"
bind "JOY6" "phys_swap"

bind "JOY7" "impulse 50"

bind "JOY10" "+zoom"
bind "JOY9" "toggle_duck"

bind "JOY8" "pause"

bind "POV_UP" "slot1"
bind "POV_RIGHT" "slot2"
bind "POV_DOWN" "slot3"
bind "POV_LEFT" "slot4"

joystick 1
sk_autoaim_mode 2
hud_fastswitch 2
+jlook

player_limit_jump_speed 0
1 change: 1 addition & 0 deletions game/mod_hl2mp/cfg/settings.scr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION 1.0
131 changes: 131 additions & 0 deletions game/mod_hl2mp/cfg/settings_default.scr
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
// NOTE: THIS FILE IS AUTOMATICALLY REGENERATED,
//DO NOT EDIT THIS HEADER, YOUR COMMENTS WILL BE LOST IF YOU DO
// Multiplayer options script
//
// Format:
// Version [float]
// Options description followed by
// Options defaults
//
// Option description syntax:
//
// "cvar" { "Prompt" { type [ type info ] } { default } }
//
// type =
// BOOL (a yes/no toggle)
// STRING
// NUMBER
// LIST
//
// type info:
// BOOL no type info
// NUMBER min max range, use -1 -1 for no limits
// STRING no type info
// LIST delimited list of options value pairs
//
//
// default depends on type
// BOOL is "0" or "1"
// NUMBER is "value"
// STRING is "value"
// LIST is "index", where index "0" is the first element of the list


// Half-Life Server Configuration Layout Script (stores last settings chosen, too)
// File generated: Fri Apr 02 07:04:35 PM
//
//
// Cvar - Setting

VERSION 1.0

DESCRIPTION SERVER_OPTIONS
{
"hostname"
{
"#Valve_Hostname"
{ STRING }
{ "Half-Life 2 Sandbox" }
}

"gamemode"
{
"#Hl2sb_Gamemode"
{
LIST
"#Hl2sb_Sandbox" "sandbox"
"#Hl2sb_Campaign" "campaign"
"#Hl2sb_Deathmatch" "deathmatch"
}
{ "0" }
}

"sv_password"
{
"#Valve_Server_Password"
{ STRING }
{ "" }
}

"maxplayers"
{
"#Valve_Max_Players"
{ NUMBER 1 32 }
{ "32" }
}

"sv_password"
{
"#Valve_Server_Password"
{ STRING }
{ "" }
}

"mp_timelimit"
{
"#Valve_Time_Limit"
{ NUMBER 0.000000 -1.000000 }
{ "0.000000" }
}

"mp_fraglimit"
{
"#Valve_Frag_Limit"
{ NUMBER 0.000000 -1.000000 }
{ "0.000000" }
}

"mp_teamplay"
{
"#Valve_Teamplay"
{ BOOL }
{ "0" }
}

"mp_weaponstay"
{
"#Valve_Weapons_Stay"
{ BOOL }
{ "0" }
}

"mp_footsteps"
{
"#Valve_Footsteps"
{ BOOL }
{ "1" }
}

"mp_flashlight"
{
"#Valve_Flashlight"
{ BOOL }
{ "0" }
}
"mp_forcerespawn"
{
"#Valve_Force_Respawn"
{ BOOL }
{ "0" }
}
}
Loading