Picking units in circular sector?

Panda

New Member
Reaction score
3
I'm trying to make a spell that picks units in a circular sector and kills them, however I'm having some trouble. The spell is a non targeting spell (based on roar).

Here's the trigger:
Trigger:
  • Unit - A unit Starts the effect of an ability
    • (Ability being cast) Equal to Shove
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Shove_Customvalue Less than 100
      • Then - Actions
        • Set Shove_Customvalue = (Shove_Customvalue + 1)
      • Else - Actions
        • Set Shove_Customvalue = 1
    • Set Shove_Caster[Shove_Customvalue] = (Triggering unit)
    • Set Shove_Angle[Shove_Customvalue] = (Facing of Shove_Caster[Shove_Customvalue])
    • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Angle from (Position of Shove_Caster[Shove_Customvalue]) to (Position of (Picked unit))) Less than or equal to (Shove_Angle[Shove_Customvalue] + 60.00)
            • (Angle from (Position of Shove_Caster[Shove_Customvalue]) to (Position of (Picked unit))) Greater than or equal to (Shove_Angle[Shove_Customvalue] - 60.00)
            • (Unit-type of (Picked unit)) Equal to Gnoll
            • (Distance between (Position of Shove_Caster[Shove_Customvalue]) and (Position of (Picked unit))) Less than or equal to 500.00
          • Then - Actions
            • Unit - Kill (Picked unit)
          • Else - Actions


The important part is the 2 conditions:
Trigger:
  • (Angle from (Position of Shove_Caster[Shove_Customvalue]) to (Position of (Picked unit))) Less than or equal to (Shove_Angle[Shove_Customvalue] + 60.00)
    • (Angle from (Position of Shove_Caster[Shove_Customvalue]) to (Position of (Picked unit))) Greater than or equal to (Shove_Angle[Shove_Customvalue] - 60.00)


Whenever I try the map it seems to only kill the gnoll from certain angles, even though I'm facing the gnoll.

I have searched the forums but I haven't found anything that helped me to make it succesful. I've messed around with this spell, trying to get it right for hours thus it's starting to piss me off a lot. Help is appreciated ;)
 

canons200

New Member
Reaction score
50
do like this

Set P_1 = (Position of triggering unit)
Set UG_1 = (Units within 600.00 of P_1)
Unit Group - Pick every unit in (UG_1)) and do (Actions)
Loop - Actions

and remove the point and unitgroup leak
 

Panda

New Member
Reaction score
3
do like this

Set P_1 = (Position of triggering unit)
Set UG_1 = (Units within 600.00 of P_1)
Unit Group - Pick every unit in (UG_1)) and do (Actions)
Loop - Actions

and remove the point and unitgroup leak

No offense but you basically just rewrote what I already got.

According to my knowledge the trigger I wrote should work, however it only works from certain angles .. =(
 

canons200

New Member
Reaction score
50
I can't get what you want, anyway. Degree is 0 to 360 but facing is (-180) to 180
 

Happy

Well-Known Member
Reaction score
71
im not sure but try that...

make 2 if/then/else and use

Trigger:
  • (Angle from (Position of Shove_Caster[Shove_Customvalue]) to (Position of (Picked unit))) Less than or equal to (Shove_Angle[Shove_Customvalue] + 60.00)


for one and

Trigger:
  • (Angle from (Position of Shove_Caster[Shove_Customvalue]) to (Position of (Picked unit))) Greater than or equal to (Shove_Angle[Shove_Customvalue] - 60.00)


for the other...

i say this because all conditions you added have to be true and these 2 conditions cant be true at the same unit...if you use 2 if/then/else it should/could be fixed...
 

vypur85

Hibernate
Reaction score
803
> Degree is 0 to 360 but facing is (-180) to 180

Facing is between 0 to 360 degrees. 'Angle between points' is between -180 and 180 degrees.

Code:
Set Shove_Caster[Shove_Customvalue] = (Triggering unit)
Set Shove_Angle[Shove_Customvalue] = (Facing of Shove_Caster[Shove_Customvalue])
[B]Set AngleX = (Angle from (Position of Shove_Caster[Shove_Customvalue]) to (Position of (Picked unit)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        AngleX Less than 0.00
    Then - Actions
        Set AngleX = AngleX + 360.00
    Else - Actions[/B]
Unit Group - Pick every unit in [B](Units within 500.00 of Position of (Triggering unit) matching Unit-Type of (Matching unit) Equal to Gnoll[/B] and do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                [B]AngleX[/B] Less than or equal to (Shove_Angle[Shove_Customvalue] + 60.00)
                [B]AngleX[/B] Greater than or equal to (Shove_Angle[Shove_Customvalue] - 60.00)
            Then - Actions
                Unit - Kill (Picked unit)
            Else - Actions

Try the above. I can't really be sure if this is the solution though.
 

Panda

New Member
Reaction score
3
> Degree is 0 to 360 but facing is (-180) to 180

Facing is between 0 to 360 degrees. 'Angle between points' is between -180 and 180 degrees.

Code:
Set Shove_Caster[Shove_Customvalue] = (Triggering unit)
Set Shove_Angle[Shove_Customvalue] = (Facing of Shove_Caster[Shove_Customvalue])
[B]Set AngleX = (Angle from (Position of Shove_Caster[Shove_Customvalue]) to (Position of (Picked unit)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        AngleX Less than 0.00
    Then - Actions
        Set AngleX = AngleX + 360.00
    Else - Actions[/B]
Unit Group - Pick every unit in [B](Units within 500.00 of Position of (Triggering unit) matching Unit-Type of (Matching unit) Equal to Gnoll[/B] and do (Actions)
    Loop - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                [B]AngleX[/B] Less than or equal to (Shove_Angle[Shove_Customvalue] + 60.00)
                [B]AngleX[/B] Greater than or equal to (Shove_Angle[Shove_Customvalue] - 60.00)
            Then - Actions
                Unit - Kill (Picked unit)
            Else - Actions

Try the above. I can't really be sure if this is the solution though.

Thanks a lot, just what I was looking for :D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top