homepage

What is different about stock tmc/ttm files?

Posted By: Moved_on

What is different about stock tmc/ttm files? - 10/24/15 09:37 PM

I've had a look through this forum and haven't found an answer already posted, so....

I finally got around to explore what Target has to offer through scripts with a view to mirroring the arrangement I had on my old Cougar created with Foxy. I read through the documentation and thought I had a pretty good understanding, borrowed extensively from the stock scripts provided by TM to help me learn and produced my first, albeit incomplete tmc/ttm, which complies without error. One thing I am struggling to understand is when I press and hold a button whilst running a stock script, e.g. DCS FC2 Mig29, it generates repeated characters for the duration of the hold and only issues the key release on physical button release. Using the old Foxy vernacular, much the same as the /P and /R command switches.

My own script, however, with the exact same syntax, only the macro name is different, generates the key press with an immediate key release [1ms] later irrespective of the button being physically released. There is nothing else in the stock file I can see being initialised that would account for this result.

My main reason for asking is I wish to replicate the behaviour produced by the stock script, i.e. repeating characters on button press that end on release. I am aware of DOWN+, UP+ and MapKeyR, but in truth keep running into compile errors when I introduce these to my script and trying to keep things simple to start. I have copied extracts from relevant tmc/ttm files below and really cannot see why they produce different results. Anyone able to shed any light on this?

Many thanks in advance.

++++++++++++++++++++++++++++++++++++++++
The stock tmc (DCS FC2 Mig29) reads:
MapKeyUMD(&Joystick, H2U,
_2__Beyond_Visual_Range_Mode,
_1__Navigation_Modes,
_7__Air_To_Ground_Mode);

where the ttm states:
define _7__Air_To_Ground_Mode USB[0x24] //(7) Air-To-Ground Mode
define _1__Navigation_Modes USB[0x1E] //(1) Navigation Modes
define _2__Beyond_Visual_Range_Mode USB[0x1F] //(2) Beyond Visual Range Mode

++++++++++++++++++++++++++++++++++++++++
My tmc reads:
MapKeyUMD(&Joystick, H2U,
MODE_BVR,
MODE_NAV,
MODE_A2G);

where the ttm states:
define MODE_A2G USB[0x24] // USB=7
define MODE_BVR USB[0x1F] // USB=2
define MODE_NAV USB[0x1E] // USB=1
++++++++++++++++++++++++++++++++++++++++
Posted By: Moved_on

Re: What is different about stock tmc/ttm files? - 10/25/15 03:44 PM

In the interest of helping others, I found the resolution. A new day and fresh comparison of the files revealed an error in pasting the closing statement below at the end of my TMC file.

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

I had inserted all my commands after this statement. Correcting this silly mistake and all the issues disappeared.
Posted By: Aullido

Re: What is different about stock tmc/ttm files? - 10/25/15 05:34 PM

The .tmc is your main file, from there other files can be called. .tmh stands for header files, this files can contain code. .tmm files are macro files where the commands can be store. Aside from the main files, the other types are the same for the compiler.
Posted By: Moved_on

Re: What is different about stock tmc/ttm files? - 10/27/15 06:25 PM

Hi Aullido,

Many thanks for the info. I think I'd got my head around the file structure, though didn't appreciate that code can be added to the tmh files too. I kind of figured these were off-limits to the user and guessing if I mess these up I'll be in a whole world of pain winkngrin
Posted By: Aullido

Re: What is different about stock tmc/ttm files? - 10/28/15 12:41 AM

Don't do that, those .h files are restricted although you can copy them and modified to use at another directory. You can create your own .h files but don't mess with the originals or you would need to reinstall if something goes wrong.
© 2024 SimHQ Forums