ras78
-
Posts
11 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Gallery
Downloads
Posts posted by ras78
-
-
I had a quick look at LUA, seems so simple...to simple :)
I tryied to port my C code into LUA module. Since I've just to read an offset, have a check and write another offset, the code should be this:
visibility = ipc.readSW(0x0E8A) if visibility<=300 then ipc.writeSW(0x0DDE, 999) end
Is it so simple or I miss something? the LUAC compiler create succesfully my out file, I placed it into /modules folder of FS9 and updated the FSUIPC version.
This should be enough?
-
I was not aware about Lua, I'll take a look ant thanks for the tips of code!
-
Hello, I'm trying to code a dll in order to read the visibility and fill a USRVR5 variabile, thus I'll be able to condition an object in my scenery. Here's the code:
#include "fsmodule.h" #include #include "FSUIPC_User.h" LINKAGE Linkage = { //0x000002d9, 0x00000000, module_init, module_deinit, 0, 0, 0x900, NULL }; IMPORTTABLE ImportTable = { { 0x00000000, NULL } }; WORD LowVis=1; UINT_PTR TimerFSUIPC, VisibilityTimer; BYTE FSUIPCMemory[500]; VOID CALLBACK Visibility(HWND hwnd, UINT uMsg,UINT_PTR idEvent, DWORD dwTime) { DWORD dwResult; DWORD IsLowVisibility; FSUIPC_Read(0x0E8A, 2, (DWORD*)&IsLowVisibility, &dwResult); FSUIPC_Process(&dwResult); //visibility is lower than 3 miles if (IsLowVisibility<=300) { FSUIPC_Write(0x0DDE, 2, &LowVis, &dwResult); FSUIPC_Process(&dwResult); } } VOID CALLBACK InitFSUIPC(HWND hwnd, UINT uMsg,UINT_PTR idEvent, DWORD dwTime) { DWORD dwResult; if (FSUIPC_Open2(SIM_ANY, &dwResult, (BYTE*)FSUIPCMemory, 500)) { KillTimer(NULL,TimerFSUIPC); VisibilityTimer=SetTimer(NULL,1,2000,Visibility); } } void FSAPI module_init () { TimerFSUIPC=SetTimer (NULL,0,2000,InitFSUIPC); } void FSAPI module_deinit () { KillTimer (NULL,VisibilityTimer); FSUIPC_Close (); }
Basically I would fill that variabiles when the visibility is lower/equal than 3 miles. The compiler create succeasfullt my DLL but nothing runs as expected. Is this code correct?
thanks!
alberto
-
Hi guys,
I'm writing a simply DLL in order to detect visibility distance and condition an object in my scenery. Here's the code:
#include "fsmodule.h" #include #include "FSUIPC_User.h" LINKAGE Linkage = { //0x000002d9, 0x00000000, module_init, module_deinit, 0, 0, 0x900, NULL }; IMPORTTABLE ImportTable = { { 0x00000000, NULL } }; WORD LowVis=1; UINT_PTR TimerFSUIPC, VisibilityTimer; BYTE FSUIPCMemory[500]; VOID CALLBACK Visibility(HWND hwnd, UINT uMsg,UINT_PTR idEvent, DWORD dwTime) { DWORD dwResult; BYTE IsLowVisibility; FSUIPC_Write(0x8001, 12, "IKB3BI67TCHEtest.dll", &dwResult); FSUIPC_Process(&dwResult); FSUIPC_Read(0x0E8A, 2, (BYTE*)&IsLowVisibility, &dwResult); FSUIPC_Process(&dwResult); //visibility is lower than 3 miles if (IsLowVisibility<=3.0) { FSUIPC_Write(0x0DDE, 2, &LowVis, &dwResult); FSUIPC_Process(&dwResult); } } VOID CALLBACK InitFSUIPC(HWND hwnd, UINT uMsg,UINT_PTR idEvent, DWORD dwTime) { DWORD dwResult; if (FSUIPC_Open2(SIM_ANY, &dwResult, (BYTE*)FSUIPCMemory, 500)) { KillTimer(NULL,TimerFSUIPC); VisibilityTimer=SetTimer(NULL,1,2000,Visibility); } } void FSAPI module_init () { TimerFSUIPC=SetTimer (NULL,0,2000,InitFSUIPC); } void FSAPI module_deinit () { KillTimer (NULL,VisibilityTimer); FSUIPC_Close (); }
Basically nothing happens, the DLL should be ok, what's wrong?
tx!
-
SOLVED!
A little change applyed:
LINKAGE Linkage = { //0x000002d9, 0x00000000, module_init, module_deinit, 0, 0, 0x900, NULL };
Since 0x900 is for fs2004 which I use :D
-
hello guys,
I'm trying to create a simple module (DLL) for FS which use Fsuipc for read a couple of offset. Basically I read an offset, get it's value and set another offset. Here's the code:
#include "fsmodule.h" #include #include "FSUIPC_User.h" LINKAGE Linkage = { 0x000002d9, module_init, module_deinit, 0, 0, 0x800, { 0 } }; IMPORTTABLE ImportTable = { { 0x00000000, NULL } }; WORD LowVis=0; UINT_PTR FSUIPCTimer, VisibilityTimer; BYTE FSUIPCMemory[400]; VOID CALLBACK Visibility(HWND hwnd, UINT uMsg,UINT_PTR idEvent, DWORD dwTime) { DWORD dwResult; BYTE IsLowVisibility; FSUIPC_Write(0x8001, 12, "IKB3BI67TCHEtest.dll", &dwResult); FSUIPC_Process(&dwResult); FSUIPC_Read(0x238, 3, (BYTE*)&IsLowVisibility, &dwResult); FSUIPC_Process(&dwResult); //visibility is lower than 2 miles //if (IsLowVisibility<=0.02) { FSUIPC_Write(0x0DDE, 1, &LowVis, &dwResult); // FSUIPC_Process(&dwResult); //} } VOID CALLBACK InitFSUIPC(HWND hwnd, UINT uMsg,UINT_PTR idEvent, DWORD dwTime) { DWORD dwResult; if (FSUIPC_Open2(SIM_ANY, &dwResult, (BYTE*)FSUIPCMemory, 500)) { KillTimer(NULL,FSUIPCTimer); VisibilityTimer=SetTimer(NULL,1,2000,Visibility); } } void FSAPI module_deinit () { KillTimer (NULL,VisibilityTimer); FSUIPC_Close (); } void FSAPI module_init () { FSUIPCTimer=SetTimer (NULL,0,2000,InitFSUIPC); }
My C compiler succesfully create my DLL but when I put into \modules folder, fs does not load it. I'm a newbie about dll, I dunno how to debug.
Any advice?
thanks!
-
Ehm...Peter, but with Visual Studio 2005 and C#, can I create a DLL compatible with fs2004? or must I use the good old VC6 and C++?
-
Such I supposed, thanks Peter. So if I detect the visibility and write down a value for 0x0DDE offset, in my scenery I'll be able to condition my object using the usrvr5, right?
-
Hello guys,
I would like to read the offset for fog presence. Is possible? I cannot find anything in documentation
thanks!
PS: I use fs2004
FS9 DLL problem
in FSUIPC Support Pete Dowson Modules
Posted
Thank you for complete explanation Pete, but since the LUA handling by FSUIPC is reserved only for registered user, I would prefer to move back to a DLL as I've to distribuite my scenery for free.