Завантаження...

Persistent Weapon Blood 1.1

3 137

Have you disappointed with weapons clearing their blood by just switching to another weapon? Or have you disappointed with the fact blood of weapons gets cleared when generated by popping from inventories of pedestreans?
This script/plugin keeps weapon blood and resolves those issues, just like in Left 4 Dead 2 and Dying Light. This mod also restores weapon blood state as is when the player collects some pickup thanks to EasyHook (if you want to know how to hook some of the game code or place detours into it with C# scripts/plugins, you should view the source code below!).
Available as a script for ScriptHookVDotNet and a plugin for RAGE Plugin Hook.

For your information, the weapon blood issues mentioned above are also present in RDR2. I think weapon blood feature deserved more attention by Rockstar Games, but they didn't add additional space for weapon blood states (so the game restore them when ped switch their weapons) to ped inventory item struct in CPedInventory in both GTA V and RDR2.

About
  • This script/plugin tracks blood states (strictly CamoDiffuseTexIdxs values) of weapons and restores when switched to them again.
    • Trackes for all pedestrians (peds), including the player ped of course.
    • When peds lose some weapons with variable blood states, this script/plugin drops the states.
    • Applies the blood states when peds drop their weapons with non-default blood states.
    • When the player collect weapon pickups with non-default blood states, the blood states will be restored when they switch to the weapons again. Supported for all peds just in case.
    • When you switched to another character and a new ped is created, this mod can't track blood states of the weapons they had before.
    • Makes the water cleans blood off all of the weapons the ped has (optional).
    • Supports (at least intended to support) all game versions, at least for ScriptHookVDotNet version (tested in b2845, b2699, and b372).
      • For RAGE Plugin Hook version, this plugin may not work in some older game versions.
      • No dedicated support for cracked/pirated game versions.




Installation
Install either version, but not both.

For ScriptHookVDotNet Version
  • Install Script Hook V
  • Install Script Hook V .NET (v3.6.0 or later required)
  • Create a "scripts" folder in your GTA V directory if it doesn't already exist.
  • Copy PersistentWeapoBlood.dll and EasyHook.dll to the "scripts" folder in your GTA V directory.
    • For EasyHook.dll, you can put it in the root directory. You must use 2.7.7097.0 (or later version, but probably no more updates expected) of EasyHook.dll.



For RAGE Plugin Hook Version
  • Install RAGEPluginHook:
    • You can download from the official Discord server of RAGE Plugin Hook, under the "necessities" channel.
    • Alternatively LSPDFR contains the latest RAGE Plugin Hook.

  • Install .NET Framework 4.8
  • Create a "Plugins" folder in your GTA V directory if it doesn't already exist.
  • Copy PersistentWeapoBlood.dll to the "Plugins" folder in your GTA V directory.
  • Copy EasyHook.dll to your root GTA V directory.
    • You can use 2.7.6578.0 or later version of EasyHook (this plugin intentionally specifies 2.7.6578.1 since LSPDFR uses 2.7.6578.0 version of EasyHook.dll).



This script/plugin itself is highly optimized for both runtimes, but if you don't mind using either version, I would recommend the ScriptHookVDotNet version. RPH does not seem to continuously improve performance of the runtime (if you doubt it, use a profiler like one of Visual Studio with the source code of this mod for CPU usage) like SHVDN has done. Even without NoScriptThread (this mod use this flag) and in v3.6.0, SHVDN still performs better than RPH.
However, you should note that ScriptHookVDotNet suffers the compatibility issue with any programs that throws C++ exceptions or SEH exceptions (including debuggers) and RAGE Plugin Hook until v3.6.0 (will be solved in v3.7.0). If you have SHVDN v3.6.0 or earlier installed and you use RPH at the same time, RPH may crash the entire game when one of the loaded RPH plugins crashes for a unhandled exception (intended behavior: only the crashed RPH plugin stops executing).

Configuration
  • You can change the configure of this script/plugin via PersistentWeapoBlood.ini.
    • If the ini file does not exist, this script/plugin just uses default values. If this script/plugin fails to parse some value, the default value will be used.
    • Always use a decimal point as a decimal separator regardless of your locale setting even for SHVDN version.
    • The confingable values are the following one (don't use double quotes for any keys or values):
      • [WaterCleaningForPedSubmersion]
        • Description: The feature where water will clean blood off all of the ped weapons for the peds submersion or swimming.
        • "TargetPeds"
          • Description: Determines the target peds whose weapons the water cleans.
          • Possible value: "AllPeds", "PlayerOnly", "None". Case-insensitive.
          • Default value: "AllPeds"

        • "SubmersionLevelThreshold"
          • Description: Determines the submersion level threshold.
          • Possible value: A floating point value in the range of 0 to 1 inclusive. 1 means weapon blood will clean if the ped is fully submerged (or swimming).
          • Default value: "0.875


      • [ClearWeaponBloodCommands]
        • "RegisterCheatCodes"
          • Description: Specifies whether the cheat codes for weapon cleaning can be used.
          • Available Cheats
            • CLEANALLPLAYERMELEEWEAPONS: Cleans all of melee weapons of the player.
            • CLEANCURRENTPLAYERMELEEWEAPON: Cleans the current melee weapon of the player. Do nothing if the current weapon can't have a non-default CamoDiffuseTexIdxs value.







Console Commands
  • This script/plugin provides 2 console commands for SHVDN/RPH consoles. The available commands are the following:
    • CleanAllPlayerMeleeWeapons
      • Cleans blood off all of the melee weapons of the player.

    • CleanCurrentPlayerMeleeWeapon:
      • Cleans blood off the current melee weapon of the player. Do nothing if the current weapon can't have a non-default CamoDiffuseTexIdxs value.

    • For SHVDN version, you will have to type like "PersistentWeaponBlood.Commands.CleanAllPlayerMeleeWeapons()" to call these commands since SHVDN does not provide dedicated custom console commands as of v3.6.0.



Future Features
- change blood states by performing stealth kill

Change Log
v1.1:
- Add options for water blood cleaning and cheat codes for blood cleaning for the player.
- Made the script/plugin add 2 console commands (although these commands are pseudo ones in SHVDN).

v1.0:
- First release

Note For CamoDiffuseTexIdxs
This field is a binary dictionary map data of CWeaponInfo (used in weapons.meta files), which enables to use up to 8 alternative camo diffuse textures. Texture names for this feature must be named as "w_camo_%d" ("%d" will be filled in a number between 1 and 8 inclusive, but the field of weapons.meta takes a number between 0 and 7). Probably materials must also be set up for weapon models.

Source Code
Can be found on GitHub. Licensed under the MIT License.
Show Full Description

Перше завантаження: 30 Квітня 2023
Останнє оновлення 03 Травня 2023
Last Downloaded: 1 hour ago

All Versions

 1.1 (current)

1 971 завантажень , 81,0 кБ
03 Травня 2023

 1.0

1 166 завантажень , 75,0 кБ
30 Квітня 2023

13 коментаря