-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdvancedMissileExpressionV1.lua
More file actions
47 lines (34 loc) · 1015 Bytes
/
AdvancedMissileExpressionV1.lua
File metadata and controls
47 lines (34 loc) · 1015 Bytes
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
@name Advanced Missile Expression
@inputs Target:entity
@outputs Det Hold Vec:vector Mult
#@outputs HoloTest:vector
@persist GPS:vector
@persist LM IM Dist Tvel Gvel
@persist Tx Ty Tz
@persist Lx Ly Lz
@persist Gx Gy Gz
interval(75)
LM = 0.00000075 #Lead Angle Modifier
IM = 0.00005 #Inertia Correction Modifier
if(Target)
{
Hold = 1
Mult = 1
GPS = entity():pos()
Dist = Target:pos():distance(GPS)
if (Dist < 100) {Det = 1}
Tx = Target:pos():x()
Ty = Target:pos():y()
Tz = Target:pos():z()
Tvel = Target:vel():length() * LM
Gvel = entity():vel():length() * IM
Lx = (Target:vel():x() * (Tvel)) * Dist
Ly = (Target:vel():y() * (Tvel)) * Dist
Lz = (Target:vel():z() * (Tvel)) * Dist
Gx = entity():vel():x() * Gvel
Gy = entity():vel():y() * Gvel
Gz = entity():vel():z() * Gvel
Vec = GPS - Vec((Tx+Lx)-Gx, (Ty+Ly)-Gy, (Tz+Lz)-Gz)
#HoloTest = Vec(-((Tx+Lx)-Gx), (Ty+Ly)-Gy, ((Tz+Lz)-Gz)-150)
}
else {Mult = 0, Hold = 0}