Circle Deplacement & Damages when ennemi enter/escape area.

Status
Not open for further replies.
So, I tried to make a spell like this :

Spell Effects : Hero target an area. Then, if an ennemi escape or enter the area, he will get damaged. Spell will end after 5seconds.

Special Effects (visuals) : Hero target an area. 18dummys are created around the area. These dummyes will turn around the area center. Dummyes will die after 5seconds.

Now this is the problem :

1. Dummyes aren't turning around the area center.
2. If an ennemi escape or enter the area, he isn't damaged.

Triggers :

  • Cercle de Lune
    • Events
      • Unit - A unit Start the effect of an ability
    • Conditions
      • (Ability being cast) Equal In Cercle de Lune
    • Actions
      • Set CdL_Index = (CdL_Index + 1)
      • Set CdL_Caster[CdL_Index] = (Triggering unit)
      • Set CdL_Level[CdL_Index] = (Level of Cercle de Lune for CdL_Caster[CdL_Index])
      • Set CdL_Point[CdL_Index] = (Target point of ability being cast)
      • Set CdL_Group[CdL_Index] = (Units within 300.00 of CdL_Point[CdL_Index] matching (((Matching unit) belongs to an enemy of (Owner of CdL_Caster[CdL_Index])) Equal to* TRUE))
      • Unit - Create 1 CdL Centre for (Owner of CdL_Caster[CdL_Index]) at CdL_Point[CdL_Index] facing CdL_Point[CdL_Index]
      • Set CdL_CentreUnit[CdL_Index] = (Last created unit)
      • Unit - Add a 5.00 second Generic expiration timer to CdL_CentreUnit[CdL_Index]
      • For each (Integer A) from 1 to 18, do (Actions)
        • Loop - Actions
          • Set CdL_Point2 = (CdL_Point[CdL_Index] offset by 300.00 towards (20.00 x (Real((Integer A)))) degrees)
          • Unit - Create 1 CdL Turn for (Owner of CdL_Caster[CdL_Index]) at CdL_Point2 facing CdL_Point[CdL_Index]
          • Unit Group - Add (Last created unit) to CdL_GroupeTurnUnits[CdL_Index]
          • Unit - Add a 5.00 second Générique expiration timer to (Last created unit)
          • Custom script: call RemoveLocation( udg_CdL_Point2 )
      • Trigger - Turn on CdL Loop <gen>
      • Trigger - Turn on CdL End <gen>
  • CdL Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from CdL_Index2 to CdL_Index, do (Actions)
        • Loop - Actions
          • For each (Integer B) from 1 to 18, do (Actions)
            • Loop - Actions
              • Set CdL_RandomUnit = (Random unit from CdL_GroupeTurnUnits[(Integer A)])
              • Unit Group - Remove CdL_RandomUnit from CdL_GroupeTurnUnits[(Integer A)]
              • Unit Group - Add CdL_RandomUnit to CdL_GroupTurnUnits2
              • Set CdL_Point2 = (CdL_Point[(Integer A)] offset by 300.00 towards ((Facing of CdL_RandomUnit) - 182.00) degrees)
              • Unit - Move CdL_RandomUnit instantly to CdL_Point2, facing CdL_Point[(Integer A)]
              • Custom script: call RemoveLocation( udg_CdL_Point2 )
          • Unit Group - Add all units of CdL_GroupTurnUnits2 to CdL_GroupeTurnUnits[(Integer A)]
          • Unit Group - Remove all units from CdL_GroupTurnUnits2
          • Set CdL_Group2 = (Units within 300.00 of CdL_Point[(Integer A)] matching ((((Matching unit) is in CdL_Group[(Integer A)]) Equal In FALSE) and (((Matching unit) belongs to an enemy of (Owner of CdL_Caster[(Integer A)])) Equal In TRUE)))
          • Unit Group - Pick every unit in CdL_Group2 and do (Actions)
            • Loop - Actions
              • Unit - Cause CdL_Caster[(Integer A)] to damage (Picked unit), dealing (100.00 + (50.00 x (Real(CdL_Level[(Integer A)])))) damage of attack type Spells and damage type Magic
          • Custom script: call DestroyGroup( udg_CdL_Group2 )
          • Set CdL_Group3 = (Units within 300.00 of CdL_Point[(Integer A)] matching (((Matching unit) belongs to an enemy of (Owner of CdL_Caster[(Integer A)])) Equal In TRUE))
          • Unit Group - Pick every unit in CdL_Group[(Integer A)] and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is in CdL_Group3) Equal In FALSE
                • Then - Actions
                  • Unit - Cause CdL_Caster[(Integer A)] to damage (Picked unit), dealing (100.00 + (50.00 x (Real(CdL_Level[(Integer A)])))) damage of attack type Spell and damage type Magic
                • Else - Actions
          • Custom script: call DestroyGroup( udg_CdL_Group3 )
          • Custom script: call DestroyGroup( udg_CdL_Group[bj_forLoopAIndex] )
          • Set CdL_Group[(Integer A)] = (Units within 300.00 of CdL_Point[(Integer A)] matching (((Matching unit) belongs to an enemy of (Owner of CdL_Caster[(Integer A)])) Equal In TRUE))
  • CdL End
    • Events
      • Unit - A unit Die
    • Conditions
      • (Unit-type of (Dying unit)) Equal In CdL Centre
    • Actions
      • Set CdL_Index2 = (CdL_Index2 + 1)
      • Custom script: call DestroyGroup( udg_CdL_Group[udg_CdL_Index2] )
      • Custom script: call RemoveLocation( udg_CdL_Point[udg_CdL_Index2] )
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CdL_Index + 1) Equal In CdL_Index2
        • Then - Actions
          • Trigger - Turn off CdL Loop <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
Level 8
Joined
Mar 23, 2007
Messages
302
I highly recomment you to do it in jass, as i can just imagine it to be a pain doing it in GUI...

You make a timer when the ability kicks in.
This timer picks all units around the caster (removes the caster from this group)
damages all units every 0.5 seconds and checks if the group is the same as before.
If its not, then it picks the missing unit and deals it additional damage.

Jo that the theory, and its doable :)
 
Level 4
Joined
Jan 20, 2011
Messages
65
For each (Integer A) from CdL_Index2 to CdL_Index, do (Actions)

whats the CdL_Index2 ?

it seems fine to me only possiblity i could think of right now is that it doesnt loop through all the indicies , can that be?
 
Level 4
Joined
Jan 20, 2011
Messages
65
ok i understand the trigger now, but i duno why it doesnt work yet^^ it seems fine to me
they are not turning and no damage, this means the loop is not working?
maybe it somehow gets deactivated, how about disableing all functions which disable the trigger just in case mb
 
Probably because the triggers are in a foreign language is why you aren't getting expedient assistance with this one.

And please Equal do not recommend JASS to GUI users try to keep JASS in the JASS threads and GUI in the GUI threads, becuase anything JASS can do so can GUI just at worst needs a little custom script.

I can make a traduction of french words on my triggers for make them easier to understand. (to note that the GUI balise don't take "é", "è", "à" and this don't help for undestand)

EDIT : Traduction done. I think it will help you.
 
EDIT : You should init CdL_Index to 0, CdL_Index2 to 1 and check if "(CdL_Index-1) Equals CdL_Index2" in the ending trigger.

And the loop should be from CdL_Index to CdL_Index2, no?

Also, the variable "CdL_GroupeTurnUnits" must be initialized with a good array size (déploiement) in you case, not 0.

Maybe the dummies are not turning around because they don't change their "facing" instantatly with the action "move unit facing point" (they should have a non-zero movespeed too). I suggest you to display if they are really in the group or not.

I don't see any other flaw for now... Tell us if it helped.
 
EDIT : You should init CdL_Index to 0, CdL_Index2 to 1 and check if "(CdL_Index-1) Equals CdL_Index2" in the ending trigger.

And the loop should be from CdL_Index to CdL_Index2, no?

Also, the variable "CdL_GroupeTurnUnits" must be initialized with a good array size (déploiement) in you case, not 0.

Maybe the dummies are not turning around because they don't change their "facing" instantatly with the action "move unit facing point" (they should have a non-zero movespeed too). I suggest you to display if they are really in the group or not.

I don't see any other flaw for now... Tell us if it helped.
No. The Index system is good. CdL_Index(1) is the number of cast and CdL_Index2 is the number of finished spells.

CdL_groupeturnunit has a deployement. (1deploiement)

They have a movement speed, but mbe not turning speed. (if no, the facing will only be the same and no movement).

So need to verify all.
 
Kahite from my clan (Clan SliD) helped me to fix the trigger, and now it works perfectly.

Triggers :
  • Cercle de Lune
    • Evénements
      • Unité - A unit Initie l'effet d'une compétence
    • Conditions
      • (Ability being cast) Egal Ã* Cercle de Lune
    • Actions
      • Set CdL_Index = (CdL_Index + 1)
      • Set CdL_Caster[CdL_Index] = (Triggering unit)
      • Set CdL_Level[CdL_Index] = (Level of Cercle de Lune for CdL_Caster[CdL_Index])
      • Set CdL_Point[CdL_Index] = (Target point of ability being cast)
      • Set CdL_Group[CdL_Index] = (Units within 300.00 of CdL_Point[CdL_Index] matching (((Matching unit) belongs to an enemy of (Owner of CdL_Caster[CdL_Index])) Egal Ã* TRUE))
      • Unité - Create 1 CdL Centre for (Owner of CdL_Caster[CdL_Index]) at CdL_Point[CdL_Index] facing CdL_Point[CdL_Index]
      • Set CdL_CentreUnit[CdL_Index] = (Last created unit)
      • Unité - Add a 5.00 second Générique expiration timer to CdL_CentreUnit[CdL_Index]
      • For each (Integer A) from 1 to 18, do (Actions)
        • Boucle - Actions
          • Set CdL_Point2 = (CdL_Point[CdL_Index] offset by 300.00 towards (20.00 x (Real((Integer A)))) degrees)
          • Unité - Create 1 CdL Turn for (Owner of CdL_Caster[CdL_Index]) at CdL_Point2 facing CdL_Point[CdL_Index]
          • Groupe unité - Add (Last created unit) to CdL_GroupeTurnUnits[CdL_Index]
          • Unité - Add a 5.00 second Générique expiration timer to (Last created unit)
          • Custom script: call RemoveLocation( udg_CdL_Point2 )
      • Déclencheur - Turn on CdL Loop <gen>
      • Déclencheur - Turn on CdL End <gen>
  • CdL Loop
    • Evénements
      • Temps - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from CdL_Index2 to CdL_Index, do (Actions)
        • Boucle - Actions
          • Set CdL_Entier = 0
          • Groupe unité - Pick every unit in CdL_GroupeTurnUnits[(Integer A)] and do (Actions)
            • Boucle - Actions
              • Set CdL_Entier = (CdL_Entier + 1)
              • Set CdL_Point3 = (Position of (Picked unit))
              • Set CdL_Point2 = (CdL_Point[(Integer A)] offset by ((300.00 x (Cos((1.00 + (Angle from CdL_Point3 to CdL_Point[(Integer A)]))))), (300.00 x (Sin((1.00 + (Angle from CdL_Point3 to CdL_Point[(Integer A)])))))))
              • Unité - Move (Picked unit) instantly to CdL_Point2, facing CdL_Point[(Integer A)]
              • Custom script: call RemoveLocation( udg_CdL_Point2 )
              • Custom script: call RemoveLocation( udg_CdL_Point3 )
          • Set CdL_Group2 = (Units within 300.00 of CdL_Point[(Integer A)] matching ((((Matching unit) is in CdL_Group[(Integer A)]) Egal Ã* FALSE) and (((Matching unit) belongs to an enemy of (Owner of CdL_Caster[(Integer A)])) Egal Ã* TRUE)))
          • Groupe unité - Pick every unit in CdL_Group2 and do (Actions)
            • Boucle - Actions
              • Unité - Cause CdL_Caster[(Integer A)] to damage (Picked unit), dealing (100.00 + (50.00 x (Real(CdL_Level[(Integer A)])))) damage of attack type Sorts and damage type Magique
          • Custom script: call DestroyGroup( udg_CdL_Group2 )
          • Set CdL_Group3 = (Units within 300.00 of CdL_Point[(Integer A)] matching (((Matching unit) belongs to an enemy of (Owner of CdL_Caster[(Integer A)])) Egal Ã* TRUE))
          • Groupe unité - Pick every unit in CdL_Group[(Integer A)] and do (Actions)
            • Boucle - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • ((Picked unit) is in CdL_Group3) Egal Ã* FALSE
                • Alors - Actions
                  • Unité - Cause CdL_Caster[(Integer A)] to damage (Picked unit), dealing (100.00 + (50.00 x (Real(CdL_Level[(Integer A)])))) damage of attack type Sorts and damage type Magique
                • Sinon - Actions
          • Custom script: call DestroyGroup( udg_CdL_Group3 )
          • Custom script: call DestroyGroup( udg_CdL_Group[bj_forLoopAIndex] )
          • Set CdL_Group[(Integer A)] = (Units within 300.00 of CdL_Point[(Integer A)] matching (((Matching unit) belongs to an enemy of (Owner of CdL_Caster[(Integer A)])) Egal Ã* TRUE))
  • CdL End
    • Evénements
      • Unité - A unit Meurt
    • Conditions
      • (Unit-type of (Dying unit)) Egal Ã* CdL Centre
    • Actions
      • Custom script: call DestroyGroup( udg_CdL_Group[udg_CdL_Index2] )
      • Custom script: call RemoveLocation( udg_CdL_Point[udg_CdL_Index2] )
      • Set CdL_Index2 = (CdL_Index2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • (CdL_Index + 1) Egal Ã* CdL_Index2
        • Alors - Actions
          • Déclencheur - Turn off CdL Loop <gen>
          • Déclencheur - Turn off (This trigger)
        • Sinon - Actions
 
Status
Not open for further replies.
Top