Jump to content
airfighter

librain plugin and Gizmo

Recommended Posts

Trying to use librain plugin by @skiselkov with Gizmo, but I'm having some difficulties.

First of all, the librain seems to load after Gizmo, and my script cannot find librain's datarefs. By rebooting Gizmo the problem seems to go away. So, I need a way to "delay" the lookup for the datarefs, until the librain is loaded.

Second, after rebooting Gizmo, I get this error:

G64: 404.654: Boot Count: 9
G64: 409.308: C-Core Error: XDataref.setByteV ran for non-custom dataref.
G64: 409.308: C-Core Error: XDataref.setByteV ran for non-custom dataref.
2019-02-14 11:33:03 librain[plugin.c:194]: librain init error: you have set librain/num_glass_use = 1, but librain/glass_0/obj is not loaded.

Any thoughts...anyone?

Here is my script.

librain.lua

Share this post


Link to post
Share on other sites

The issue is that when librain is a plugin, X-Plane can load it after your custom aircraft systems plugin. So you need to make sure you delay librain init until the first flight loop run. Don't do it from XPluginStart or XPluginEnable, as it librain might still not be loaded by that point.

Share this post


Link to post
Share on other sites

Using @Tonka's example (http://forums.x-pilot.com/forums/topic/14692-gizmo-pluginsfindplugin-function/) , I'm checking for the librain is loaded, and I get this: 

G64: 219.512: Looking for a plugin by sig..
G64: 219.512: Looking for a plugin by sig: FOUND
G64: 219.512: C-Core Error: XDataref.setByteV ran for non-custom dataref.
G64: 219.512: C-Core Error: XDataref.setByteV ran for non-custom dataref.

So, the plugin is found, librain datarefs take my values, but the object is not loaded, nor the librain initialized. 

The Gizmo error about XDataref.setByteV (byte array dataref?) is something that I don't get it, since I'm not trying to set any Byte type dataref. Close "enough" might be (or irrelevant), setting the dataref

librain/glass_0/obj/filename

as a string:

dref.setString(windshield.obj, avanti_folder .. "objects/librain/windshield.obj")

I might try this... 

dref.setBytes( dataref_id, start_at, byte_string_var )

EDIT: Nope...looks something in the core of Gizmo. Or must take another path...

Edited by airfighter

Share this post


Link to post
Share on other sites

Just had a quick look, and the librain plugin i downloaded from https://github.com/skiselkov/librain/releases has the following in my log.txt:

2019-03-27 20:50:22 librain[plugin.c:590]: This is librain (v0.10) libacfutils-3babedf
Loaded: X:\X-Plane 11 Beta/Resources/plugins/librain.plugin/win_x64/librain.plugin.xpl (skiselkov.librain)

Therefore, the plugin sig to use with plugins.findPlugin is "skiselkov.librain"

you could try changing the line:

if plugins.findPlugin("librain.plugin.xpl") then

to 

if plugins.findPlugin("skiselkov.librain") then

And it might be worth implementing a 2 second timer in an OnFirstFrame() function, to delay the initialising of your link to librain. 

 

Hope you get it working, you can help me implement here then! :-D

Edited by Tonka

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×