-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFS19-Zeplin-Macros-v0.1.1.ttm
316 lines (290 loc) · 14.4 KB
/
FS19-Zeplin-Macros-v0.1.1.ttm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
//---------------------------------------------------------------------------
// MACRO VARIABLE INITALISATION
//---------------------------------------------------------------------------
int CCount = 0;
int MorseDashDelay = 450 ;
int MorseDotDelay = 300 ;
int MorseDelay = 200 ;
//---------------------------------------------------------------------------
// CUSTOM FUNCTIONS
//---------------------------------------------------------------------------
int ControlCount(){ //Used to toggle between Forestry and Tractor Binds
if (CCount<1) {
CCount=CCount+1;
//printf("Loading Forestry Keymaps \xa");
ForestyControlButtons();
TwoPulse();
}
else {
CCount=0;
//printf("Loading Tractor Keymaps \xa");
TractorControlButtons();
OnePulse();
}
}
int ThreePulse(){
if (LightAlert == 1) ActKey(CHAIN(KEYON+Lights,D(MorseDotDelay),KEYON+PULSE+Lights,D(MorseDelay),KEYON+Lights,D(MorseDotDelay),KEYON+PULSE+Lights,D(MorseDelay),KEYON+Lights,D(MorseDotDelay),KEYON+PULSE+Lights));
if (SoundAlert == 1) ActKey(CHAIN(KEYON+Horn,D(MorseDotDelay),KEYON+PULSE+Horn,D(MorseDelay),KEYON+Horn,D(MorseDotDelay),KEYON+PULSE+Horn,D(MorseDelay),KEYON+Horn,D(MorseDotDelay),KEYON+PULSE+Horn));
}
int TwoPulse(){
if (LightAlert == 1) ActKey(CHAIN(KEYON+Lights,D(MorseDotDelay),KEYON+PULSE+Lights,D(MorseDelay),KEYON+Lights,D(MorseDotDelay),KEYON+PULSE+Lights));
if (SoundAlert == 1) ActKey(CHAIN(KEYON+Horn,D(MorseDotDelay),KEYON+PULSE+Horn,D(MorseDelay),KEYON+Horn,D(MorseDotDelay),KEYON+PULSE+Horn));
}
int OnePulse(){
if (LightAlert == 1) ActKey(CHAIN(KEYON+Lights,D(MorseDotDelay),KEYON+PULSE+Lights));
if (SoundAlert == 1) ActKey(CHAIN(KEYON+Horn,D(MorseDotDelay),KEYON+PULSE+Horn));
}
int JoyAxisCurveCount(){ //increment to JSProfile to switch between Axis response curves
if (JSProfile < 2) JSProfile=JSProfile+1;
else JSProfile=0;
JoyControlIncrement ();
}
int JoyControlIncrement(){ //Ingame and text response to changes in Axis Joystick Curves
if (JSProfile == 2) {
printf("Precision Joystick Axis Curves \xa");
ThreePulse();
}
if (JSProfile == 1) {
printf("Flat Joystick Axis Curves \xa");
TwoPulse();
}
if (JSProfile == 0) {
printf("Progressive Joystick Axis Curves \xa");
OnePulse();
}
JoyAxisCurveSet();
}
int MotionControlAssign(){ //used to select FDR or One Stick Movement
if (ThrottleStyle == 1){//one stick movement
MapKey(&T16000L, H1U, TEMPO(PULSE+CruiseControl,MachineForward,LongPressDelay));
MapKey(&T16000L, H1D, MachineStopReverse);
if (WarthogStick == 1) {
MapKey(&Joystick, H1U, HatUpJoyL );
MapKey(&Joystick, H1D, HatDownJoyL );
}
else {
MapKey(&T16000, H1U, HatUpJoyL );
MapKey(&T16000, H1D, HatDownJoyL);
}
printf("One Stick Motion Enabled \xa"); }
if (ThrottleStyle ==0){//FDR Movement
MapKey(&T16000L, H1U, HatUpJoyL);
MapKey(&T16000L, H1D, HatDownJoyL);
if (WarthogStick == 1) {
MapKey(&Joystick, H1U, TEMPO(PULSE+CruiseControl,MachineForward,LongPressDelay));
MapKey(&Joystick, H1D, MachineStopReverse);
}
else {
MapKey(&T16000, H1U, TEMPO(PULSE+CruiseControl,MachineForward,LongPressDelay));
MapKey(&T16000, H1D, MachineStopReverse);
}
printf("FDR Motion Enabled \xa");}
}
int ForestyControlButtons () {
ForestyControlButtonsJoyL ();
if (WarthogStick == 1) ForestyControlButtonsJoyA10R ();
else ForestyControlButtonsJoyR ();
}
int TractorControlButtons (){
TractorControlButtonsJoyL ();
if (WarthogStick == 1) TractorControlButtonsJoyA10R ();
else TractorControlButtonsJoyR ();
}
int ForestyControlButtonsJoyL(){ //keymaps for Forestry
//Left Joystick for Key Mapings
MapKey(&T16000L, TS1, TriggerJoyL); //main trigger defined tool function 1 b
MapKey(&T16000L, TS2, TopMiddleJoyL); //top middle defined rotate claw left
MapKey(&T16000L, TS3, TopLeftJoyL); //top left defined rotate claw right
MapKey(&T16000L, TS4, TopRightJoyL); //top right defined belt/strap load
MapKey(&T16000L, B5, EngineStart); //engine start defined
MapKey(&T16000L, B6, DX55);
MapKey(&T16000L, B7, SwitchNextVehicle);
MapKey(&T16000L, B8, ParkVehicle); //park vehicle from fs19 modhub
MapKey(&T16000L, B9, DX58);
MapKey(&T16000L, B10, DX59);
//MapKey(&T16000L, B11, 0);//Lock out for usage on joystick axis live switch between two profiles should not be assigned in game
MapKey(&T16000L, B12, DX61);
MapKey(&T16000L, B13, DX62);
MapKey(&T16000L, B14, DX63);
MapKey(&T16000L, B15, DX64);
MapKey(&T16000L, B16, DX65);
MapKey(&T16000L, H1R, CameraCycle);
MapKey(&T16000L, H1L, DX67);
}//end of Forestry buttons left T16000.m
int ForestyControlButtonsJoyR(){
//Right Joystick Key Mapings
MapKey(&T16000, TS1, TriggerJoyR); //Main trigger defined tool function 2 x
MapKey(&T16000, TS2, EXEC(TopMiddleJoyR)); //Top middle defined main claw close, close front loader tool hold on neaded for sending multiple indiviual keypress
MapKeyR(&T16000, TS2, EXEC(TopMiddleJoyROff)); //Top middle defined main claw close, close front loader tool release key on button release
MapKey(&T16000, TS3, EXEC(TopLeftJoyR)); //Top left defined tool function 3, toggle pipe hold on neaded for sending multiple indiviual keypress
MapKeyR(&T16000, TS3, EXEC(TopLeftJoyROff)); //Top left defined tool function 3, toggle pipe release key on button release
MapKey(&T16000, TS4, EXEC(TopRightJoyR)); //Top right defined main claw open, open front loader tool hold on neaded for sending multiple indiviual keypress
MapKeyR(&T16000, TS4, EXEC(TopRightJoyROff)); //Top right defined main claw open, open front loader tool release key on button release
MapKey(&T16000, B5, Lights); //lights key defined
MapKey(&T16000, B6, Strobes);
MapKey(&T16000, B7, DX38);
MapKey(&T16000, B8, DX39);
MapKey(&T16000, B9, DX40);
MapKey(&T16000, B10, DX41);
//MapKey(&T16000, B11, 0);// lockout for usage for joystick mode toggle live ingame. should not be assigned in game
MapKey(&T16000, B12, DX43);
MapKey(&T16000, B13, DX44);
MapKey(&T16000, B14, DX45);
MapKey(&T16000, B15, DX46);
MapKey(&T16000, B16, DX47);
MapKey(&T16000, H1R, DX48);
MapKey(&T16000, H1L, SelectTool);
printf("---Forestry Mode Enabled \x0a");
}//end of Forestry buttons right T16000.m
int ForestyControlButtonsJoyA10R(){
//Right Joystick Key Mapings
MapKey(&Joystick, TS1, TriggerJoyR); //Main trigger defined tool function 2 x
//Mapkey(&Joystick, TS2, TriggerJotR);
MapKey(&Joystick, H2D, EXEC(TopMiddleJoyR)); //Top middle defined main claw close, close front loader tool hold on neaded for sending multiple indiviual keypress
MapKeyR(&Joystick, H2D, EXEC(TopMiddleJoyROff)); //Top middle defined main claw close, close front loader tool release key on button release
MapKey(&Joystick, H2L, EXEC(TopLeftJoyR)); //Top left defined tool function 3, toggle pipe hold on neaded for sending multiple indiviual keypress
MapKeyR(&Joystick, H2L, EXEC(TopLeftJoyROff)); //Top left defined tool function 3, toggle pipe release key on button release
MapKey(&Joystick, H2U, EXEC(TopRightJoyR)); //Top right defined main claw open, open front loader tool hold on neaded for sending multiple indiviual keypress
MapKeyR(&Joystick, H2U, EXEC(TopRightJoyROff)); //Top right defined main claw open, open front loader tool release key on button release
MapKey(&Joystick, H2R, DX36);
//MapKey(&Joystick, S1, 0);// lockout for usage for joystick mode toggle live ingame. should not be assigned in game
MapKey(&Joystick, S2, Lights); //lights key defined
MapKey(&Joystick, S3, Strobes);
MapKey(&Joystick, S4, DX37);
MapKey(&Joystick, H3U, DX38);
MapKey(&Joystick, H3R, DX39);
MapKey(&Joystick, H3D, DX40);
MapKey(&Joystick, H3L, DX41);
MapKey(&Joystick, H4U, DX43);
MapKey(&Joystick, H4R, DX44);
MapKey(&Joystick, H4D, DX45);
MapKey(&Joystick, H4L, DX46);
MapKey(&Joystick, H4P, DX47);
MapKey(&Joystick, H1R, DX48);
MapKey(&Joystick, H1L, SelectTool);
printf("---Forestry Mode Enabled \x0a");
}//end of Forestry buttons right Warthog
int TractorControlButtonsJoyL(){//keymaps for general Tractor usage
//Left Joystick Key Mapings
MapKey(&T16000L, TS1, TriggerJoyL); //main trigger defined tool function 1 b
MapKey(&T16000L, TS2, ToolLowerLift); //top middle defined lower lift tool v
MapKey(&T16000L, TS3, SelectTool); //top left defined select tool g
MapKey(&T16000L, TS4, TopRightJoyL); //top right defined belt/strap load
MapKey(&T16000L, B5, EngineStart); //engine start defined
MapKey(&T16000L, B6, DX22);
MapKey(&T16000L, B7, SwitchNextVehicle);
MapKey(&T16000L, B8, ParkVehicle); //park vehicle from fs19 modhub
MapKey(&T16000L, B9, DX24);
MapKey(&T16000L, B10, DX25);
//MapKey(&T16000L, B11, 0);//Lock out for usage on joystick axis live switch between two profiles should not be assigned in game
MapKey(&T16000L, B12, DX27);
MapKey(&T16000L, B13, DX28);
MapKey(&T16000L, B14, DX29);
MapKey(&T16000L, B15, DX30);
MapKey(&T16000L, B16, DX31);
MapKey(&T16000L, H1R, CameraCycle);
MapKey(&T16000L, H1L, DX33);
}//end of Forestry buttons left T16000.m
int TractorControlButtonsJoyR(){//keymaps for general Tractor usage
//Right Joystick Key Mapings
MapKey(&T16000, TS1, TriggerJoyR); //Main trigger defined tool function 2 x
MapKey(&T16000, TS2, EXEC(TopMiddleJoyR)); //Top middle defined main claw close, close front loader tool hold on neaded for sending multiple indiviual keypress
MapKeyR(&T16000, TS2, EXEC(TopMiddleJoyROff)); //Top middle defined main claw close, close front loader tool release key on button release
MapKey(&T16000, TS3, DX4);
MapKey(&T16000, TS4, EXEC(TopRightJoyR)); //Top right defined main claw open, open front loader tool hold on neaded for sending multiple indiviual keypress
MapKeyR(&T16000, TS4, EXEC(TopRightJoyROff)); //Top right defined main claw open, open front loader tool release key on button release
MapKey(&T16000, B5, Lights); //lights key defined
MapKey(&T16000, B6, Strobes);//strobes 'HOME' defined key
MapKey(&T16000, B7, DX7);
MapKey(&T16000, B8, DX8);
MapKey(&T16000, B9, DX9);
MapKey(&T16000, B10, DX10);
//MapKey(&T16000, B11, 0);// lockout for usage for joystick mode toggle live ingame. should not be assigned in game
MapKey(&T16000, B12, DX12);
MapKey(&T16000, B13, DX13);
MapKey(&T16000, B14, DX14);
MapKey(&T16000, B15, DX15);
MapKey(&T16000, B16, DX16);
MapKey(&T16000, H1R, DXHATRIGHT);
MapKey(&T16000, H1L, DXHATLEFT);
printf("---Tractor Mode Enabled \x0a");
}//end of Tractor buttons
int TractorControlButtonsJoyA10R(){//keymaps for general Tractor usage
//Right Joystick Key Mapings
MapKey(&Joystick, TS1, TriggerJoyR); //Main trigger defined tool function 2 x
//Mapkey(&Joystick, TS2, TriggerJotR);
MapKey(&Joystick, H2D, EXEC(TopMiddleJoyR)); //Top middle defined main claw close, close front loader tool hold on neaded for sending multiple indiviual keypress
MapKeyR(&Joystick, H2D, EXEC(TopMiddleJoyROff)); //Top middle defined main claw close, close front loader tool release key on button release
MapKey(&Joystick, H2L, DX4);
MapKey(&Joystick, H2U, EXEC(TopRightJoyR)); //Top right defined main claw open, open front loader tool hold on neaded for sending multiple indiviual keypress
MapKeyR(&Joystick, H2U, EXEC(TopRightJoyROff)); //Top right defined main claw open, open front loader tool release key on button release
MapKey(&Joystick, H2R, DX5);
//MapKey(&Joystick, S1, 0);// lockout for usage for joystick mode toggle live ingame. should not be assigned in game
MapKey(&Joystick, S2, Lights); //lights key defined
MapKey(&Joystick, S3, Strobes);
MapKey(&Joystick, S4, DX6);
MapKey(&Joystick, H3U, DX7);
MapKey(&Joystick, H3R, DX8);
MapKey(&Joystick, H3D, DX9);
MapKey(&Joystick, H3L, DX10);
MapKey(&Joystick, H4U, DX11);
MapKey(&Joystick, H4R, DX12);
MapKey(&Joystick, H4D, DX13);
MapKey(&Joystick, H4L, DX14);
MapKey(&Joystick, H4P, DX15);
MapKey(&Joystick, H1R, DXHATRIGHT);
MapKey(&Joystick, H1L, DXHATLEFT);
printf("---Tractor Mode Enabled \x0a");
}//end of Tractor buttons
int JoyAxisSet(){
//Joystick Axis Left
MapAxis(&T16000L, JOYX, DX_Z_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000L, JOYY, DX_YROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000L, RUDDER, DX_ZROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000L, THR, DX_THROTTLE_AXIS, AXIS_REVERSED, MAP_ABSOLUTE);
//printf("---Left Joystick Axis Set \xa");
//Joystick Axis Right
if (WarthogStick == 1){
MapAxis(&Joystick, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&Joystick, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
}
else {
MapAxis(&T16000, JOYX, DX_X_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000, JOYY, DX_Y_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000, RUDDER, DX_XROT_AXIS, AXIS_NORMAL, MAP_ABSOLUTE);
MapAxis(&T16000, THR, DX_SLIDER_AXIS, AXIS_REVERSED, MAP_ABSOLUTE);
}
//printf("---Right Joystick Axis Set \xa");
}
int JoyAxisCurveSet(){
//Joystick Curves Left
SetSCurve(&T16000L, JOYX, 0,JSDeadZone,0,JSCurve[JSProfile],JSZoom[JSProfile]);
SetSCurve(&T16000L, JOYY, 0,JSDeadZone,0,JSCurve[JSProfile],JSZoom[JSProfile]);
SetSCurve(&T16000L, RUDDER, 0,JSDeadZone,0,JSCurve[JSProfile],JSZoom[JSProfile]);
printf("---Left Joystick Curves Set \xa") ;
//Joystick Curves Right
if (WarthogStick == 1){
SetSCurve(&Joystick, JOYX, 0,JSDeadZone,0,(JSCurve[JSProfile]/2),JSZoom[JSProfile]);
SetSCurve(&Joystick, JOYY, 0,JSDeadZone,0,(JSCurve[JSProfile]/2),JSZoom[JSProfile]);
}
else {
SetSCurve(&T16000, JOYX, 0,JSDeadZone,0,JSCurve[JSProfile],JSZoom[JSProfile]);
SetSCurve(&T16000, JOYY, 0,JSDeadZone,0,JSCurve[JSProfile],JSZoom[JSProfile]);
SetSCurve(&T16000, RUDDER, 0,JSDeadZone,0,JSCurve[JSProfile],JSZoom[JSProfile]);
}
printf("---Right Joystick Curves Set \xa");
}
int JoyThrottleCurveSet(){
//Joystick Throttle Curve Left
SetJCurve(&T16000L, THR, 50, 50);
//Joystick Throttle Curve Right
if (WarthogStick == 0) SetJCurve(&T16000, THR, 50, 50);
//printf("---Joystick Throttle Curves Set \xa");
}
int StartScriptOut(){ // Just some pretty words
printf("----------------------------------- \xa");
printf(" \xa");
printf(" Starting FS19 control script \xa");
printf(" \xa");
printf("----------------------------------- \xa");
}