Coder Social home page Coder Social logo

wopss / red4ext.sdk Goto Github PK

View Code? Open in Web Editor NEW
98.0 20.0 31.0 9.38 MB

A library to create mods for REDengine 4 (Cyberpunk 2077), independently of RED4ext.

License: MIT License

C++ 99.67% Python 0.25% CMake 0.08%
redengine redengine4 cyberpunk2077 cpp20

red4ext.sdk's People

Contributors

0xsombra avatar expired6978 avatar flibdev avatar jac3km4 avatar jackhumbert avatar lukas0610 avatar maximegmd avatar mozz3d avatar nicodblc avatar pixelrick avatar poirierlouis avatar psiberx avatar wopss avatar wssdude avatar yamashi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

red4ext.sdk's Issues

Improve pattern finding

Is your feature request related to a problem? Please describe.
The current pattern finding script only support patterns for function prologues or pointers.

Describe the solution you'd like
An improved version of the pattern finding should support the following additional features:

  • Get the function address from a call instruction
  • Finding virtual function table and getting addresses from it

Generate methods for script classes

Is your feature request related to a problem? Please describe.
Currently the methods are missing from the auto generated classes. The only way to call those methods currently are using ExecuteFunction.

Describe the solution you'd like
See https://gist.github.com/martonp96/bf93a51d07da27caf065cc5ea2e1a853 or the discussion on discord https://discord.com/channels/717692382849663036/839400251680227339/1033367170979217438

Describe alternatives you've considered
I'm using manually created wrapper classes.

Implement `operator<` for EntityId to be used as hashmap keys

Description
entEntityID.hpp doesn't implement the order operator and as such it can't be used as a key in (hash) maps.
Since the intention is clear in every other overload that just delegates to this.hash, this should probably be reflected in this operator, too.

Steps to reproduce
if (entityId1 < entityId2) {}

Expected behavior
Delegating to the contained hash

Examples

diff --git a/include/RED4ext/Scripting/Natives/entEntityID.hpp b/include/RED4ext/Scripting/Natives/entEntityID.hpp
index ff9f0728..63a11b37 100644
--- a/include/RED4ext/Scripting/Natives/entEntityID.hpp
+++ b/include/RED4ext/Scripting/Natives/entEntityID.hpp
@@ -38,6 +38,11 @@ struct EntityID
         return hash == aRhs.hash;
     }

+    constexpr bool operator<(const EntityID& rhs) const noexcept
+    {
+        return hash < rhs.hash;
+    }
+
     [[nodiscard]] constexpr bool IsDefined() const noexcept
     {
         return hash;

Building with latest sdk causes runtime error

Description

I build my mod with the latest sdk, but at runtime I get an error.

[2023-07-02 19:04:33.824] [RED4ext] [warning] Cyberpunk 2077 Furigana (version: 1.2.6) is incompatible with the current patch (1.63 Hotfix 1). This version of the plugin was compiled for patch 1.63

Steps to reproduce

Build your mod for the latest SDK:

RED4EXT_C_EXPORT void RED4EXT_CALL Query(RED4ext::PluginInfo* aInfo)
{
    aInfo->name = L"Cyberpunk 2077 Furigana";
    aInfo->author = L"Daniel Kollmann";
    aInfo->version = RED4EXT_SEMVER(1, 2, 6);
    aInfo->runtime = RED4EXT_RUNTIME_LATEST;
    aInfo->sdk = RED4EXT_SDK_LATEST;
}

RED4EXT_C_EXPORT uint32_t RED4EXT_CALL Supports()
{
    return RED4EXT_API_VERSION_LATEST;
}

Expected behavior

Building with the latest version tags should create a compatible plugin file.

Examples

Game details (please complete the following information):
GOG v1.63 hotfix 1

Additional context

Reverse engineering the scripting events

Is your feature request related to a problem? Please describe.
Currently there is no method to hook game event's gamePuppet::OnDamageReceived, gamePuppet::OnHit, etc..

Describe the solution you'd like
The best solution would be to reverse and hook into events natively, without additional dependencies, allowing modders to hook these function from C++.

Describe alternatives you've considered
An alternative to this would be to do like yamashi did it for Cyber Engine Tweaks, but that would require to have additional libraries added as dependencies for the SDK which I would not like to. If there is no other solution than this, a plugin API can be added so that the main loader can take care of hooking.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.