Forums » Technology » Flight Sim Controllers » T.A.R.G.E.T. (Thrustmaster) » Warthog Views Script ? Active Topics You are not logged in. [Log In] [Register User]
Topic Options
Rate This Topic
Hop to:
#4020955 - 10/10/14 06:14 PM Warthog Views Script ?
Lightning Offline
Junior Member

Registered: 10/08/14
Posts: 2
Loc: BC Canada
Hello
Just by way of background, let me tell you that I have been a Thrustmaster user since the beginning, WAY back.
I even wrote all the files used in the original Ver2 install disk from Thrustmaster for the FCS Pro / WCS Mark II.
Have written MANY files for the F16 / F22 / Cougar systems.
So you see I'm not just lazy, maybe it's cause I'm old (67) :), but I'm so far totally baffled by the programming language of my brand new Warthog frown
Thought I could use Target software to program a simple H1 (Hat 1) file for views in FS9 / Combat Flight Simulator 1&2, but it doesn't allow for anything more than 4 positions, no angles.
Tried to figure out Script Editor to no avail frown
Thinking maybe I spent $800 for new setup and stand by mistake?
Would someone please be so kind as to help me out with this?
As you can see from below, all I want is to be able to have all 8 views with Button S3 as an "UP" modifier so I can do a little flying and combat.
I have been away from flightsims for a few years but, would like to get my feet wet again.

Again, any help would be VERY much appreciated.

My Old File:-

# FS2004.tmj

Rem #################################################################
Rem
Rem Flight Sim 2004
Rem for
Rem Flight Sim 2004
Rem
Rem by Robert "Lightning-=BS=-CO" Baum
Rem
Rem Last modified: 10 January 2004, 10:42 am
Rem
Rem Controllers: Thrustmaster Cougar
Rem
Rem #################################################################
Rem
Rem This file works equally well with CFS1 or CFS2
Rem Views work as in Hat1 POV, with the S3 key as "UP" modifier.
Rem All other buttons assigned in FS preferences
Rem #################################################################

USE ALL_DIRECTX_BUTTONS
USE MDEF #FS2004.tmm

BTN H1U /P USB (D60 D5D)
/R USB (U60 U5D)

BTN H1UL /H KP7
BTN H1UR /H KP9
BTN H1L /H KP4
BTN H1R /H KP6
BTN H1D /H KP2
BTN H1DL /H KP1
BTN H1DR /H KP3

BTN S3 /H KP5

Top
#4022066 - 10/14/14 05:31 AM Re: Warthog Views Script ? [Re: Lightning]
Nicu Offline
Junior Member

Registered: 10/31/10
Posts: 70
Advice: use first the GUI to generate simple scripts, then examine the scripts to learn how they are made.
Also, the manual have some good examples.

Regarding your code, I tried to translate it (please let me know if I missed something).
Normally the translation from FOXY is quite straightforward, but because you need the HAT corners and TARGET does not translate these corners to virtual keys, I needed to use the Event Handler.

Code:
include "target.tmh"

//program startup
int main()
{
    if(Init(&EventHandle)) return 1; // declare the event handler, return on error
	
    POVKeys[0] = CHAIN(KP8, KP5);
    MapKey(&Joystick, S3, KP5); // BTN S3 /H KP5
}

//event handler
int prevKey = -1;
int POVKeys[] = {KP8, KP9, KP6, KP3, KP2, KP1, KP4, KP7};
int EventHandle(int type, alias o, int x)
{
    if((&o == &Joystick) & (x == POV))
    {
	if(prevKey != -1) ActKey(POVKeys[prevKey / 45]);
	prevKey = o[x];
	if(prevKey != -1) ActKey(KEYON + POVKeys[prevKey / 45]);
    }
    else DefaultMapping(&o, x);
}

Top
#4024012 - 10/18/14 01:02 AM Re: Warthog Views Script ? [Re: Lightning]
Lightning Offline
Junior Member

Registered: 10/08/14
Posts: 2
Loc: BC Canada
Thank you for the reply, just found it smile

Will try it tomorrow.

Got buttons programmed in 6 installs of FS9 and 3 of FSX using standard DX USB buttons and it works ok, but can't imagine Dog Fighting without my up diagonals (lose sight lose fight:) )

Can't wait to try your code in Combat Flight Sims (and later other Combat Sims as well)

Been a long time since I did much flying, but I may even get back into War Birds etc.

Thanks again.

PS:- I did actually spend a bunch more time reading the manuals, but it hurt my old brain smile

Top
Topic Options
Rate This Topic
Hop to:

Moderator:  EinsteinEP, RacerGT 
 
Quick Search
Recent Articles
Support SimHQ
.
Social


Recent Topics
Definition of Grind, Unlock and XP?
by MarkG
Today at 05:23 PM
The lesson is ...
by oldgrognard
Today at 04:39 PM
Star Wars Episode 3.1 - Prequel Supercut?
by phd_doc
Today at 03:39 PM
Possible terrorist shooting attack in in Ottawa
by Raw Kryptonite
Today at 01:11 PM
Building A REIT Portfolio For a High School Kid
by Haggart
Today at 10:28 AM
il-2 BoS released.
by Sokol1
Today at 09:35 AM
What aircrafts can you identify in this video?
by SteveHarris
Today at 09:19 AM
U-571 (real one)
by Stormtrooper
Today at 08:51 AM
Free or Demos?
by flyboy77
Today at 08:31 AM
Dat .50 loot - updated with a short vid.
by Ajay
Today at 05:35 AM
 

Forum Use Agreement | Privacy Statement
Copyright 1997-2014, SimHQ Inc. All Rights Reserved.