AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   [TF2] Need assistance finding Game Data Offsets (https://forums.alliedmods.net/showthread.php?t=336675)

Proctato 03-07-2022 10:09

[TF2] Need assistance finding Game Data Offsets
 
Trying to update offsets for a freak fortress subplugin and I can't seem to find out how to get the latest values for these off sets:

"CBaseCombatWeapon::GetSlot"
{
"linux" "333"
"windows" "326"
}
"CTFPlayer::Weapon_Switch"
{
"linux" "268"
"windows" "267"
}
"CBasePlayer::EquipWearable"
{
"linux" "434"
"windows" "435"
}


Would someone be able to help me pull the latest values or send a tutorial on how to?

Psyk0tik 03-07-2022 10:32

Re: [TF2] Need assistance finding Game Data Offsets
 
Quote:

Originally Posted by Proctato (Post 2773346)
Trying to update offsets for a freak fortress subplugin and I can't seem to find out how to get the latest values for these off sets:

"CBaseCombatWeapon::GetSlot"
{
"linux" "333"
"windows" "326"
}
"CTFPlayer::Weapon_Switch"
{
"linux" "268"
"windows" "267"
}
"CBasePlayer::EquipWearable"
{
"linux" "434"
"windows" "435"
}


Would someone be able to help me pull the latest values or send a tutorial on how to?

I recommend using this site to get the VTable offsets of functions: https://asherkin.github.io/vtable/
Keep in mind that the site isn't always 100% accurate, but for the most part, the offsets are almost always correct.
PHP Code:

"CBaseCombatWeapon::GetSlot"
{
    
"linux"        "336"
    "windows"    "330"
}
"CTFPlayer::Weapon_Switch"
{
    
"linux"        "272"
    "windows"    "271"
}
"CBasePlayer::EquipWearable"
{
    
"linux"        "435"
    "windows"    "434"



asherkin 03-07-2022 12:16

Re: [TF2] Need assistance finding Game Data Offsets
 
Quote:

Originally Posted by Psyk0tik (Post 2773349)
I recommend using this site to get the VTable offsets of functions: https://asherkin.github.io/vtable/
Keep in mind that the site isn't always 100% accurate, but for the most part, the offsets are almost always correct.

As long as you upload your own binaries it is generally fine - unfortunately the AM service the buttons pull from stopped updating.

Proctato 03-07-2022 13:14

Re: [TF2] Need assistance finding Game Data Offsets
 
Quote:

Originally Posted by asherkin (Post 2773364)
As long as you upload your own binaries it is generally fine - unfortunately the AM service the buttons pull from stopped updating.

What the path to my own binaries, apologies for the silly question.

PC Gamer 03-07-2022 15:41

Re: [TF2] Need assistance finding Game Data Offsets
 
Quote:

Originally Posted by asherkin (Post 2773364)
As long as you upload your own binaries it is generally fine.

Where would a Windows user find the linux file to upload?

nosoop 03-07-2022 16:13

Re: [TF2] Need assistance finding Game Data Offsets
 
Quote:

Originally Posted by Proctato (Post 2773377)
What the path to my own binaries, apologies for the silly question.

Assuming you have a Linux copy of the game client or server, the server and engine binaries will be at tf/bin/server_srv.so and bin/engine_srv.so respectively, relative to the game's install directory. If not, see below.

Quote:

Originally Posted by PC Gamer (Post 2773387)
Where would a Windows user find the linux file to upload?

Windows users can use something like DepotDownloader or something written on top of a library like ValvePython/steam to retrieve just the engine.so and server{,_srv}.so Linux binaries.

Bacardi 03-07-2022 18:07

Re: [TF2] Need assistance finding Game Data Offsets
 
Quote:

Originally Posted by PC Gamer (Post 2773387)
Where would a Windows user find the linux file to upload?

One way is download SRCDS Linux (or Windows) version from SteamCMD.
PHP Code:

@sSteamCmdForcePlatformType Linux 

example
PHP Code:

//update.txt


logout

@sSteamCmdForcePlatformType windows


//force_install_dir "../Counter-Strike Source"
//app_update 232330 validate
//logout

force_install_dir "../Team Fortress 2"
login anonymous
app_update 232250 validate
logout

//force_install_dir "../Half-Life 2 Deathmatch"
//login anonymous
//app_update 232370 validate
//logout

@sSteamCmdForcePlatformType Linux


//force_install_dir "../Counter-Strike Source Linux"
//app_update 232330 validate
//logout

force_install_dir "../Team Fortress 2 Linux"
login anonymous
app_update 232250 validate
logout

//force_install_dir "../Half-Life 2 Deathmatch Linux"
//login anonymous
//app_update 232370 validate
//logout


exit 


PC Gamer 03-07-2022 18:42

Re: [TF2] Need assistance finding Game Data Offsets
 
Quote:

Originally Posted by nosoop (Post 2773390)
Windows users can use something like DepotDownloader or something written on top of a library like ValvePython/steam to retrieve just the engine.so and server{,_srv}.so Linux binaries.

I want to make sure I understand. In order to learn an offset for Windows I must do the following:
1. Install and enable Microsoft .NET framework on a computer running Windows.
2. Obtain and install the Microsoft Visual Studio.
3. Determine which programming language I'd like to learn that operates with Visual Studio.
4. Learn the programming language.
5. Determine the depot, manifest, ugc, pubfile of the files you want (where do you find these?).
6. Write code that connects to the Steam DepotDownloader.
7. Execute code to download your two files.
Did I capture that process correctly?

Edit: Just read Bacardi's post. Thanks Bacardi! That seems way easier.

Psyk0tik 03-07-2022 19:37

Re: [TF2] Need assistance finding Game Data Offsets
 
Quote:

Originally Posted by PC Gamer (Post 2773411)
I want to make sure I understand. In order to learn an offset for Windows I must do the following:
1. Install and enable Microsoft .NET framework on a computer running Windows.
2. Obtain and install the Microsoft Visual Studio.
3. Determine which programming language I'd like to learn that operates with Visual Studio.
4. Learn the programming language.
5. Determine the depot, manifest, ugc, pubfile of the files you want (where do you find these?).
6. Write code that connects to the Steam DepotDownloader.
7. Execute code to download your two files.
Did I capture that process correctly?

I just use the "Depot Downloader" that nosoop linked, since it's fairly easy to setup. Then I use this site to fetch the app ID, depot ID, and manifest ID.

Example: TF2 Binaries
- App ID: 232250
- Depot ID: 232256 (Linux)
- Manifest ID: 2312266632028026945 (Latest)

Once you have all that information, you go to the folder where "DepotDownloader.exe" is located, and just type "cmd" in the folder path to automatically run "cmd.exe" with your DD folder as the selected directory. This is the directory path I use: C:\Users\X\Desktop\depot downloader

Finally, you have to use this syntax: dotnet DepotDownloader.dll -app <ID> -depot <ID> -manifest <ID>

For the example I provided, this is what you would use: dotnet DepotDownloader.dll -app 232250 -depot 232256 -manifest 2312266632028026945

Once you've done all that, a "depots" folder should be created inside your DD directory. Each depot will have its own designated folder. My TF2 Linux binaries would be located inside: C:\Users\X\Desktop\depot downloader\depots\232256

Note: Syntax can vary depending on which app's depot you want to download.

Example: L4D2 Mac Binaries
- Syntax: dotnet DepotDownloader.dll -app <ID> -depot <ID> -manifest <ID> -username <username> -password <password>
- Example: dotnet DepotDownloader.dll -app 550 -depot 553 -manifest 4080991265902159838 -username XXXXXXXX -password XXXXXXXX

nosoop 03-07-2022 22:21

Re: [TF2] Need assistance finding Game Data Offsets
 
Quote:

Originally Posted by PC Gamer (Post 2773411)
I want to make sure I understand. In order to learn an offset for Windows I must do the following:

[...]

Did I capture that process correctly?

Apologies for the confusion.

The README linked in the first project shows the usage for DepotDownloader, which is a standalone tool. To get the latest version of the server, you actually don't need anything beyond the server appid (and whatever version of .NET the program itself requires); here's an example command-line invocation:

Code:

DepotDownloader -app 232250 -all-platforms -filelist filelist_tf2_server.txt -dir tf2_binaries
Where filelist_tf2_server.txt contains the list of files to download:

Code:

tf/bin/server_srv.so
bin/engine_srv.so
tf/bin/server.dll
tf/bin/engine.dll

This will allow you to retrieve just those files and nothing else.

(ValvePython/steam was added in as an aside in case you wanted to implement your own tooling for some reason; I don't have any affiliation with either project beyond being a user.)


All times are GMT -4. The time now is 10:17.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.