Skip to content

Commit

Permalink
Improve readme (gta-reversed#572)
Browse files Browse the repository at this point in the history
* Add all asi's as a zip file, and a script to install all the stuff
Updated some of the readme

* Fix up the script

* Fix up the readme

* Remove unnecessary whitespace

---------

Co-authored-by: yukani <yukani@zohomail.eu>
  • Loading branch information
Pirulax and yukani authored Jul 29, 2023
1 parent aa0f370 commit d5d5dcf
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 18 deletions.
40 changes: 24 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,19 @@ Building this project will result in a DLL file that can be injected into GTA:SA

### Progress
The progress of reversed classes can be tracked [here](docs/ReversedClasses.MD). (needs to be updated)
We currently estimate that about 50-60% of the code is done.
Since this project is done as a hobby, and worked on at irregular intervals, there's no real time estimate.

### Coding Guidelines
Before you start writing code, please make sure to read the [coding guidelines](docs/CodingGuidelines.MD) for this project.

### Requirements

* [Visual Studio 2022](https://visualstudio.microsoft.com/en/downloads/) (Community Edition is enough)
* [CMake](https://cmake.org) (for those who want to use CMake instead of premake5)

#### Game

* GTA SA **Compact** exe
* [ASI Loader](https://gtaforums.com/topic/523982-relopensrc-silents-asi-loader/)
* [III.VC.SA.WindowedMode.asi](https://github.com/ThirteenAG/III.VC.SA.WindowedMode)
* [Improved Fast Loader](https://www.gtagarage.com/mods/show.php?id=25665) (Optional)
* Mouse Fix (**dinput8.dll**)

You can download them in a single [archive](https://github.com/codenulls/gta-reversed/files/6949371/gta_sa.zip).
Using other plugins is strongly discouraged as the compact version doesn't like them.

### Build Instructions

You can either build with **Premake5** or **CMake**; that's up to you, but a C++20 capable compiler with <ranges> support is required.
You can either build with **Premake5** or **CMake**; that's up to you, but a C++20 capable compiler [with `<ranges>`, `<format>` support] is required.

First clone the project, including the submodules:
```shell
Expand All @@ -39,10 +29,11 @@ git clone --recurse-submodules https://github.com/gta-reversed/gta-reversed-mode
<details>
<summary>Premake5</summary>

1) Execute `premake5.bat` for 2022, or `premake5.bat vs20xx` for other VS versions. (Note: Premake works fine with vs2019, CMake requires vs2022) (e.g: `premake5.bat vs2019`)
1) Execute `premake5.bat`

2) You'll find gta_reversed.sln shortcut in the same folder as premake5.

3) Open it, and once the project has loaded, just hit `CTRL + SHIFT + B`
</details>

<details>
Expand Down Expand Up @@ -80,13 +71,30 @@ git clone --recurse-submodules https://github.com/gta-reversed/gta-reversed-mode

</details>

### Game
To install all the necessary files, run `install.py` with **__administrator privileges__** [Necessary to create symlinks on Windows] in the root directory.
Alternatively, you can install them by yourself:

* GTA SA **Compact** exe
* [ASI Loader](https://gtaforums.com/topic/523982-relopensrc-silents-asi-loader/)
* [III.VC.SA.WindowedMode.asi](https://github.com/ThirteenAG/III.VC.SA.WindowedMode)
* Mouse Fix (**dinput8.dll**) [Can be found in the zip in `./contrib`]

You can download them in a single [archive](https://github.com/gta-reversed/gta-reversed-modern/blob/master/contrib/plugins.zip).
Using other plugins is strongly discouraged and we provide __**no support**__.

### Preparing Environment (Optional)
[If you have ran `install.py` in the previous step then this step is already done]

You can create symbolic links for artifacts to not copy them every time you compiled the project.
<details>
<summary>Instructions</summary>

You can create symbolic links [symlinks] for artifacts [the `.asi`] to need not copy them every time you compile the project.

Open a console with administrator privileges in the git repo's directory and run `contrib\link_asi.bat` or right click `link_asi.bat` file and click `Run as administrator`, then
Open a console with **__administrator privileges__** in the git repo's directory and run `contrib\link_asi.bat` or right click `link_asi.bat` file and click `Run as administrator`, then
follow instructions at the command window.

</details>

### What to work on?
Check [this](https://github.com/gta-reversed/gta-reversed-modern/discussions/402) out for some inspiration ;)
Expand Down
36 changes: 36 additions & 0 deletions contrib/install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import tkinter as tk
import os
import subprocess
from tkinter import filedialog as tkFileDialog
from pathlib import Path
import zipfile

def main():
git_repo_root = Path.cwd()

gta_root_dir = Path(tkFileDialog.askdirectory(
title='Select GTA:SA install directory'
))
gta_scripts_dir = gta_root_dir / 'scripts'

# Unpack zip into gta dir
print("Unpacking `plugins.zip` into GTA:SA root directory...")
with zipfile.ZipFile(git_repo_root / 'contrib' / 'plugins.zip') as plugins_zip:
plugins_zip.extractall(gta_root_dir)

# Create symlinks
config_name = input("Choose configuration to link (debug/release, default: debug): ") or 'debug'
print(f"Creating the symlinks for `{config_name}` configuration...")
config_bin_dir = git_repo_root / 'bin' / Path(config_name)
print(f'{config_bin_dir=}')
for filename in ('gta_reversed.pdb', 'gta_reversed.asi',):
dst = gta_scripts_dir / filename
dst.unlink(missing_ok=True) # Delete symlink if it already exists
# This fails [WinError 1314] if the script isn't run with admin rights [softlinks require it]
# To run as admin just open an admin cmd, and type `python ./install.py` in the repo root dir
os.symlink(config_bin_dir / filename, dst)

print('Done!')

if __name__ == "__main__":
main()
Binary file added contrib/plugins.zip
Binary file not shown.
1 change: 0 additions & 1 deletion source/game_sa/Entity/Vehicle/Automobile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5111,7 +5111,6 @@ CObject* CAutomobile::SpawnFlyingComponent(eCarNodes nodeIndex, uint32 collision
*RwFrameGetMatrix(flyingObjFrame) = *frameLTM; // Set this frame's matrix to be the same as the component's - TODO: This most likely isn't the correct way to do this..
CVisibilityPlugins::SetAtomicRenderCallback(clonedFlyingObjAtomic, nullptr);
obj->AttachToRwObject((RwObject*)clonedFlyingObjAtomic, true);

obj->m_bDontStream = true;
obj->m_fMass = 10.f;
obj->m_fTurnMass = 25.f;
Expand Down
1 change: 0 additions & 1 deletion source/game_sa/Models/ClumpModelInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ RwFrame* CClumpModelInfo::FindFrameFromNameWithoutIdCB(RwFrame* frame, void* sea
searchInfo->m_pFrame = frame;
return nullptr;
}

RwFrameForAllChildren(frame, FindFrameFromNameWithoutIdCB, searchData);
if (searchInfo->m_pFrame)
return nullptr;
Expand Down

0 comments on commit d5d5dcf

Please sign in to comment.