Inscrit le: 21 Avr 2008 Messages: 1607 Sujets: 81 Spécialité en worldedit: Utiliser le travail des autres Médailles: 3 (En savoir plus...)
Posté le: 15/01/09 18:10 Sujet du message: Faire des dégâts à un groupe unité dans une boucle.
Bonjour à tous et toutes,
Je suis en train de faire un sort de charge et lors de la charge, les unités proches du lanceur sont poussées et subissent des dommages. Le problème, c'est que je n'arrive pas à régler les dommages à cause de la boucle nécéssaire à la charge et au knockback. Les dégâts s'effectuent à chaque répétition de la boucle, alors que je voudrais les faire une seule fois par unité poussée.
Secret:
Gui:
Trigger:
loop Brutish Charge
Evénements
Temps - Every 0.02 seconds of game time
Conditions
Actions
For each (Integer BrutishCharge_Integer[3]) from 1 to BrutishCharge_Integer[2], do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(BrutishCharge_Caster is dead) Egal à FALSE
Alors - Actions
Set BrutishCharge_CasterPointMove[1] = (Position of BrutishCharge_Caster) Set BrutishCharge_CasterPointMove[2] = (BrutishCharge_CasterPointMove[1] offset by BrutishCharge_Speed towards (Angle from BrutishCharge_CasterPointMove[1] to BrutishCharge_TargetPoint) degrees) Destructible - Pick every destructible within 200.00 of BrutishCharge_CasterPointMove[1] and do (Actions)
Boucle - Actions
Destructible - Kill (Picked destructible)
Unité - Move BrutishCharge_Caster instantly to BrutishCharge_CasterPointMove[2] Effet spécial - Create a special effect at BrutishCharge_CasterPointMove[2] using BrutishCharge_SpecialEffect[1] Effet spécial - Destroy (Last created special effect)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Alors - Actions
Set BrutishCharge_PickedGrp[BrutishCharge_Integer[3]] = (Units within BrutishCharge_RayonCollision of BrutishCharge_CasterPointMove[1] matching ((((Matching unit) is Un bâtiment) Egal à FALSE) and ((((Matching unit) is Mécanique) Egal à FALSE) and ((((Matching unit) is Une unité volante) Egal à FALSE) and ((
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Alors - Actions
Groupe unité - Pick every unit in BrutishCharge_PickedGrp[BrutishCharge_Integer[3]] and do (Actions)
Boucle - Actions
Unité - Turn collision for (Picked unit) Off Set BrutishCharge_KnockbackUnit[2] = (Position of (Picked unit)) Set BrutishCharge_KnockbackUnit[3] = (BrutishCharge_KnockbackUnit[2] offset by BrutishCharge_KnockbackSpeed towards (Angle from BrutishCharge_CasterPointMove[1] to BrutishCharge_KnockbackUnit[2]) degrees) Unité - Move (Picked unit) instantly to BrutishCharge_KnockbackUnit[3] Effet spécial - Create a special effect at BrutishCharge_KnockbackUnit[3] using BrutishCharge_SpecialEffect[2] Effet spécial - Destroy (Last created special effect) Destructible - Pick every destructible within 100.00 of BrutishCharge_KnockbackUnit[3] and do (Actions)
Boucle - Actions
Destructible - Kill (Picked destructible)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Distance between BrutishCharge_CasterPointMove[1] and BrutishCharge_KnockbackUnit[3]) Supérieur ou égal à BrutishCharge_KnockbackDistanc
Alors - Actions
[color=red]-------- ---------------------------------------------------------------------------- -------- -------- -C'est ici que je voudrais endommager les unités- -------- -------- ---------------------------------------------------------------------------- --------[/color] Unité - Turn collision for (Picked unit) On Groupe unité - Remove (Picked unit) from BrutishCharge_PickedGrp[BrutishCharge_Integer[3]]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Distance between BrutishCharge_CasterPointMove[1] and BrutishCharge_TargetPoint) Inférieur ou égal à 50.00
Alors - Actions
Déclencheur - Turn off (This trigger) Set BrutishCharge_Integer[1] = 0 Unité - Turn collision for BrutishCharge_Caster On
Sinon - Actions
[Edit] Finalement, j'ai trouvé une solution. J'Add les unités poussées dans un groupe et lorsque j'éteins le périodique, je lance un autre déclo où je fais les dommages.
Je suis bête des fois..... ^^ _________________
Page 1 sur 1 La question posée dans ce topic a été résolue !
Vous ne pouvez pas poster de nouveaux sujets dans ce forum Vous ne pouvez pas répondre aux sujets dans ce forum Vous ne pouvez pas éditer vos messages dans ce forum Vous ne pouvez pas supprimer vos messages dans ce forum Vous ne pouvez pas voter dans les sondages de ce forum