-
Notifications
You must be signed in to change notification settings - Fork 0
/
DCHAWX.cms
74 lines (55 loc) · 1.53 KB
/
DCHAWX.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
// CMS Script File
//
// Game Title: H.A.W.X
// Written By: Sias "Dace" Mey
// Date: 07-06-2008
//
%define LpedIn js3.a1
%define RpedIn js3.a2
%define PedOut cms.a1
%define ThrottleIn js2.a3
%define PedOut cms.a1
%define ThrottleOut cms.a2
%define xin js1.a1
%define yin js1.a2
%define xout cms.a3
%define yout cms.a4
%define yup a1
%define ydown a2
%define xup a3
%define xdown a4
%define deadzone 25
script
PedOut = 127 + (LpedIn - RpedIn) / 2;
if([LpedIn > 127]) then cms.b1=true; else cms.b1=false; endif
if([RpedIn > 127]) then cms.b2=true; else cms.b2=false; endif
//Evochron set a deadzone even if you ask it not to....
//So with a bit of magic I make the axis have a negative deadzone :)
if([xin > 129] or [xin < 127]) then
xup = xin - 127;
xdown = 129 - xin;
if([xin > 128]) then
xup = (xup * (128 - deadzone)) / 128;
xout = 128 + deadzone + xup;
else
xdown = (xdown * (128 - deadzone)) / 128;
xout = (128 - deadzone) - xdown;
endif
else
xout = 128;
endif
if([yin > 129] or [yin < 128]) then
yup = yin - 127;
ydown = 129 - yin;
if([yin > 128]) then
yup = (yup * (128 - deadzone)) / 128;
yout = 128 + deadzone + yup;
else
ydown = (ydown * (128 - deadzone)) / 128;
yout = (128 - deadzone) - ydown;
endif
else
yout = 128;
endif
ThrottleOut = ThrottleIn;
endScript