Shoot 2
Events
UI - Player Any Player clicks Left mouse button Down.
Local Variables
ClickPoint = (Point((Mouse X position clicked in the world), (Mouse Y position clicked in the world), (Mouse Z position clicked in the world))) <Point>
FireAngle = (Angle from CameraPoint to ClickPoint) <Real>
Distance = (Distance between CameraPoint and ClickPoint) <Real>
HightSlope = (((Height of ClickPoint) - (Height of CameraPoint)) / Distance) <Real>
HitUnit = No Unit <Unit>
CurrentRange = 0.0 <Real>
MaxRange = 100.0 <Real (Constant)>
Bullet = No Point <Point>
Conditions
And
Conditions
(PlayerUnit[(Triggering player)] is alive) == true
(PlayerUnit[(Triggering player)] is alive) == true
AttackOnCooldown[(Triggering player)] == false
CurAmmo[(Triggering player)] > 0
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
HitUnit == No Unit
CurrentRange < MaxRange
(Height of Bullet) >= (Ground height at Bullet)
Then
Variable - Modify CurrentRange: + 0.5
Variable - Set Bullet = (CameraPoint offset by CurrentRange towards FireAngle degrees)
Point - Set the height of Bullet to (HightSlope * CurrentRange)
Unit Group - Pick each unit in (Any units in (Region(Bullet, 0.3)) owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Height of (Picked unit)) >= (Height of Bullet)
Then
Variable - Set Unit[(Triggering player)] = (Picked unit)
Else
General - Wait 0.01 Game Time seconds
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
HitUnit != No Unit
Then
Environment - Execute Ghost - C-10 Canister Rifle (Damage) on HitUnit from PlayerUnit[(Triggering player)]
Else
Sound - Play Ghost_AttackLaunch for (All players) (at 100.0% volume, skip the first 0.0 seconds)
Variable - Set AttackOnCooldown[(Triggering player)] = true
Trigger - Run Cool Down Attack (Ignore Conditions, Don't Wait until it finishes)
Variable - Modify CurAmmo[(Triggering player)]: - 1
General - If (Conditions) then do (Actions) else do (Actions)
If
CurAmmo[(Triggering player)] == 0
Then
Variable - Set Reloading[(Triggering player)] = true
Trigger - Run Reload (Ignore Conditions, Don't Wait until it finishes)
Else
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Thats what i did, but it doesnt work. It gives the error:
Trigger Error in Get_Shoot2_func;
could not get "p" from perameter in
'pointgetheight' (value: 0)
None.