Jump to content

ivanwfr

Members
  • Posts

    351
  • Joined

  • Last visited

1 Follower

Personal Information

  • Flight Simulators
    DCS A-10C
  • Location
    France - Limours
  • Interests
    Racing games, ESO, STO
  • Occupation
    Programmer
  • Website
    https://remotetabs.com/

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. In case anyone is willing to dig into the topic Jason seems to have dropped, here's where I'm at as I look for ways to communicate simulation to the outside world using the export API. I created a public Github repository from which you can download a ZIP archive. Text gets highlighted by value change
  2. Well, I'm not a Visual Studio expert myself as I used it only for a few C# projects. All those options you mention have only theoretical meaning for me. The name space access has to be adapted to the requirements, whatever they could be. But I won't be able to help you there and I hope someone with experience will read your message as this is clearly a matter of familiarity with the advanced configuration details. I have no idea as to what it means having to map a dll module for the editor. All I could experiment was having some results with a script calling a strstr() function that was only available when I added two sys.dll in the Plugin folder with two different names:
  3. In case you did not try this: ---------------------------- Just drop you dll file into the C:\Program Files (x86)\Thrustmaster\TARGET\Plugins folder Then, when you start C:\Program Files (x86)\Thrustmaster\TARGET\x64\TARGETScriptEditor.exe the bottom log pane will show what has been loaded. As I understand it, as long as dll files seem=s to works just like UNIX shared objects (the libXXX.so), those files are loaded by the dynamic loader of each exe. All those dll files content will fill up the process global tables with all defined functions from those files. It happens only once, as the first dll containing a function will be the priority function source, other entries will be ignored. That's how we can override a system function on UNIX by PRELOADING a dynamic library before the standard ones. This means that you don't have to load anything yourself, just call your function and optionally add their signature (declaration) into an included file like C:/Program Files (x86)/Thrustmaster/TARGET/scripts/sys.tmh Try this and tell us how it goes... -ivan
  4. Hi speedbird5, The SetShiftButton function defines all the IO and UMD modifiers keys all at once You should call it only when you want to change something. Try this modified version from my description in the first post and tell us if you get what you need. SetShiftButton( &Joystick, S4 // [i .. Paddle Switch] , &Throttle , MSL , MSD // [u .. MIC Switch Aft] , [D .. MIC Switch Down] , 0); You could think about it as if you were defining which will be the Shift, Control and Alt keys of a keyboard allowing for 6 different combinations for each of the other 30 + 18 other switches. The best place for more details is in the include/target.tmh file where you can see this: 1 define IOTOGGLE 1 2 define UDTOGGLE 2 3 int SetShiftButton( int devI=0 , int indexI=0 4 , int devUMD=0 , int indexU=0 , int indexD=0 5 , int flag=0) 6 { 7 alias io = devI, umd = devUMD; 8 layer_sw = 0; 9 if(devI) layer_sw[0] = &&io + (indexI << 1); 10 layer_sw[1] = flag & 1; 11 if(devUMD) layer_sw[3] = &&umd + (indexU << 1); 12 layer_sw[4] = flag >> 1; 13 if(devUMD) layer_sw[6] = &&umd + (indexD << 1); 14 layer_sw[7] = layer_sw[4]; 15 }
  5. Hi dmonds, I have no idea how to send a query to the device. I too had to resort to waiting for an event to handle in order to initialize a parameter instead of applying some initial value. What I found best was to rely on some user activation to sense the current value while moving the device actuator. The only drawback is that this is a prerequisite for both the hardware and software values to get synchronized. This is typically one of the reason why I gave up adding features to my code. And now, I can see that the "Lua exporting in DCS" page I used to watch going nowhere back in 2011 has simply disappeared from ED site. So, when you will get stuck somewhere, it'll be for good ;( I had some contact with Guillemot at the time and I could get a bit of insight beyond the official TARGET book. And this is how I could get some dynamic data at work in util/util_GameCB.tmc from PNP_ivanwfr_111222.zip. Maybe you can get some launch-time state or run-time feedback from the sim this way...
  6. Sorry dmonds, but as I'm not as involved as I used to be, all these mappings became nearly as alien to me as they were during my first encounter. Maybe you could get some clues from the code archive from my first post. There is something dealing with SetSCurve in axis_THR_SC_STICK.tmc. Maybe someone here could take over on this one... If you don't reach a solution for a few days, I could try harder once again.
  7. Good point! You're quite right about using the return instruction to terminate the main function. I should have replaced this system call with a standard process status value. That was just a copy-paste from my hijacked main that I wanted to ignore its original task. And BTW, this is no C, it's a dialect of some sort where everything seems familiar but with a twist. Watch out for address (&) and pointers (alias alias). I used to work with C for decades and here, I'm just a newbie sometimes ;)
  8. Hi dmonds ... for strcat: include "target.tmh" int main() { // \xa .. UNICODE HEX VALUE FOR LINEFEED printf("--------------------\xa"); alias s1 = " s1 "; // static string alias s2 = " s2 "; // static string char buf; // dynamic string Dim(&buf, 256); // memory allocation buf[0] = 0; // initialize as an empty string printf("buf=[%s]\xa", &buf); strcat(&buf, &s1); // strcat 1 printf("buf=[%s]\xa", &buf); strcat(&buf, &s2); // strcat 2 printf("buf=[%s]\xa", &buf); //---------------------------- // ... sprintf can do much better than strcat int number = 42; sprintf(&buf, "FORMATED: number=[%d] .. s1=[%s] .. s2=[%s]", number, &s1, &s2); printf("buf=[%s]\xa", &buf); printf("--------------------\xa"); exit(0); }
  9. Good job! It looks you got it right. This level of using the script language is not the shortest way to get things done real quick but, unlike with intricated macros, you can reach a clean understanding of what happens behind your code.
  10. You may try something like this: define CYCLE_INTERVAL = 500 int start_loop() { // FIRST CALL .. ON SOME EVENT handle_cycle(0); } int handle_cycle(int cycle_num) { // THIS CYCLE HANDLING // NEXT CYCLE LOOP DeferCall(CYCLE_INTERVAL , &handle_cycle, cycle_num + 1); }
  11. You last conclusion is the right one... CHAIN is defined by Init, near line 200 in target.tmh. The only legal commands you can call before Init are the Exclude(&...) calls.
  12. I do not remember quite well after all these years but I suggest you pick something else than the S4 button .. If you have it like me, serving as one of the URDL modifiers, this mapping may be the issue. If this is not the case, I'll have to refresh my memory before I can help further...
  13. Well, I tried my best to find a way to make TARGET behave like it should. But when you have a function called GetMouseX() that returns 1459 nearly every time you call it, that's not going to happen! Quite like PlugMouse(NOT absolute) should result in something that makes sense and there is no way to get an idea of what happens. My conclusion is that this code is not clean enough to work out a solution that would track the current position of the pointer as would any mouse driver. I even tried the TrimDXAxis() hack ... same result, TARGET keeps working with its private pointer position instead of starting from the current screen coordinates. And you can't correct that when GetMouseX() and GetMouseY() are not working. I got many fancy functions working so far like an toggle-able auto-zoom between first and second trigger stages with a blinking led when it's on, auto cockpit views preset file storage, etc. But this issue is a lost cause as it requires a core rework (or more accurately finished work). Sorry, I'm going to find some better way to spend my time ... as you should ;) -ivan
  14. Solbeamer, I think I found your escape route ... have a look into the target.tmh file you have already patched ... line 192 reads: [size="6"]PlugMouse([b][color="Blue"]1[/color][/b]);[/size] And that's absolute pointer coordinate mode, as you can see in the comment a few lines above. You should set an argument of 0 to have the relative pointer behavior you need: [size="6"]PlugMouse([b][color="Red"]0[/color][/b]);[/size] As I use SetCurve() with the virtual mouse, I did not test the AXIS(DirectX axis name, increment, delay before repeat); version in my code, I'll let you check this patch and wait your feedback to know how it goes. In any case, the relative mode is quite messy with SetCurve... If it works with AXIS(), I will also use it for Star Citizen. -ivan
  15. Hi Solbeamer, I will definitely have a look but I'll have to rewind my brain to the time when it still made sense to me... (not much involved anymore). But as I also care about SC, I will have to face this issue eventually but it wont be before a few days. In the meantime, all I can say is that this cursor thing is very messy in many games and here, we have TARGET to make it worse. Maybe you could call AutoHotkey to the rescue to center the pointer with something like this: ^+!Delete:: MouseMove, 100,100 ; ... Ctrl-Shift-Alt-Delete
×
×
  • Create New...