NativeInvoker 1.0.0.1
452
17
452
17
Ever felt depressed by the unintuitive syntax when trying to call a native function in SHVDN?
This library allows you to call native function via strong-typed static methods. Comment is included as well, so you no longer need to tediously search nativedb for the native information while writing code.
To use this, either download and reference the dll directly or install it via nuget package manager.
Then add this line to the using section in your code:
using static GTA.Native.NativeInvoker;
Now you're good to go. Call any native without worrying about wrong parameter or return type!
Entity killer = GET_PED_SOURCE_OF_DEATH(Game.Player.Character);
Source code
Dependencies:
ScriptHookVDotNet
This library allows you to call native function via strong-typed static methods. Comment is included as well, so you no longer need to tediously search nativedb for the native information while writing code.
To use this, either download and reference the dll directly or install it via nuget package manager.
Then add this line to the using section in your code:
using static GTA.Native.NativeInvoker;
Now you're good to go. Call any native without worrying about wrong parameter or return type!
Entity killer = GET_PED_SOURCE_OF_DEATH(Game.Player.Character);
Source code
Dependencies:
ScriptHookVDotNet
Първо качено на: 16 ноември 2022
Последно обновено на: 16 ноември 2022
Последно изтеглено: Преди 1 ден
7 Коментари
More mods by Sardelka:
Ever felt depressed by the unintuitive syntax when trying to call a native function in SHVDN?
This library allows you to call native function via strong-typed static methods. Comment is included as well, so you no longer need to tediously search nativedb for the native information while writing code.
To use this, either download and reference the dll directly or install it via nuget package manager.
Then add this line to the using section in your code:
using static GTA.Native.NativeInvoker;
Now you're good to go. Call any native without worrying about wrong parameter or return type!
Entity killer = GET_PED_SOURCE_OF_DEATH(Game.Player.Character);
Source code
Dependencies:
ScriptHookVDotNet
This library allows you to call native function via strong-typed static methods. Comment is included as well, so you no longer need to tediously search nativedb for the native information while writing code.
To use this, either download and reference the dll directly or install it via nuget package manager.
Then add this line to the using section in your code:
using static GTA.Native.NativeInvoker;
Now you're good to go. Call any native without worrying about wrong parameter or return type!
Entity killer = GET_PED_SOURCE_OF_DEATH(Game.Player.Character);
Source code
Dependencies:
ScriptHookVDotNet
Първо качено на: 16 ноември 2022
Последно обновено на: 16 ноември 2022
Последно изтеглено: Преди 1 ден
If you're using Visual Studio as your IDE with IntelliSense you can see both the references and the metadata. How is this different other than adding another layer. My issues with the NativeDB is that it isn't always up to date and the comments are generally useless. Many of the links have rotted away too.
I think you misread the description, this library is a wrapper for calling arbitrary native function (Function.Call) more conveniently. None of them are documented in SHVDN, so I wonder where you're intellisense suggestions come from?
@Sardelka The IntelliSense displays all functions and provides the correct syntax and ensures it the function is also current, more current than the Native DB. From there you can just hover over with your mouse and you will see the arguments for that particular function, just as you would hitting F12 or ctrl alt j for SHVDN. I understand your dll is a wrapper but isn't that what SHVDN is? Why add another wrapper. Just curious.
@Sardelka Maybe you could provide a more complex example? I mean
Function.Call(Hash.GET_PED_SOURCE_OF_DEATH,Game.Player.Character)
vs
GET_PED_SOURCE_OF_DEATH(Game.Player.Character);
Doesn't seem to be a huge advantage, especially after you've written Function.Call 1000+ times
@JohnFromGWN I still don't get you. What do you mean "provides the correct syntax and ensures it the function is also current, more current than the Native DB" ?
If you're referring to scripting API, then yes it's mostly documented and doesn't need to specify argument and return type manually. But what I'm discussing here is calling native directly, not the API someone already made for you.
Function.Call requires you to specify return type via a generic parameter and all argument types, which can go wrong sometimes.
@JohnFromGWN if you don't like this library, just don't use it. I made this because I'm tired of explicitly specifying the argument and return type everytime I need to call a native, it was intended for use in my other bigger projects, just sharing it here in the hope to somehow benefit the community
If you need to write Function.Call 1000+ time then this will definitely make a difference, saving much time to type Function.Call<T> yourself