Accuracy System

Hot

New Member
Reaction score
9
On my Modern Warfare map i going to have an Accuracy system. It work likes this when a unit attacks, the trigger check the distance between attacker and attacked unit and if distance is equal to "X" then a custom cursed abillity is cast on the attacking unit

Trigger:
  • Accuarcy System
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • Game - Display to (All players) for 1.00 seconds the text: Trigger Fired!
      • Set PointA = (Position of (Attacking unit))
      • Set PointB = (Position of (Attacked unit))
      • Set Distance = (Distance between PointA and PointB)
      • Game - Display to (All players) the text: (Accuracy Distance: + (String(Distance)))
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer(Distance)) Greater than or equal to (Integer(AccuarcyMin[(Integer A)]))
              • (Integer(Distance)) Less than or equal to (Integer(AccuarcyMax[(Integer A)]))
            • Then - Actions
              • Set AccuarcyLevel = (Integer A)
              • Game - Display to (All players) the text: (String(AccuarcyLevel))
              • Unit - Create 1 Dummy for (Owner of (Attacking unit)) at PointA facing Default building facing degrees
              • Unit - Add MissAbility[(Integer A)] to (Last created unit)
              • Unit - Order (Last created unit) to Undead Banshee - Curse (Attacking unit)
            • Else - Actions
      • Custom script: call RemoveLocation( udg_PointA )
      • Custom script: call RemoveLocation( udg_PointB )


and here's a trigger with values
Trigger:
  • Install
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set MissAbility[1] = Accuracy (1)
      • Set MissAbility[2] = Accuracy (2)
      • Set MissAbility[3] = Accuracy (3)
      • Set MissAbility[4] = Accuracy (4)
      • Set MissAbility[5] = Accuracy (5)
      • -------- ------------------------------------------------------------------------------ --------
      • Set AccuarcyMin[1] = 1.00
      • Set AccuarcyMax[1] = 400.00
      • -------- ------------------------------------------------------------------------------ --------
      • Set AccuarcyMin[2] = 401.00
      • Set AccuarcyMax[2] = 800.00
      • -------- ------------------------------------------------------------------------------ --------
      • Set AccuarcyMin[3] = 801.00
      • Set AccuarcyMax[3] = 1200.00
      • -------- ------------------------------------------------------------------------------ --------
      • Set AccuarcyMin[4] = 1201.00
      • Set AccuarcyMax[4] = 1600.00
      • -------- ------------------------------------------------------------------------------ --------
      • Set AccuarcyMin[5] = 1601.00
      • Set AccuarcyMax[5] = 2150.00


sure this works great for my rifleman with 2000 range but what if my combat medic attacks and he only got 1600 range then it wont work balanced and proberly right? So how can i make this work correctly for all units with diffrent range with out adding tons of triggers?
+rep
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
okay but what exactly is your question here?

Edit: havent seen your edit.

you cannot check the attack range of a unit but you can check its aquisation range. for a ranged unit the aquisation range got to be at least as big as its attack range and it really doesnt make much difference if its equal.
thus you can use the aquisation range value to check the attack range if you set both values for all ranged units to be equal. this way you can use factors of the aquisation range to determine the accuracy level.

Example:
i = aquisation range (== attack range)
Set AccuarcyMin[5] = i * 0.8 + 1
Set AccuarcyMax[5] = i * 1.0
Set AccuarcyMin[4] = i * 0.6 + 1
Set AccuarcyMax[4] = i * 0.8
Set AccuarcyMin[3] = i * 0.4 + 1
Set AccuarcyMax[3] = i * 0.6
Set AccuarcyMin[2] = i * 0.2 + 1
Set AccuarcyMax[2] = i * 0.4
Set AccuarcyMin[1] = i * 0.0 + 1
Set AccuarcyMax[1] = i * 0.2
 

Moridin

Snow Leopard
Reaction score
144
I looked through your triggers and it should work for the medic too :S. What's the problem?

Also, you aren't giving your dummies expiration timers...so they will eventually lag the map.
 

tmow

New Member
Reaction score
7
If u dont like it this way, you can do it by percents, they always work better. lol
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top