Jump to content

[LE] SKSE & ScriptDragon, Modders, help, pls!


GKennedyN1

Recommended Posts

Hello,

I know that SKSE is script extender and allows to register new funcs in Papyrus. And I know, that ScriptDragon calls most of standard Papyrus functions, as I know by calling NativeInvoke::Invoke/<Type/>(...)...

And I have some questions.
I'm making some mods using ScriptDragon(it's comfortable for me), but it has not enough functions, e.g. ScanCellObjects[] like in PapyrusUtil SKSE plugin...

So, can I detect, whether SKSE is installed and then, if it's true, invoke it like standard papyrus function in ScriptDragon plugin?

I hope to get smth like this:
NativeInvoke::Invoke/<TESObjREFR*/>;("NameSpace or Maybe class?", "ScanCellObjects", retvalue(?));

(Slashes keeps quotes alive)

 

Thanks very much,
GKennedyN1

Edited by GKennedyN1
Link to comment
Share on other sites

Hey, look here, I`ve found the SKSE plugin example function registration one of ScriptDragon functions invoke:

 

SKSE e.g.:

 bool RegisterFuncs(VMClassRegistry* registry) {
        registry->RegisterFunction(
            new NativeFunction0 <StaticFunctionTag, float>("MyTest", "MyPluginScript", MyPluginNamespace::MyTest, registry));

ScriptDragon e.g.:

namespace Game
{
    static void AddAchievement(int aiAchievementID) {
        NativeInvoke::Invoke<ScriptNone>("Game", "AddAchievement", BSScript_StaticFunctionTag, aiAchievementID);
    }
//...
}

So, is it possible to write it down like smth like this in ScriptDragon plugin?:

static float MyTest(/*Unknown type? Or maybe ScriptNone?*/)
{
     NativeInvoke::Invoke<ScriptNone>("MyTest", "MyPluginScript", BSScript_StaticFunctionTag, /*Parameter unknown type?*/);
}

Advance thanks,

GKennedyN1

Edited by GKennedyN1
Link to comment
Share on other sites

Yea, I got it. You can call SKSE functions from SD, just with next types: int, float, double, bool.

I don`t know how I can get String result or any other type.

 

Here`s working code of invoking "GetModCount" function in ScriptDragon from SKSE:

static int GetModCount()
		{
			int result = NativeInvoke::Invoke<int>("Game", "GetModCount", BSScript_StaticFunctionTag);
			return result;
		}

And some screenshots:

http://exqdev.epizy.com/download/.hidden/Images/2016-12-08_164309.pnghttp://exqdev.epizy.com/download/.hidden/Images/2016-12-08_1625121.png

And the last: try to invoke without SKSE:

http://exqdev.epizy.com/download/.hidden/Images/2016-12-08_163126.png

 

But does anyone know how to invoke functions of gametypes and String type?

Edited by GKennedyN1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...