Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 25/01/13 20:00 Sujet du message: Bug MUI et Hashtable
J'ai voulu re-coder un de mes sorts en utilisant les hashtables plutôt qu'un système d'indexing, sauf que le sort (bien qu'il marche parfaitement) n'est malheureusement pas MUI car lorsqu'on lance le sort alors qu'une instance est en cours, celle-ci s'arrête. Donc voilà les déclencheurs (C'est du GUI, j'arrête de faire du vJass pendant un petit moment puis je bosserai sur AQ):
Secret:
Gui:
Trigger:
Fire Circle Settings
Evénements
Temps - Elapsed game time is 0.00 seconds
Conditions
Actions
-------- On initalise notre hashtable -------- Table de hachage - Create a hashtable Set Fire_Circle_Hashtable = (Last created hashtable) -------- On définit la distance d'éloignement max des orbes -------- Set Fire_Circle_MaxDistanceBase = 800.00 Set Fire_Circle_MaxDistanceLevel = 200.00 -------- On définit si les orbes entreront en rotation à la fin de leur éloignement -------- -------- et combien de temps elles resteront en rotation -------- Set Fire_Circle_Turning = TRUE Set Fire_Circle_Turning_Time = 3.00 -------- On définit l'incrémentation de l'angle et de la distance des orbes -------- Set Fire_Circle_Speed_Base = 2.50 Set Fire_Circle_Speed_Level = 2.50 -------- On définit les cibles du sort -------- Set Fire_Circle_Damage_Air = TRUE Set Fire_Circle_Damage_Ground = TRUE Set Fire_Circle_Damage_Heroes = TRUE Set Fire_Circle_Damage_Immune = FALSE Set Fire_Circle_Damage_Mechanical = TRUE Set Fire_Circle_Damage_Building = FALSE -------- On définit les dégâts de base du sort et les dégâts par niveau -------- Set Fire_Circle_Base_Damage = 50.00 Set Fire_Circle_Level_Damage = 50.00 -------- On définit les types de dégâts infligés par les orbes -------- Set Fire_Circle_Damage_Type = Magie -------- On définit si les orbes peuvent infliger des critiques -------- Set Fire_Circle_Critical = FALSE -------- On définit le multiplicateur de critiques -------- Set Fire_Circle_CriticalMultiplier = 2.00 -------- On définit les chances de critiques -------- Set Fire_Circle_CriticalChanceBase = 1.00 Set Fire_Circle_CriticalChanceLvl = 2.00 -------- On définit le modèle graphique des effets spéciaux créées -------- Set Fire_Circle_SFX = AbilitiesWeaponsPhoenixMissilePhoenix_Missile.mdl -------- On définit la compétence de base du sort -------- Set Fire_Circle_Ability = Cercle de feu (GUI)
Secret:
Gui:
Trigger:
Fire Circle Start
Evénements
Unité - A unit Initie l'effet d'une compétence
Conditions
(Ability being cast) Egal à Fire_Circle_Ability
Actions
-------- On définit nos variables -------- Set Fire_Circle_Angle1 = 120.00 Table de hachage - Save Fire_Circle_Angle1 as 1 of (Key (Casting unit)) in Fire_Circle_Hashtable Set Fire_Circle_Angle2 = 240.00 Table de hachage - Save Fire_Circle_Angle2 as 3 of (Key (Casting unit)) in Fire_Circle_Hashtable Set Fire_Circle_Angle1 = 360.00 Table de hachage - Save Fire_Circle_Angle3 as 5 of (Key (Casting unit)) in Fire_Circle_Hashtable Table de hachage - Save Handle Of(Casting unit) as 0 of (Key (Casting unit)) in Fire_Circle_Hashtable Set TmpPoint = (Position of (Casting unit)) -------- On crée le premier dummy -------- Set TmpPoint2 = (TmpPoint offset by 90.00 towards Fire_Circle_Angle1 degrees) Unité - Create 1 Dummy (Cercle de feu) for (Owner of (Casting unit)) at TmpPoint2 facing Orientation bâtiment par défaut degrees Table de hachage - Save Handle Of(Last created unit) as 2 of (Key (Casting unit)) in Fire_Circle_Hashtable Unité - Set level of Fire Circle Damage (Neutre Hostile) for (Last created unit) to (Level of Fire_Circle_Ability for (Casting unit)) Effet spécial - Create a special effect at TmpPoint2 using Fire_Circle_SFX Effet spécial - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_TmpPoint2) -------- On crée le second dummy -------- Set TmpPoint2 = (TmpPoint offset by 90.00 towards Fire_Circle_Angle2 degrees) Unité - Create 1 Dummy (Cercle de feu) for (Owner of (Casting unit)) at TmpPoint2 facing Orientation bâtiment par défaut degrees Unité - Set level of Fire Circle Damage (Neutre Hostile) for (Last created unit) to (Level of Fire_Circle_Ability for (Casting unit)) Table de hachage - Save Handle Of(Last created unit) as 4 of (Key (Casting unit)) in Fire_Circle_Hashtable Effet spécial - Create a special effect at TmpPoint2 using Fire_Circle_SFX Effet spécial - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_TmpPoint2) -------- On crée le troisième dummy -------- Set TmpPoint2 = (TmpPoint offset by 90.00 towards Fire_Circle_Angle3 degrees) Unité - Create 1 Dummy (Cercle de feu) for (Owner of (Casting unit)) at TmpPoint2 facing Orientation bâtiment par défaut degrees Unité - Set level of Fire Circle Damage (Neutre Hostile) for (Last created unit) to (Level of Fire_Circle_Ability for (Casting unit)) Table de hachage - Save Handle Of(Last created unit) as 6 of (Key (Casting unit)) in Fire_Circle_Hashtable Effet spécial - Create a special effect at TmpPoint2 using Fire_Circle_SFX Effet spécial - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_TmpPoint) Custom script: call RemoveLocation(udg_TmpPoint2) -------- On définit al distance de cette instance à 0 -------- Set Fire_Circle_Distance = 0.00 Table de hachage - Save Fire_Circle_Distance as 7 of (Key (Casting unit)) in Fire_Circle_Hashtable Set Fire_Circle_MaxDistance = (Fire_Circle_MaxDistanceBase + ((Real((Level of Fire_Circle_Ability for (Casting unit)))) x Fire_Circle_MaxDistanceLevel)) Table de hachage - Save Fire_Circle_MaxDistance as 8 of (Key (Casting unit)) in Fire_Circle_Hashtable -------- On regarde si la boolean de rotation est égale à true --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Fire_Circle_Turning Egal à TRUE
Alors - Actions
Set Fire_Circle_Turning_Countdown = Fire_Circle_Turning_Time Table de hachage - Save Fire_Circle_Turning_Countdown as 9 of (Key (Casting unit)) in Fire_Circle_Hashtable Set Fire_Circle_Run_Rotation = FALSE Table de hachage - Save Fire_Circle_Run_Rotation as 10 of (Key (Casting unit)) in Fire_Circle_Hashtable
Sinon - Actions
Groupe unité - Add (Casting unit) to Fire_Circle_Group
Gui:
Trigger:
Fire Circle Loop
Evénements
Temps - Every 0.03 seconds of game time
Conditions
Actions
Groupe unité - Pick every unit in Fire_Circle_Group and do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
((Load 2 of (Key (Picked unit)) in Fire_Circle_Hashtable) is alive) Egal à TRUE ((Load 4 of (Key (Picked unit)) in Fire_Circle_Hashtable) is alive) Egal à TRUE ((Load 6 of (Key (Picked unit)) in Fire_Circle_Hashtable) is alive) Egal à TRUE
Alors - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Load 7 of (Key (Picked unit)) from Fire_Circle_Hashtable) Inférieur à (Load 8 of (Key (Picked unit)) from Fire_Circle_Hashtable)
Alors - Actions
Set Fire_Circle_Distance = ((Load 7 of (Key (Picked unit)) from Fire_Circle_Hashtable) + (Fire_Circle_Speed_Base + (Fire_Circle_Speed_Level x (Real((Level of Fire_Circle_Ability for (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable))))))) Table de hachage - Save Fire_Circle_Distance as 7 of (Key (Picked unit)) in Fire_Circle_Hashtable Set Fire_Circle_Angle1 = ((Load 1 of (Key (Picked unit)) from Fire_Circle_Hashtable) + (Fire_Circle_Speed_Base + (Fire_Circle_Speed_Level x (Real((Level of Fire_Circle_Ability for (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable))))))) Table de hachage - Save Fire_Circle_Angle1 as 1 of (Key (Picked unit)) in Fire_Circle_Hashtable Unité - Make (Load 2 of (Key (Picked unit)) in Fire_Circle_Hashtable) face (Load 1 of (Key (Picked unit)) from Fire_Circle_Hashtable) over 0.00 seconds Set TmpPoint = (Position of (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable)) Set TmpPoint2 = (TmpPoint offset by (Load 7 of (Key (Picked unit)) from Fire_Circle_Hashtable) towards (Load 1 of (Key (Picked unit)) from Fire_Circle_Hashtable) degrees) Unité - Move (Load 2 of (Key (Picked unit)) in Fire_Circle_Hashtable) instantly to TmpPoint2 Effet spécial - Create a special effect at TmpPoint2 using Fire_Circle_SFX Effet spécial - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_TmpPoint) Custom script: call RemoveLocation(udg_TmpPoint2) Set Fire_Circle_Angle2 = ((Load 3 of (Key (Picked unit)) from Fire_Circle_Hashtable) + (Fire_Circle_Speed_Base + (Fire_Circle_Speed_Level x (Real((Level of Fire_Circle_Ability for (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable))))))) Table de hachage - Save Fire_Circle_Angle2 as 3 of (Key (Picked unit)) in Fire_Circle_Hashtable Unité - Make (Load 4 of (Key (Picked unit)) in Fire_Circle_Hashtable) face (Load 3 of (Key (Picked unit)) from Fire_Circle_Hashtable) over 0.00 seconds Set TmpPoint = (Position of (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable)) Set TmpPoint2 = (TmpPoint offset by (Load 7 of (Key (Picked unit)) from Fire_Circle_Hashtable) towards (Load 3 of (Key (Picked unit)) from Fire_Circle_Hashtable) degrees) Unité - Move (Load 4 of (Key (Picked unit)) in Fire_Circle_Hashtable) instantly to TmpPoint2 Effet spécial - Create a special effect at TmpPoint2 using Fire_Circle_SFX Effet spécial - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_TmpPoint) Custom script: call RemoveLocation(udg_TmpPoint2) Set Fire_Circle_Angle3 = ((Load 5 of (Key (Picked unit)) from Fire_Circle_Hashtable) + (Fire_Circle_Speed_Base + (Fire_Circle_Speed_Level x (Real((Level of Fire_Circle_Ability for (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable))))))) Table de hachage - Save Fire_Circle_Angle3 as 5 of (Key (Picked unit)) in Fire_Circle_Hashtable Unité - Make (Load 6 of (Key (Picked unit)) in Fire_Circle_Hashtable) face (Load 5 of (Key (Picked unit)) from Fire_Circle_Hashtable) over 0.00 seconds Set TmpPoint = (Position of (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable)) Set TmpPoint2 = (TmpPoint offset by (Load 7 of (Key (Picked unit)) from Fire_Circle_Hashtable) towards (Load 5 of (Key (Picked unit)) from Fire_Circle_Hashtable) degrees) Unité - Move (Load 6 of (Key (Picked unit)) in Fire_Circle_Hashtable) instantly to TmpPoint2 Effet spécial - Create a special effect at TmpPoint2 using Fire_Circle_SFX Effet spécial - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_TmpPoint) Custom script: call RemoveLocation(udg_TmpPoint2)
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Fire_Circle_Turning Egal à TRUE
Alors - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Load 9 of (Key (Picked unit)) from Fire_Circle_Hashtable) Supérieur à 0.00
Alors - Actions
Set Fire_Circle_Turning_Countdown = ((Load 9 of (Key (Picked unit)) from Fire_Circle_Hashtable) - 0.03) Table de hachage - Save Fire_Circle_Turning_Countdown as 9 of (Key (Picked unit)) in Fire_Circle_Hashtable Set Fire_Circle_Angle1 = ((Load 1 of (Key (Picked unit)) from Fire_Circle_Hashtable) + (Fire_Circle_Speed_Base + (Fire_Circle_Speed_Level x (Real((Level of Fire_Circle_Ability for (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable))))))) Table de hachage - Save Fire_Circle_Angle1 as 1 of (Key (Picked unit)) in Fire_Circle_Hashtable Unité - Make (Load 2 of (Key (Picked unit)) in Fire_Circle_Hashtable) face (Load 1 of (Key (Picked unit)) from Fire_Circle_Hashtable) over 0.00 seconds Set TmpPoint = (Position of (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable)) Set TmpPoint2 = (TmpPoint offset by (Load 7 of (Key (Picked unit)) from Fire_Circle_Hashtable) towards (Load 1 of (Key (Picked unit)) from Fire_Circle_Hashtable) degrees) Unité - Move (Load 2 of (Key (Picked unit)) in Fire_Circle_Hashtable) instantly to TmpPoint2 Effet spécial - Create a special effect at TmpPoint2 using Fire_Circle_SFX Effet spécial - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_TmpPoint) Custom script: call RemoveLocation(udg_TmpPoint2) Set Fire_Circle_Angle2 = ((Load 3 of (Key (Picked unit)) from Fire_Circle_Hashtable) + (Fire_Circle_Speed_Base + (Fire_Circle_Speed_Level x (Real((Level of Fire_Circle_Ability for (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable))))))) Table de hachage - Save Fire_Circle_Angle2 as 3 of (Key (Picked unit)) in Fire_Circle_Hashtable Unité - Make (Load 4 of (Key (Picked unit)) in Fire_Circle_Hashtable) face (Load 3 of (Key (Picked unit)) from Fire_Circle_Hashtable) over 0.00 seconds Set TmpPoint = (Position of (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable)) Set TmpPoint2 = (TmpPoint offset by (Load 7 of (Key (Picked unit)) from Fire_Circle_Hashtable) towards (Load 3 of (Key (Picked unit)) from Fire_Circle_Hashtable) degrees) Unité - Move (Load 4 of (Key (Picked unit)) in Fire_Circle_Hashtable) instantly to TmpPoint2 Effet spécial - Create a special effect at TmpPoint2 using Fire_Circle_SFX Effet spécial - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_TmpPoint) Custom script: call RemoveLocation(udg_TmpPoint2) Set Fire_Circle_Angle3 = ((Load 5 of (Key (Picked unit)) from Fire_Circle_Hashtable) + (Fire_Circle_Speed_Base + (Fire_Circle_Speed_Level x (Real((Level of Fire_Circle_Ability for (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable))))))) Table de hachage - Save Fire_Circle_Angle3 as 5 of (Key (Picked unit)) in Fire_Circle_Hashtable Unité - Make (Load 6 of (Key (Picked unit)) in Fire_Circle_Hashtable) face (Load 5 of (Key (Picked unit)) from Fire_Circle_Hashtable) over 0.00 seconds Set TmpPoint = (Position of (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable)) Set TmpPoint2 = (TmpPoint offset by (Load 7 of (Key (Picked unit)) from Fire_Circle_Hashtable) towards (Load 5 of (Key (Picked unit)) from Fire_Circle_Hashtable) degrees) Effet spécial - Create a special effect at TmpPoint2 using Fire_Circle_SFX Effet spécial - Destroy (Last created special effect) Custom script: call RemoveLocation(udg_TmpPoint) Custom script: call RemoveLocation(udg_TmpPoint2)
Sinon - Actions
Unité - Remove (Load 2 of (Key (Picked unit)) in Fire_Circle_Hashtable) from the game Unité - Remove (Load 4 of (Key (Picked unit)) in Fire_Circle_Hashtable) from the game Unité - Remove (Load 6 of (Key (Picked unit)) in Fire_Circle_Hashtable) from the game Groupe unité - Remove (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable) from Fire_Circle_Group Table de hachage - Clear all child hashtables of child (Key (Picked unit)) in Fire_Circle_Hashtable
Sinon - Actions
Unité - Remove (Load 2 of (Key (Picked unit)) in Fire_Circle_Hashtable) from the game Unité - Remove (Load 4 of (Key (Picked unit)) in Fire_Circle_Hashtable) from the game Unité - Remove (Load 6 of (Key (Picked unit)) in Fire_Circle_Hashtable) from the game Groupe unité - Remove (Load 0 of (Key (Picked unit)) in Fire_Circle_Hashtable) from Fire_Circle_Group Table de hachage - Clear all child hashtables of child (Key (Picked unit)) in Fire_Circle_Hashtable
Sinon - Actions
_________________
Inactif(Enfn presque)
Dernière édition par Ectelion le 27/01/13 15:50; édité 1 fois
Inscrit le: 21 Fév 2010 Messages: 1785 Sujets: 22 Spécialité en worldedit: La modestie Médailles: 1 (En savoir plus...)
Posté le: 26/01/13 13:09 Sujet du message:
C'est la même unité qui doit lancer 2 fois le sort pour que ça bug? Ou c'est 2 unités différentes quelconques?
Parce que là, tu utilises l'handle du caster, donc c'est normal que ça bug si le même caster lance le sort plusieurs fois en même temps.
En fait, tu utilises un mixe de plusieurs système MUI en même temps et c'est vraiment pas top.
Faut faire un choix :
• Soit tu utilises une hashtable, et tu te bases sur l'handle d'un objet que tu créés spécifiquement pour une instance de sort - généralement un timer périodique ou un trigger -. L'handle de l'unité devrait n'être utilisé que pour stocker des informations spécifiques à l'unité (comme un boost de vitesse, par exemple). Il faudrait donc 1 timer par instance de sort avec cette méthode.
• Soit tu utilises un système d'indexing GUI, qui est très bien et qui permet de n'avoir qu'un timer pour tout le sort, mais qui est pas évident à coder soi-même.
• Soit tu utilises un système d'indexing annexe, comme TimerUtils (qui, selon la version, peut être pareil que le système avec hashtable) qui gère tout le boulot à ta place mais qui est désigné pour le vJass et les structs.
Après, je crois te l'avoir déjà dit, mais je déconseille vivement d'utiliser l'event "Temps - Elapsed game time is 0.00 seconds". Mieux vaut utiliser "Map Initialization" pour éviter les freeze en début de partie (à l'exception des triggers qui initialisent les multitables et co.)... _________________
Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 26/01/13 14:16 Sujet du message:
C'est lorsque le caster lance plusieurs fois le sort en même temps.
Vaut t-il mieux que j'utilise une custom value que j'incrémente à chaque lancement du sort en tant que handle ? _________________
Inscrit le: 21 Fév 2010 Messages: 1785 Sujets: 22 Spécialité en worldedit: La modestie Médailles: 1 (En savoir plus...)
Posté le: 26/01/13 14:40 Sujet du message:
Ce serait dommage d'utiliser la custom value de l'unité pour faire fonctionner un seul sort...
Et puis tu vas avoir des problèmes d'indexage si tu essaies comme ça.
Pourquoi tu es passé sur une hashtable si ton sort fonctionnait avant, d'ailleurs? _________________
Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 26/01/13 14:43 Sujet du message:
Avant il ne faisait pas disparaître les dummmys des autres instances, seulement ceux de la dernière lancée et ne faisait pas disparaître les SFX lorsque plusieurs instances étaient lancées simultanément par différents casters. _________________
Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 27/01/13 13:26 Sujet du message:
J'ai ajouté le déclencheur de dégâts, sauf qu'il n'inflige pas de dégâts:
Secret:
Gui:
Trigger:
Fire Circle Damage
Evénements
Temps - Every 1.00 seconds of game time
Conditions
Actions
Groupe unité - Pick every unit in Fire_Circle_Group and do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
((Load 2 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable) is alive) Egal à TRUE ((Load 4 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable) is alive) Egal à TRUE ((Load 6 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable) is alive) Egal à TRUE
Alors - Actions
Set TmpDamageDealer = (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable) Set TmpPoint2 = (Position of (Load 2 of (Custom value of TmpDamageDealer) in Fire_Circle_Hashtable)) Set TmpPoint3 = (Position of (Load 4 of (Custom value of TmpDamageDealer) in Fire_Circle_Hashtable)) Set TmpPoint4 = (Position of (Load 6 of (Custom value of TmpDamageDealer) in Fire_Circle_Hashtable))
Groupe unité - Pick every unit in (Units within (Fire_Circle_RangeofDamageBase + (Fire_Circle_RangeofDamageLevel x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) of TmpPoint2 matching (((Matching unit) has buff Fire_Circle_Buff) Egal à TRUE)) and do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
((Matching unit) is Un bâtiment) Egal à TRUE Fire_Circle_Damage_Building Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Une unité volante) Egal à TRUE Fire_Circle_Damage_Air Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Un héros) Egal à TRUE Fire_Circle_Damage_Heroes Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Mécanique) Egal à TRUE Fire_Circle_Damage_Mechanical Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Insensible à la magie) Egal à TRUE Fire_Circle_Damage_Immune Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
Alors - Actions
Set TmpPoint = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Fire_Circle_DestroyTrees Egal à TRUE
Alors - Actions
Destructible - Pick every destructible within (Fire_Circle_RoDTreesBase + (Fire_Circle_RoDTreesLevel x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) of TmpPoint2 and do (Actions)
Boucle - Actions
Set Fire_Circle_Destructable = (Picked destructible) Unité - Order Fire_Circle_TR to Récolter Fire_Circle_Destructable
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Current order of Fire_Circle_TR) Egal à (Order(harvest)) (Fire_Circle_Destructable is alive) Egal à TRUE
Alors - Actions
Set TmpPoint5 = (Position of Fire_Circle_Destructable) Effet spécial - Create a special effect at TmpPoint5 using Fire_Circle_SFX_Damage_Trees Effet spécial - Destroy (Last created special effect) Destructible - Kill Fire_Circle_Destructable
Sinon - Actions
Unité - Order Fire_Circle_TR to Arrêter
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Fire_Circle_Critical Egal à FALSE
Alors - Actions
Unité - Cause TmpDamageDealer to damage (Picked unit), dealing (Fire_Circle_Base_Damage + (Fire_Circle_Level_Damage x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) damage of attack type Fire_Circle_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using Fire_Circle_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Set TmpInt = ((Integer(Fire_Circle_CriticalChanceBase)) + ((Level of Fire_Circle_Ability for TmpDamageDealer) x (Integer(Fire_Circle_CriticalChanceLvl)))) Set TmpInt2 = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
TmpInt2 Inférieur ou égal à TmpInt
Alors - Actions
Unité - Cause TmpDamageDealer to damage (Picked unit), dealing ((Fire_Circle_Base_Damage + (Fire_Circle_Level_Damage x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) x Fire_Circle_CriticalMultiplier) damage of attack type Fire_Circle_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using Fire_Circle_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Sinon - Actions
Groupe unité - Pick every unit in (Units within (Fire_Circle_RangeofDamageBase + (Fire_Circle_RangeofDamageLevel x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) of TmpPoint3 matching (((Matching unit) has buff Fire_Circle_Buff) Egal à TRUE)) and do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
((Matching unit) is Un bâtiment) Egal à TRUE Fire_Circle_Damage_Building Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Une unité volante) Egal à TRUE Fire_Circle_Damage_Air Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Un héros) Egal à TRUE Fire_Circle_Damage_Heroes Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Mécanique) Egal à TRUE Fire_Circle_Damage_Mechanical Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Insensible à la magie) Egal à TRUE Fire_Circle_Damage_Immune Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
Alors - Actions
Set TmpPoint = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Fire_Circle_DestroyTrees Egal à TRUE
Alors - Actions
Destructible - Pick every destructible within (Fire_Circle_RoDTreesBase + (Fire_Circle_RoDTreesLevel x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) of TmpPoint3 and do (Actions)
Boucle - Actions
Set Fire_Circle_Destructable = (Picked destructible) Unité - Order Fire_Circle_TR to Récolter Fire_Circle_Destructable
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Current order of Fire_Circle_TR) Egal à (Order(harvest)) (Fire_Circle_Destructable is alive) Egal à TRUE
Alors - Actions
Set TmpPoint5 = (Position of Fire_Circle_Destructable) Effet spécial - Create a special effect at TmpPoint5 using Fire_Circle_SFX_Damage_Trees Effet spécial - Destroy (Last created special effect) Destructible - Kill Fire_Circle_Destructable
Sinon - Actions
Unité - Order Fire_Circle_TR to Arrêter
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Fire_Circle_Critical Egal à FALSE
Alors - Actions
Unité - Cause TmpDamageDealer to damage (Picked unit), dealing (Fire_Circle_Base_Damage + (Fire_Circle_Level_Damage x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) damage of attack type Fire_Circle_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using Fire_Circle_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Set TmpInt = ((Integer(Fire_Circle_CriticalChanceBase)) + ((Level of Fire_Circle_Ability for TmpDamageDealer) x (Integer(Fire_Circle_CriticalChanceLvl)))) Set TmpInt2 = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
TmpInt2 Inférieur ou égal à TmpInt
Alors - Actions
Unité - Cause TmpDamageDealer to damage (Picked unit), dealing ((Fire_Circle_Base_Damage + (Fire_Circle_Level_Damage x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) x Fire_Circle_CriticalMultiplier) damage of attack type Fire_Circle_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using Fire_Circle_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Sinon - Actions
Groupe unité - Pick every unit in (Units within (Fire_Circle_RangeofDamageBase + (Fire_Circle_RangeofDamageLevel x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) of TmpPoint4 matching (((Matching unit) has buff Fire_Circle_Buff) Egal à TRUE)) and do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
((Matching unit) is Un bâtiment) Egal à TRUE Fire_Circle_Damage_Building Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Une unité volante) Egal à TRUE Fire_Circle_Damage_Air Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Un héros) Egal à TRUE Fire_Circle_Damage_Heroes Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Mécanique) Egal à TRUE Fire_Circle_Damage_Mechanical Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Insensible à la magie) Egal à TRUE Fire_Circle_Damage_Immune Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
Alors - Actions
Set TmpPoint = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Fire_Circle_DestroyTrees Egal à TRUE
Alors - Actions
Destructible - Pick every destructible within (Fire_Circle_RoDTreesBase + (Fire_Circle_RoDTreesLevel x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) of TmpPoint4 and do (Actions)
Boucle - Actions
Set Fire_Circle_Destructable = (Picked destructible) Unité - Order Fire_Circle_TR to Récolter Fire_Circle_Destructable
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Current order of Fire_Circle_TR) Egal à (Order(harvest)) (Fire_Circle_Destructable is alive) Egal à TRUE
Alors - Actions
Set TmpPoint5 = (Position of Fire_Circle_Destructable) Effet spécial - Create a special effect at TmpPoint5 using Fire_Circle_SFX_Damage_Trees Effet spécial - Destroy (Last created special effect) Destructible - Kill Fire_Circle_Destructable
Sinon - Actions
Unité - Order Fire_Circle_TR to Arrêter
Sinon - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
Fire_Circle_Critical Egal à FALSE
Alors - Actions
Unité - Cause TmpDamageDealer to damage (Picked unit), dealing (Fire_Circle_Base_Damage + (Fire_Circle_Level_Damage x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) damage of attack type Fire_Circle_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using Fire_Circle_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Set TmpInt = ((Integer(Fire_Circle_CriticalChanceBase)) + ((Level of Fire_Circle_Ability for TmpDamageDealer) x (Integer(Fire_Circle_CriticalChanceLvl)))) Set TmpInt2 = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
TmpInt2 Inférieur ou égal à TmpInt
Alors - Actions
Unité - Cause TmpDamageDealer to damage (Picked unit), dealing ((Fire_Circle_Base_Damage + (Fire_Circle_Level_Damage x (Real((Level of Fire_Circle_Ability for TmpDamageDealer))))) x Fire_Circle_CriticalMultiplier) damage of attack type Fire_Circle_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using Fire_Circle_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Inscrit le: 11 Fév 2011 Messages: 2151 Sujets: 114 Spécialité en worldedit: Chasser le Dragon, puis l'exterminer proprement avec une petite cuillère et une poêle.
Posté le: 27/01/13 14:22 Sujet du message:
C'est moche !
Tu répétes 4 fois ces deux conditions par exemple :
Gui:
Trigger:
((Matching unit) belongs to an enemy of (Owner of (Load 0 of (Custom value of (Picked unit)) in Fire_Circle_Hashtable))) Egal à TRUE ((Matching unit) is alive) Egal à TRUE
Et y a pleins d'autres trucs qui sont répétés.
Après, ça bug quand la même unité lance deux fois le sort ? Normal, vu que tu sauvegardes tout sur l'unité (enfin son handle). Utilise plutôt l'handle d'un des trois dummys, voir les trois dummys qui sont gérés indépendamment. ça te simplifierais vraiment la vie, car là ça ressemble à de l'indexing avec une hashtable plus qu'à une hashtable.
Aussi, comment tu peux arriver à 5 TempPoint ? Faudra que tu m'expliques, car perso, j'ai jamais besoin de plus de deux, trois grand max.
Tu peux pas nous simplifier tout ça ? _________________
Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 27/01/13 15:29 Sujet du message:
C'est vrai que le Unit is alive et le Unit belong to an ennemy of player je peux les déplacer, mais comme c'est un or, il faut que je rajoute un and au début.
Ensuite je peux remove le TmpPoint après chaque groupe de destructible. Et remplacer l'handle par celle d'un dummy d'accord.
D'ailleurs je l'ai pas précisé mais le sort ne détruit pas les arbres non-plus.
Est-ce que si je stocke mon dummy dans une variable pour en attribuer la valeur et que je nullifie ma variable la valeur correspondante à mon unité change ? _________________
Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 04/02/13 19:35 Sujet du message:
Up, mon problème n'étant pas résolu.
J'ai finalement utilisé un integer pour m'assurer de ne pas avoir de problèmes avec l'handle du caster. Donc c'est du semi-hashtable/semi-indexing. Donc le déclencheur de dégât n'en inflige toujours pas et ne détruit pas non plus les arbres.
Le nouveau déclencheur:
Secret:
Gui:
Trigger:
Fire Circle Damage
Evénements
Temps - Every 1.00 seconds of game time
Conditions
Actions
For each (Integer FC_Count2) from 1 to FC_Count, do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
((Load 2 of FC_Count2 in FC_Hashtable) is alive) Egal à TRUE ((Load 4 of FC_Count2 in FC_Hashtable) is alive) Egal à TRUE ((Load 6 of FC_Count2 in FC_Hashtable) is alive) Egal à TRUE
Alors - Actions
Set TmpPoint2 = (Position of (Load 2 of FC_Count2 in FC_Hashtable))
Groupe unité - Pick every unit in (Units within (FC_RangeofDamageBase + (FC_RangeofDamageLevel x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) of TmpPoint2 matching (((Matching unit) has buff FC_Buff) Egal à TRUE)) and do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
((Matching unit) is alive) Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of FC_Count2 in FC_Hashtable))) Egal à TRUE Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
((Matching unit) is Un bâtiment) Egal à TRUE FC_Damage_Building Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Une unité volante) Egal à TRUE FC_Damage_Air Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Un héros) Egal à TRUE FC_Damage_Heroes Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Mécanique) Egal à TRUE FC_Damage_Mechanical Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Insensible à la magie) Egal à TRUE FC_Damage_Immune Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Une unité terrestre) Egal à TRUE FC_Damage_Ground Egal à TRUE
Alors - Actions
Set TmpPoint = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
FC_Critical Egal à FALSE
Alors - Actions
Unité - Cause (Load 0 of FC_Count2 in FC_Hashtable) to damage (Picked unit), dealing (FC_Base_Damage + (FC_Level_Damage x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) damage of attack type FC_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Set TmpInt = ((Integer(FC_CriticalChanceBase)) + ((Level of FC_Ability for (Load 0 of FC_Count2 in (Last created hashtable))) x (Integer(FC_CriticalChanceLvl)))) Set TmpInt2 = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
TmpInt2 Inférieur ou égal à TmpInt
Alors - Actions
Unité - Cause (Load 0 of FC_Count2 in (Last created hashtable)) to damage (Picked unit), dealing ((FC_Base_Damage + (FC_Level_Damage x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) x FC_CriticalMultiplier) damage of attack type FC_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Custom script: call RemoveLocation(udg_TmpPoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
FC_DestroyTrees Egal à TRUE
Alors - Actions
Destructible - Pick every destructible within (FC_RangeofDamageTreesBase + (FC_RangeofDamageTreesLevel x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in (Last created hashtable))))))) of TmpPoint2 and do (Actions)
Boucle - Actions
Set FC_Destructable = (Picked destructible) Unité - Order FC_TreeRemover to Récolter FC_Destructable
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Current order of FC_TreeRemover) Egal à (Order(harvest)) (FC_Destructable is alive) Egal à TRUE
Alors - Actions
Set TmpPoint = (Position of FC_Destructable) Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Trees Effet spécial - Destroy (Last created special effect) Destructible - Kill FC_Destructable Custom script: call RemoveLocation(udg_TmpPoint)
Sinon - Actions
Unité - Order FC_TreeRemover to Arrêter
Sinon - Actions
Sinon - Actions
Custom script: call RemoveLocation(udg_TmpPoint2) Set TmpPoint2 = (Position of (Load 4 of FC_Count2 in FC_Hashtable))
Groupe unité - Pick every unit in (Units within (FC_RangeofDamageBase + (FC_RangeofDamageLevel x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) of TmpPoint2 matching (((Matching unit) has buff FC_Buff) Egal à TRUE)) and do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
((Matching unit) is alive) Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of FC_Count2 in FC_Hashtable))) Egal à TRUE Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
((Matching unit) is Un bâtiment) Egal à TRUE FC_Damage_Building Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Une unité volante) Egal à TRUE FC_Damage_Air Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Un héros) Egal à TRUE FC_Damage_Heroes Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Mécanique) Egal à TRUE FC_Damage_Mechanical Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Insensible à la magie) Egal à TRUE FC_Damage_Immune Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Une unité terrestre) Egal à TRUE FC_Damage_Ground Egal à TRUE
Alors - Actions
Set TmpPoint = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
FC_Critical Egal à FALSE
Alors - Actions
Unité - Cause (Load 0 of FC_Count2 in FC_Hashtable) to damage (Picked unit), dealing (FC_Base_Damage + (FC_Level_Damage x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) damage of attack type FC_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Set TmpInt = ((Integer(FC_CriticalChanceBase)) + ((Level of FC_Ability for (Load 0 of FC_Count2 in (Last created hashtable))) x (Integer(FC_CriticalChanceLvl)))) Set TmpInt2 = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
TmpInt2 Inférieur ou égal à TmpInt
Alors - Actions
Unité - Cause (Load 0 of FC_Count2 in (Last created hashtable)) to damage (Picked unit), dealing ((FC_Base_Damage + (FC_Level_Damage x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) x FC_CriticalMultiplier) damage of attack type FC_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Custom script: call RemoveLocation(udg_TmpPoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
FC_DestroyTrees Egal à TRUE
Alors - Actions
Destructible - Pick every destructible within (FC_RangeofDamageTreesBase + (FC_RangeofDamageTreesLevel x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in (Last created hashtable))))))) of TmpPoint2 and do (Actions)
Boucle - Actions
Set FC_Destructable = (Picked destructible) Unité - Order FC_TreeRemover to Récolter FC_Destructable
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Current order of FC_TreeRemover) Egal à (Order(harvest)) (FC_Destructable is alive) Egal à TRUE
Alors - Actions
Set TmpPoint = (Position of FC_Destructable) Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Trees Effet spécial - Destroy (Last created special effect) Destructible - Kill FC_Destructable Custom script: call RemoveLocation(udg_TmpPoint)
Sinon - Actions
Unité - Order FC_TreeRemover to Arrêter
Sinon - Actions
Sinon - Actions
Custom script: call RemoveLocation(udg_TmpPoint2) Set TmpPoint2 = (Position of (Load 6 of FC_Count2 in FC_Hashtable)) Custom script: call RemoveLocation(udg_TmpPoint2)
Groupe unité - Pick every unit in (Units within (FC_RangeofDamageBase + (FC_RangeofDamageLevel x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) of TmpPoint2 matching (((Matching unit) has buff FC_Buff) Egal à TRUE)) and do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
((Matching unit) is alive) Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of FC_Count2 in FC_Hashtable))) Egal à TRUE Or - Any (Conditions) are true
Conditions
And - All (Conditions) are true
Conditions
((Matching unit) is Un bâtiment) Egal à TRUE FC_Damage_Building Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Une unité volante) Egal à TRUE FC_Damage_Air Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Un héros) Egal à TRUE FC_Damage_Heroes Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Mécanique) Egal à TRUE FC_Damage_Mechanical Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Insensible à la magie) Egal à TRUE FC_Damage_Immune Egal à TRUE
And - All (Conditions) are true
Conditions
((Matching unit) is Une unité terrestre) Egal à TRUE FC_Damage_Ground Egal à TRUE
Alors - Actions
Set TmpPoint = (Position of (Picked unit))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
FC_Critical Egal à FALSE
Alors - Actions
Unité - Cause (Load 0 of FC_Count2 in FC_Hashtable) to damage (Picked unit), dealing (FC_Base_Damage + (FC_Level_Damage x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) damage of attack type FC_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Set TmpInt = ((Integer(FC_CriticalChanceBase)) + ((Level of FC_Ability for (Load 0 of FC_Count2 in (Last created hashtable))) x (Integer(FC_CriticalChanceLvl)))) Set TmpInt2 = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
TmpInt2 Inférieur ou égal à TmpInt
Alors - Actions
Unité - Cause (Load 0 of FC_Count2 in (Last created hashtable)) to damage (Picked unit), dealing ((FC_Base_Damage + (FC_Level_Damage x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) x FC_CriticalMultiplier) damage of attack type FC_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Custom script: call RemoveLocation(udg_TmpPoint)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
FC_DestroyTrees Egal à TRUE
Alors - Actions
Destructible - Pick every destructible within (FC_RangeofDamageTreesBase + (FC_RangeofDamageTreesLevel x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in (Last created hashtable))))))) of TmpPoint2 and do (Actions)
Boucle - Actions
Set FC_Destructable = (Picked destructible) Unité - Order FC_TreeRemover to Récolter FC_Destructable
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Current order of FC_TreeRemover) Egal à (Order(harvest)) (FC_Destructable is alive) Egal à TRUE
Alors - Actions
Set TmpPoint = (Position of FC_Destructable) Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Trees Effet spécial - Destroy (Last created special effect) Destructible - Kill FC_Destructable Custom script: call RemoveLocation(udg_TmpPoint)
Sinon - Actions
Unité - Order FC_TreeRemover to Arrêter
Sinon - Actions
Sinon - Actions
Sinon - Actions
edit: Faudrait peut-être fix les And et les Hashtables. ça gêne vachement la vision(enfin la mienne en tout cas). _________________
Inscrit le: 21 Fév 2010 Messages: 1785 Sujets: 22 Spécialité en worldedit: La modestie Médailles: 1 (En savoir plus...)
Posté le: 08/02/13 20:42 Sujet du message:
Oui mais non.
Tu as un déclencheur à rallonge et tu répètes 50000 fois la même action dans des if/then/else. Ton déclo est vraiment illisible.
Il faut que tu apprennes à éviter de répéter tes actions aussi souvent.
Par exemple, lorsque tu infliges les criticals :
Secret:
Gui:
Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
FC_Critical Egal à FALSE
Alors - Actions
Unité - Cause (Load 0 of FC_Count2 in FC_Hashtable) to damage (Picked unit), dealing (FC_Base_Damage + (FC_Level_Damage x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) damage of attack type FC_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Set TmpInt = ((Integer(FC_CriticalChanceBase)) + ((Level of FC_Ability for (Load 0 of FC_Count2 in (Last created hashtable))) x (Integer(FC_CriticalChanceLvl)))) Set TmpInt2 = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
TmpInt2 Inférieur ou égal à TmpInt
Alors - Actions
Unité - Cause (Load 0 of FC_Count2 in (Last created hashtable)) to damage (Picked unit), dealing ((FC_Base_Damage + (FC_Level_Damage x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) x FC_CriticalMultiplier) damage of attack type FC_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Sinon - Actions
Tu me remplaces ça par ça :
Gui:
Trigger:
Set Damage = (FC_Base_Damage + (FC_Level_Damage x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable))))))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
FC_Critical Egal à TRUE
Alors - Actions
Set TmpInt = ((Integer(FC_CriticalChanceBase)) + ((Level of FC_Ability for (Load 0 of FC_Count2 in (Last created hashtable))) x (Integer(FC_CriticalChanceLvl)))) Set TmpInt2 = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
TmpInt2 Inférieur ou égal à TmpInt
Alors - Actions
Set Damage = (Damage x FC_CriticalMultiplier)
Sinon - Actions
Sinon - Actions
Unité - Cause (Load 0 of FC_Count2 in FC_Hashtable) to damage (Picked unit), dealing Damage damage of attack type FC_Damage_Type and damage type Normal Effet spécial - Create a special effect at TmpPoint using FC_SFX_Damage_Unit Effet spécial - Destroy (Last created special effect)
Et ce n'est qu'un exemple. Fais des réductions comme ça jusqu'à c'que tu n'aies plus qu'une seule fois les actions "Unit damage target", "Kill destructable", etc... dans tout ton déclencheur.
Et il vaut mieux avoir une variable pour les objets que tu manipules très souvent dans ton déclo. Une variable pour le caster, là, par exemple.
Après, je remarque que tu as aussi des boucles dans des boucles dans des boucles... Pourquoi les "Pick every destructible around TmpPoint2" sont à l'intérieur des "Pick every units in group"?
Inscrit le: 12 Nov 2011 Messages: 1062 Sujets: 107 Spécialité en worldedit: Inactif(Enfin presque) Médailles: 1 (En savoir plus...)
Posté le: 09/02/13 09:27 Sujet du message:
C'est bon j'ai réduit les boucles comme indiquées et:
=> Les arbres sont détruits [X]
=> Les unités subissent des dégâts [ ]
Donc j'ai regardé en mettant un icône au buff pour savoir si l'unité l'a ou pas et oui elle l'a mais ne subit pas de dégâts. _________________
Inscrit le: 21 Fév 2010 Messages: 1785 Sujets: 22 Spécialité en worldedit: La modestie Médailles: 1 (En savoir plus...)
Posté le: 09/02/13 10:57 Sujet du message:
C'est peut-être ça :
Secret:
Gui:
Trigger:
Groupe unité - Pick every unit in (Units within (FC_RangeofDamageBase + (FC_RangeofDamageLevel x (Real((Level of FC_Ability for (Load 0 of FC_Count2 in FC_Hashtable)))))) of TmpPoint2 matching (((Matching unit) has buff FC_Buff) Egal à TRUE)) and do (Actions)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
((Matching unit) is alive) Egal à TRUE ((Matching unit) belongs to an enemy of (Owner of (Load 0 of FC_Count2 in FC_Hashtable))) Egal à TRUE
Tu utilises "Matching unit" à un endroit où c'est déjà devenu "Picked unit".
Si ça suffit pas, montre nous ton bô déclencheur tout propre . _________________
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