Conditions help...

Marvic June B. Corpuz

You can change this now in User CP.
Reaction score
1
Hello again helpers..
There's this spell which trigger condition really dumbs me to construct. I can't go on with it so I really need your help. You see i have this spell which the Hero is facing a certain angle. To clear it all to you, this is the set up.
Set Up.JPG


You see A is a hero and its facing a certain angle. I want that enemy units within 90 degrees of A's facing angle takes a certain damage. Now B and C are enemy units. I want units such as B who is directly facing A to take 50% more damage and C who faces indirectly from A to take the normal damage. I really could not set the conditions so the trigger is now hanging. Anyone can help me to set this conditions? Please... I really need it... Never mind about the damage, all I need is how to set the conditions regarding the facing angles..
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
Here is a step by step run down:

You save the position of A as Point_A
You pick all units within a certain range around Point_A
you save the position of the picked unit as Point_B
you calculate the angle between Point_A and Point_B (there is a trigger function for that)
you compare the angle you just calculated with the facing direction of A
you compare the angle - 180° (the reverse angle) with the facing direction of the picked unit
you calculate your damage from those comparisons
you continue with the next unit

good luck. Post again and show us your trigger after you tried to implement this.
 

Marvic June B. Corpuz

You can change this now in User CP.
Reaction score
1
I'll try... but am not sure if i can construct the exact conditions... I'll post it here anyway.. thanks for the reply.
 

denmax

You can change this now in User CP.
Reaction score
155
Using unit groups, we can pick all the units we want in a certain range. Do NOT use "Unit Group - Pick unit in range (with conditions)". Why? Technically, there is nothing wrong with it. For cleanliness and efficiency (sometimes), it is worse.

The problem is that you cannot really detect what is "in front" of your casting unit like a cone. We'll have to resort into something like a radius to do it, and just using a point with offset to your casting units position towards his facing angle

Triggers have leaks.. just clean em up.. this is also just written down here, so some trigger names might be wrong or the code actually wouldn't work (sorry about tha ttho)

Trigger:
  • Unit Group - Pick every unit in (Position of (Triggering unit) with offset blah blah towards facing angle of trigger unit) and do (Actions)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Unit - (Picked Unit) is Alive Equal to True
        • Unit - (Picked Unit) belongs to an enemy of (Triggering unit) Equal to True
        • Add other generic conditions (is mechanical, building, etc.)
      • Then - Actions
        • Set Damage = (Your damage)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or (Any conditions are true)
              • Real - (angle between position of picked unit and position of triggering unit) is less than (45 + Facing angle of (Picked unit))
              • Real - (angle between position of picked unit and position of triggering unit) is greater than (45 - Facing angle of (Picked unit))
          • Then - Actions
            • Unit - Cause (Triggering unit) to damage (Picked unit) by ((Damage * (1 + 0.50))) blah blah
          • Else - Actions
            • Unit - Cause (Triggering unit) to damage (Picked unit) by (Damage) blah blah
      • Else - Actions
 
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