Citation :
Le problème c'est que quand l'unité meurt elle revient avec le gun du debut et j'aimerais quel est la compétence que l'unité est rendu.
|
Heureusement que tu as mis des explications après, parceque là on comprend rien
!
Pour ton problème voilà une idée de code.
2 variables deploiement de type: unité(unit),capacité(capacite)
Ton unité ne doit avoir aucune compétence initialement.
Déclencheur 1
Citation :
Initialisation
Evénements
Map initialization
Conditions
Actions
For each (Integer A) from 1 to 10, do (Actions)
Boucle - Actions
Set Capacite[(Integer A)] = Abolir magie
Wait 0.10 seconds
For each (Integer A) from 1 to 10, do (Actions)
Boucle - Actions
Groupe unité - Pick every unit in (Units owned by (Player((Integer A))) of type Fantassin) and do (Actions)
Boucle - Actions
Set unit[(Integer A)] = (Picked unit)
Wait 0.10 seconds
For each (Integer A) from 1 to 10, do (Actions)
Boucle - Actions
Unité - Add Capacite[(Integer A)] to unit[(Integer A)]
|
Déclencheur 2
Citation :
Mort et CVAR
Evénements
Unité - A unit Meurt
Conditions
Actions
For each (Integer A) from 1 to 10, do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Killing unit) Egal à unit[(Integer A)]
Alors - Actions
Unité - Remove Capacite[(Integer A)] from unit[(Integer A)]
Set Capacite[(Integer A)] = Appel aux armes (Hôtel de ville)
Unité - Add Capacite[(Integer A)] to unit[(Integer A)]
Sinon - Actions
For each (Integer A) from 1 to 10, do (Actions)
Boucle - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si - Conditions
(Dying unit) Egal à unit[(Integer A)]
Alors - Actions
Unité - Create 1 Fantassin for (Player((Integer A))) at (Center of (Playable map area)) facing Orientation bâtiment par défaut degrees
Set unit[(Integer A)] = (Last created unit)
Unité - Add Capacite[(Integer A)] to unit[(Integer A)]
Sinon - Actions
|
Le code marche pour 2 compétences. Si tu en veux plus, il faut ajouter des conditions pour savoir quelle est la compétence actuelle. (et pouvoir ainsi incrémenter)
Note: le code n'a pas été testé.
De plus, il serait plus facile de créer différentes unités avec chacune une compétence différente plutôt que de vouloir changer les compétences d'un type unité. (c'est encore plus vrai quand tu as un paquet de compétences différentes)