-
Notifications
You must be signed in to change notification settings - Fork 0
/
DCIL2.cms
259 lines (218 loc) · 5.69 KB
/
DCIL2.cms
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
// CMS Script File
//
// Game Title: IL2 Pacific Fighters
// Written By: Dace (Sias Mey)
// Date: 2006-03-28
//
// Buttons used by the script
%define btn_inc_fov cms.b1
%define btn_dec_fov cms.b2
%define btn_raise_gear_man cms.b3
%define btn_lower_gear_man cms.b4
%define btn_map cms.b5
%define btn_toggle_fov cms.b6
%define btn_inc_sight_alt cms.b7
%define btn_inc_sight_vel cms.b8
%define btn_dec_sight_alt cms.b9
%define btn_dec_sight_vel cms.b10
// Joy buttons used by script
%define btn_shift js1.b4
%define joy_trim_ele_up js1.b9
%define joy_trim_ele_down js1.b7
%define joy_trim_rud_left js1.b10
%define joy_trim_rud_right js1.b8
%define joy_trim_ail_left js1.b10
%define joy_trim_ail_right js1.b8
%define joy_inc_fov js2.b2
//shift to decrease
%define joy_dec_fov js2.b2
// Joy axis used by script
%define joy_left_brake js3.a1
%define joy_right_brake js3.a2
%define joy_mini_x js2.a1
%define joy_mini_y js2.a2
// Constants used by script
%define trim_slow_delay 0
%define trim_slow_rep 1
%define trim_slow_amt 1
%define trim_fast_delay 60
%define trim_fast_rep 2
%define trim_fast_amt 4
%define key_hold_delay 5
%define mini_hat_lt 200
%define mini_hat_st 55
// Axises used by the script
%define ax_trim_rud cms.a1
%define ax_trim_ail cms.a2
%define ax_trim_ele cms.a3
%define ax_brakes cms.a4
// Logical devices used by script
%define trim_slow d1
%define trim_fast d2
%define key_hold d3
// Internal bit registers used by the script
%define first b1
%define trimming b2
script
if( not first ) then
first = true;
trimming = false;
ax_trim_rud = 128;
ax_trim_ail = 128;
ax_trim_ele = 128;
endif
//FOV changing
sequence
while( joy_inc_fov and not btn_shift );
btn_dec_fov = true;
delay( 2 );
btn_dec_fov = false;
delay( 1 );
endsequence
sequence
while( joy_dec_fov and btn_shift );
btn_inc_fov = true;
delay( 2 );
btn_inc_fov = false;
delay( 1 );
endsequence
//trimming
trimming = joy_trim_ele_up or joy_trim_ele_down or joy_trim_ail_left or joy_trim_ail_right;
timer( ONDELAY, trim_slow, trim_slow_delay ) = trimming;
timer( ONDELAY, trim_fast, trim_fast_delay ) = trimming;
if ( trim_fast ) then
sequence
while( joy_trim_ail_left and not btn_shift );
ax_trim_ail = ax_trim_ail - trim_fast_amt;
delay( trim_fast_rep );
endsequence
sequence
while( joy_trim_ail_right and not btn_shift );
ax_trim_ail = ax_trim_ail + trim_fast_amt;
delay( trim_fast_rep );
endsequence
sequence
while( joy_trim_ele_up and not btn_shift );
ax_trim_ele = ax_trim_ele - trim_fast_amt;
delay( trim_fast_rep );
endsequence
sequence
while( joy_trim_ele_down and not btn_shift );
ax_trim_ele = ax_trim_ele + trim_fast_amt;
delay( trim_fast_rep );
endsequence
sequence
while( joy_trim_rud_left and btn_shift );
ax_trim_rud = ax_trim_rud - trim_fast_amt;
delay( trim_fast_rep );
endsequence
sequence
while( joy_trim_ail_right and btn_shift );
ax_trim_rud = ax_trim_rud + trim_fast_amt;
delay( trim_fast_rep );
endsequence
else
if ( trim_slow ) then
sequence
while( joy_trim_ail_left and not btn_shift );
ax_trim_ail = ax_trim_ail - trim_slow_amt;
delay( trim_slow_rep );
endsequence
sequence
while( joy_trim_ail_right and not btn_shift );
ax_trim_ail = ax_trim_ail + trim_slow_amt;
delay( trim_slow_rep );
endsequence
sequence
while( joy_trim_ele_up and not btn_shift );
ax_trim_ele = ax_trim_ele - trim_slow_amt;
delay( trim_slow_rep );
endsequence
sequence
while( joy_trim_ele_down and not btn_shift );
ax_trim_ele = ax_trim_ele + trim_slow_amt;
delay( trim_slow_rep );
endsequence
sequence
while( joy_trim_rud_left and btn_shift );
ax_trim_rud = ax_trim_rud - trim_slow_amt;
delay( trim_slow_rep );
endsequence
sequence
while( joy_trim_ail_right and btn_shift );
ax_trim_rud = ax_trim_rud + trim_slow_amt;
delay( trim_slow_rep );
endsequence
endif
endif
sequence
wait( (( joy_trim_ele_up ) or ( joy_trim_ele_down )) and btn_shift );
ax_trim_rud = 128;
ax_trim_ail = 128;
ax_trim_ele = 128;
endsequence
//toe brakes from rudder pedals
if ( [ joy_left_brake >= joy_right_brake ] ) then
ax_brakes = joy_left_brake;
else
ax_brakes = joy_right_brake;
endif
if ( not btn_shift ) then
Sequence
wait( [ joy_mini_x > mini_hat_lt ] );
btn_map = true;
delay(3);
btn_map = false;
EndSequence
Sequence
wait( [ joy_mini_x < mini_hat_st ] );
btn_toggle_fov = true;
delay(3);
btn_toggle_fov = false;
EndSequence
Sequence
while( [ joy_mini_y > mini_hat_lt ] );
btn_raise_gear_man = true;
delay(2);
btn_raise_gear_man = false;
delay(2);
EndSequence
Sequence
while( [ joy_mini_y < mini_hat_st ] );
btn_lower_gear_man = true;
delay(2);
btn_lower_gear_man = false;
delay(2);
EndSequence
endif
if ( btn_shift ) then
Sequence
while( [ joy_mini_x > mini_hat_lt ] );
btn_inc_sight_vel = true;
delay(2);
btn_inc_sight_vel = false;
delay(2);
EndSequence
Sequence
while( [ joy_mini_x < mini_hat_st ] );
btn_dec_sight_vel = true;
delay(2);
btn_dec_sight_vel = false;
delay(2);
EndSequence
Sequence
while( [ joy_mini_y > mini_hat_lt ] );
btn_inc_sight_alt = true;
delay(2);
btn_inc_sight_alt = false;
delay(2);
EndSequence
Sequence
while( [ joy_mini_y < mini_hat_st ] );
btn_dec_sight_alt = true;
delay(2);
btn_dec_sight_alt = false;
delay(2);
EndSequence
endif
endscript