SimShaker-for-Aviators / SimShaker-for-Aviators-Releases

Public Repository for SimShaker for Aviators (SSA) Releases
24 stars 1 forks source link

Export.lua compatibility issue. #10

Open davidzill opened 1 year ago

davidzill commented 1 year ago

Describe the bug Just installed Buttkicker Gamer Pro with the latest release version Simshaker for Aviators and Sound Module. The Buttkicker initially was not working even though everything was up and running. Checked the export.lua and noticed the lines for simshaker was double spaced below the other 3 lines. My first line is for DCSBIOS, which most of my flightsim peripherals are operated from. When I copied and pasted the simshaker lines just under the DCSBIOS lines, simshaker and buttkicker worked well in DCS, but DCSBIOS would not start. There is some sort of conflict between the DCSBIOS and Simshakers lines in the export lua preventing them from being used simultaneously.

To Reproduce Steps to reproduce the behavior: Do as I described above.

System (please complete the following information):

Additional context Add any other context about the problem here. Export.zip

f4l0 commented 1 year ago

We are discussing this issues in the discord already... I hope to find a solution soon

emcek commented 1 year ago

I can easily reproduce issue so if you want test solution, let me know.

emcek commented 1 year ago

as workaround order matter:

pcall(function() local pw=require('lfs');dofile(pw.writedir()..[[Scripts\pw-dev_script\ExportInit.lua]]); end,nil);

dofile(lfs.writedir()..[[Scripts\SimShaker-export-core\ExportCore.lua]])
local SimShakerlfs=require('lfs'); dofile(SimShakerlfs.writedir()..'Scripts/SimShaker.lua')

dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOS.lua]])

local vaicomlfs = require('lfs'); dofile(vaicomlfs.writedir()..[[Scripts\VAICOMPRO\VAICOMPRO.export.lua]])

pcall(function() local dcsSr=require('lfs');dofile(dcsSr.writedir()..[[Mods\Services\DCS-SRS\scripts\DCS-SimpleRadioStandalone.lua]]); end,nil) 

local Tacviewlfs=require('lfs');dofile(Tacviewlfs.writedir()..'Scripts/TacviewGameExport.lua')

With this I got no issue using DCS-BIOS.

charliefoxtwo commented 1 year ago

This should be fixed in dcs-bios now. It seems simshaker was writing a table to a global variable msg. Bios was reading a global variable of the same name and attempting to serialize it as a string. This was a bug on in bios, though it's worth mentioning it may be worth converting that global variable to a local one in simshaker so this can't happen with other exports in the future (especially with a variable name as simple as "msg")

emcek commented 1 year ago

Yes I can confirm it:

dofile(lfs.writedir()..[[Scripts\SimShaker-export-core\ExportCore.lua]])
local SimShakerlfs=require('lfs'); dofile(SimShakerlfs.writedir()..'Scripts/SimShaker.lua')
dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOS.lua]])

and

dofile(lfs.writedir()..[[Scripts\DCS-BIOS\BIOS.lua]])
dofile(lfs.writedir()..[[Scripts\SimShaker-export-core\ExportCore.lua]])
local SimShakerlfs=require('lfs'); dofile(SimShakerlfs.writedir()..'Scripts/SimShaker.lua')

are working.