praydog / REFramework

Scripting platform, modding framework and VR support for all RE Engine games
https://cursey.github.io/reframework-book/
MIT License
2.82k stars 349 forks source link

Getting player data with api #970

Open alexsteve647 opened 9 months ago

alexsteve647 commented 9 months ago

I’m trying to get data about a player from Resident Evil 2 Remake, for example, health, position, moving distance, etc. And then send data to arduino through serial and print to lcd screen.

I tried with this code to get hp, but it returns zero everytime:

auto player_position = API::get()->tdb()->find_method("app.ropeway.PlayerManager", "get_CurrentHP");
auto ropeway_player_manager = API::get()->get_managed_singleton("app.ropeway.PlayerManager");
auto pp = player_position->call<float>(vm_context, ropeway_player_manager);

Would appreciate help. Sorry, English isn't my native language.