TARGET - Advanced programming - Page 3 - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 06-19-2011, 04:58 PM   #21
hreich
Senior Member
 
hreich's Avatar
 
Join Date: May 2005
Posts: 1,032
Default

The software behind TM Warthog is amazing...In another pc sim Rise of flight, it allowed one of users to make non existing trimming on WWWI era planes reality...it made me want to play it again (non exiting trimming was a reason i didnt want to play the game at the begining)...Although i know that there was no trimming in those planes...

Well I have a little programming experience in lotus domino desginer, but my work at a bank as programer turned to another direction, when company hired the external developer firm, and now it is mostly related to IT system support...
__________________

Pilot from Croatia

Last edited by hreich; 06-19-2011 at 05:02 PM.
hreich is offline   Reply With Quote
Old 06-19-2011, 07:18 PM   #22
ivanwfr
Member
 
Join Date: Apr 2011
Location: France - Limours
Posts: 309
Default

Your experience could be the reason why your are not afraid. In fact that's all that matters. The major difference between an experienced programmer and any casual one is that the first is prepared to deal with many more issues than expected by the second. You can't be disappointed by problems along the way, you should love them ...so perverse!
ivanwfr is offline   Reply With Quote
Old 06-21-2011, 09:13 PM   #23
hreich
Senior Member
 
hreich's Avatar
 
Join Date: May 2005
Posts: 1,032
Default

Hi...i have a new question...I am building clean script, which after I load it automatically turns all leds and backlight off..Reading the script manual i got this, but it isnt working:


"include "target.tmh" //here we link this file to the file that contains the default Thrustmaster function code

int main()
{
if(Init(&EventHandle)) return 1; // declare the event handler, return on error

//script and function functions go here and before the }


ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED1)); //set LED 1 OFF
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED2)); //set LED 2 OFF
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED3)); //set LED 3 OFF
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED4)); //set LED 4 OFF
ActKey(PULSE+KEYON+LED(&Throttle, LED_ONOFF, LED_CURRENT-LED5)); //set LED 5 OFF
}

int EventHandle(int type, alias o, int x)
{
DefaultMapping(&o, x);
}

"
__________________

Pilot from Croatia
hreich is offline   Reply With Quote
Old 06-21-2011, 10:46 PM   #24
ivanwfr
Member
 
Join Date: Apr 2011
Location: France - Limours
Posts: 309
Default

Well, I did not use those ActKey() commands for LED until now as I found a simpler lower level function call for what you are willing to do and you have it in BackLightOff.tmc of DCS_ivanwfr_110613.zip archive attached at the end of this thread's first post.

There is a script doing exactly that and the Pinky switch lets you toggle backlight on and off if you keep it running.

But, if you uncomment //return 1; in the main function, the interpreter will terminate after having turned all lights off.

This is simpler, quick and it works (from util\util_led.tmc file in the archive):
Code:
    GameOutput(&Throttle, OUT_ID_LED_1        , 0);
    GameOutput(&Throttle, OUT_ID_LED_2        , 0);
    GameOutput(&Throttle, OUT_ID_LED_3        , 0);
    GameOutput(&Throttle, OUT_ID_LED_4        , 0);
    GameOutput(&Throttle, OUT_ID_LED_5        , 0);
    GameOutput(&Throttle, OUT_ID_LED_BACKLIGHT, 0);
And you can play with intensity like this:
Code:
    GameOutput(&Throttle, OUT_ID_LED_INTENSITY,   0);
    GameOutput(&Throttle, OUT_ID_LED_INTENSITY,  43);
    GameOutput(&Throttle, OUT_ID_LED_INTENSITY,  86);
    GameOutput(&Throttle, OUT_ID_LED_INTENSITY, 129);
    GameOutput(&Throttle, OUT_ID_LED_INTENSITY, 172);
    GameOutput(&Throttle, OUT_ID_LED_INTENSITY, 215);
    GameOutput(&Throttle, OUT_ID_LED_INTENSITY, 255);

Last edited by ivanwfr; 06-22-2011 at 03:00 AM.
ivanwfr is offline   Reply With Quote
Old 06-24-2011, 02:03 PM   #25
hreich
Senior Member
 
hreich's Avatar
 
Join Date: May 2005
Posts: 1,032
Default

OK now i only need to figure how to make my warthog load automatically profile that switches all backlightning off when i start windows...
__________________

Pilot from Croatia
hreich is offline   Reply With Quote
Old 06-24-2011, 03:31 PM   #26
ivanwfr
Member
 
Join Date: Apr 2011
Location: France - Limours
Posts: 309
Default

This too is possible ... what a wonderful world isn't it !

If you associate tmc files to the script editor, I think you can drop a tmc file into the star-up folder:
XP version would be this one:
C:\Documents and Settings\All Users\Start Menu\Programs\Startup

But I don't know whether the idea of a shutdown folder has crossed the MS wizard's mind... ?

If our world was ruled by Unix laws instead of MS's, it would be a piece of cake, just a question of runlevel with the init system process... ;(

But I'm sure a reader can suggest something to play our trial and failure usual guesswork.

Last edited by ivanwfr; 03-04-2015 at 01:10 PM.
ivanwfr is offline   Reply With Quote
Old 06-29-2011, 12:24 PM   #27
hreich
Senior Member
 
hreich's Avatar
 
Join Date: May 2005
Posts: 1,032
Default

Thanks for info, will check later today...
Another idea that came to mind...Could you make a dynamic setting of stick sensitivities for pitch, roll and yaw with using Friction control?

Something similar to "... Slew keying/mousing tuned by Friction-Control"...but to adjust sensitivity of stick itself...so user can make stick less sensitive during refueling?
__________________

Pilot from Croatia
hreich is offline   Reply With Quote
Old 06-29-2011, 02:14 PM   #28
ivanwfr
Member
 
Join Date: Apr 2011
Location: France - Limours
Posts: 309
Default

This has crossed my mind too as this is precisely why those axis CURVE and ZOOM tuning functions are there.

Trick is only about the way we are going to choose which axis is to be adjusted when the slider is activated. This is no technical issue, it's about user friendliness.

Aren't we going to turn all these modal activation into a nightmare ?

Currently we have:

Code:
Friction-Control -- (no modifier, meaning Middle-OUT layer)
...Slew  Keys sensitivity - MFCD/HUD/COCKPIT
...Slew Mouse sensitivity - MFCD 

S4+Friction-Control -- (S4 modifier, meaning Middle-IN layer)
...FWD 95%     = Gear Down (L_SHIFT+ USB_G)
...BWD 05%     = Gear Up     (L_CTL   + USB_G)
What next? ...OK, that's crazy enough for me to give it a try!

Let's pick DOWN_OUT layer which is activated by Micro-Switch Down for me. Left thumb can still adjust FC slider while the right hand can play with the stick to feel what happens. ...looking into it right now...
ivanwfr is offline   Reply With Quote
Old 06-29-2011, 06:31 PM   #29
ivanwfr
Member
 
Join Date: Apr 2011
Location: France - Limours
Posts: 309
Default

You have it attached to the first post in DCS_ivanwfr_110629.zip

No layer involved... S3 does it all:

- Hold S3 = Joystick Precision temporary mode (like TrackIR does)
- Hold S3 + Friction Control : Adjust and retain Joystick zoom (Full forward = 100% deviation)
- ... no curve adjustment for TM Warthog HOTAS, only zoom is adjusted by SetSCurve(,,,,,,zoom=-5..0)

Last edited by ivanwfr; 06-30-2011 at 02:45 PM. Reason: updated first post archive
ivanwfr is offline   Reply With Quote
Old 06-30-2011, 06:09 PM   #30
Haggart
Member
 
Join Date: Mar 2009
Location: Frankfurt/Germany
Posts: 161
Send a message via ICQ to Haggart Send a message via MSN to Haggart
Default

Target with Cougar?
I was in update mood and switched my cougar from foxy to target. Target looks really useful (especially the scripting part), but it's kinda... weird. If I try to generate an event, it gets only generated if I chain the same event 4-5 times. The target gui does this; however, if I get into scripting, it just doesn't work that way. It's really... weird. Does anyone have any example scripts not for the Warthog, but the Cougar?
__________________
There's no "Overkill". There's only "open fire!" and "time to reload".
Specs: i7-980@4,2Ghz, 12GB RAM, 2x GTX480, 1x 8800GTS, X-Fi HD, Cougar, Warthog, dcs-F16-pedals
Haggart is offline   Reply With Quote
Reply

Tags
hotas, script, target, thrustmaster

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 03:50 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.