online faq recherche accueil
 

Il y a 254 utilisateurs connus et inconnus. Pour voir la liste des connectés connus, cliquez ici

 Mot :   Pseudo :  
 
Bas de page
Auteur
 Sujet :

[Besoin d'aide]Variable région

 
n°4588724
evil-tediz
Posté le 30-03-2007 à 00:46:04  profilanswer
 

Salut! :)  
 
Je voudrais savoir si c'est possible de faire avec une variable de type région faire cela : Créer une unité pour région 1 à 3
 
J'espère que vous avec compris :) .
 
Merci d'avance !

n°4588726
Ayane
Posté le 30-03-2007 à 11:05:30  profilanswer
 

A l'initialisation:

Code :
  1. Set Reg[0] = Région 000 <gen>
  2.     Set Reg[1] = Région 001 <gen>
  3.     Set Reg[2] = Région 002 <gen>


 
Dans ton déclencheur:

Code :
  1. For each (Integer A) from 0 to 2, do (Actions)
  2.         Boucle - Actions
  3.             Set TmpPoint = (Center of Reg[(Integer A)])
  4.             Unité - Create 1 Fantassin for Joueur 1 (Rouge) at TmpPoint facing Orientation bâtiment par défaut degrees
  5.             Custom script:   call RemoveLocation( udg_TmpPoint )


---------------
http://acathla.com
http://worldedit.free.fr/
n°4588734
evil-tediz
Posté le 30-03-2007 à 18:24:06  profilanswer
 

Merci pour ta réponse !
 
Je voudrais savoir est-ce que je dois mettre

Code :
  1. Custom script:   call RemoveLocation( udg_TmpPoint )

à tous les fois que je fais une vague d'ennemi?
 
 
Edit:Qu'est-ce que c'est Set TmpPoint ?
 


Message édité par evil-tediz le 30-03-2007 à 18:46:21
n°4588736
Maximaxou
rejoignez les fidèles du JASS
Posté le 30-03-2007 à 19:02:51  profilanswer
 

TmpPoint c'est un point tempaire (une variable globale de type point)
 
Tu pourrais faire :

Code :
  1. For each (Integer A) from 0 to 2, do (Actions)
  2.         Boucle - Actions
  3.             Unité - Create 1 Fantassin for Joueur 1 (Rouge) at Center of Reg[(Integer A)] facing Orientation bâtiment par défaut degrees


Cela marcherait aussi bien mais créerait des fuites de mémoire ; en effet, Center of(<region> ) crée un point, et si tu ne le supprime pas (avec call RemoveLocation), il reste en mémoire. Et à chaque fois que tu feras Center of(<region> ) tu perdras un point. (qui restera en mémoire inutilement)


Message édité par Maximaxou le 30-03-2007 à 19:03:47

---------------
Dota c'est bien, le slide c'est encore mieux !
n°4588749
evil-tediz
Posté le 30-03-2007 à 22:28:08  profilanswer
 

Merci de m'avoir répondu cela m'a aidé grandement  :D
 
Edit: J'ai un problème les ennemis n'apparaissent que dans une région  :heink:


Message édité par evil-tediz le 30-03-2007 à 23:18:29
n°4588767
gro_shaman
Ah... World edit...
Posté le 31-03-2007 à 00:33:17  profilanswer
 

Je pense que tu n'as pas fait des variables à deploiement ( quand il y a un [] derriere une variable comme : Set Reg[0] = REGION). Pour faire une variable à deploiement il faut juste, au moment de sa creation, cocher déploiement.
ps : je suis pas sur que c'est ca ton erreur ^^.


---------------
http://www.acathla.com/
n°4588769
evil-tediz
Posté le 31-03-2007 à 02:42:59  profilanswer
 

oui , j'ai mit une variable à déploiement pour mes régions

n°4588772
gro_shaman
Ah... World edit...
Posté le 31-03-2007 à 10:54:59  profilanswer
 

Bah théoriquement ca devrait marcher la. Tu les as crées sur la map tes régions?


---------------
http://www.acathla.com/
n°4588774
Troll-Brai​n
http://worldedit.free.fr/forum
Posté le 31-03-2007 à 11:32:55  profilanswer
 

Poste tes déclencheurs


---------------
Je ne prends que sur rendez vous.
Assurez vous d'avoir un moyen de paiement conséquent, et de préférence en liquide, avant de me quémander la moindre question.
 
n°4588789
evil-tediz
Posté le 31-03-2007 à 20:19:33  profilanswer
 

Code :
  1. Setvariable
  2.     Evénements
  3.         Map initialization
  4.     Conditions
  5.     Actions
  6.         Set Nombre_de_vague = 20
  7.         Set Nombre_de_vie = 20
  8.         -------- Region --------
  9.         Set reg[1] = spawn1 <gen>
  10.         Set reg[2] = Spawn2 <gen>
  11.         Set reg[3] = Spawn 3 <gen>
  12.         -------- Goomba --------
  13.         Set Goomba[1] = Goomba(Lvl1)
  14.         Set Goomba[2] = Goomba(Lvl2)
  15.         Set Goomba[3] = Goomba(Lvl3)
  16.         Set Goomba[4] = Goomba(Lvl4)
  17.         Set Goomba[5] = Goomba(Lvl5)
  18.         Set Goomba[6] = Goomba(Lvl6)
  19.         Set Goomba[7] = Goomba(Lvl7)
  20.         Set Goomba[8] = Goomba(Lvl8)
  21.         Set Goomba[9] = Goomba(Lvl9)
  22.         Set Goomba[10] = Goomba(Lvl10)
  23.         Set Goomba[11] = Goomba(Lvl11)
  24.         Set Goomba[12] = Goomba(Lvl12)
  25.         Set Goomba[13] = Goomba(Lvl13)
  26.         Set Goomba[14] = Goomba(Lvl14)
  27.         Set Goomba[15] = Goomba(Lvl15)
  28.         Set Goomba[16] = Goomba(Lvl16)
  29.         Set Goomba[17] = Goomba(Lvl17)
  30.         Set Goomba[18] = Goomba(Lvl18)
  31.         Set Goomba[19] = Goomba(Lvl19)
  32.         Set Goomba[20] = Goomba(Lvl20)


 

Code :
  1. VagueDeGoomba
  2.     Evénements
  3.         Temps - Elapsed game time is 30.00 seconds
  4.     Conditions
  5.     Actions
  6.         For each (Integer A) from 1 to 3, do (Actions)
  7.             Boucle - Actions
  8.                 -------- Vague 1 --------
  9.                 Set TmpPoint = (Center of reg[(Integer A)])
  10.                 Unité - Create 10 Goomba[1] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  11.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  12.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  13.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  14.                 Wait 30.00 seconds
  15.                 -------- Vague 2 --------
  16.                 Set TmpPoint = (Center of reg[(Integer A)])
  17.                 Unité - Create 10 Goomba[2] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  18.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  19.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  20.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  21.                 Wait 30.00 seconds
  22.                 -------- Vague 3 --------
  23.                 Set TmpPoint = (Center of reg[(Integer A)])
  24.                 Unité - Create 10 Goomba[3] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  25.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  26.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  27.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  28.                 Wait 30.00 seconds
  29.                 -------- Vague 4 --------
  30.                 Unité - Create 10 Goomba[4] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  31.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  32.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  33.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  34.                 Wait 30.00 seconds
  35.                 -------- Vague 5 --------
  36.                 Set TmpPoint = (Center of reg[(Integer A)])
  37.                 Unité - Create 10 Goomba[5] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  38.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  39.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  40.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  41.                 Wait 30.00 seconds
  42.                 -------- Vague 6 --------
  43.                 Set TmpPoint = (Center of reg[(Integer A)])
  44.                 Unité - Create 10 Goomba[6] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  45.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  46.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  47.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  48.                 Wait 30.00 seconds
  49.                 -------- Vague 7 --------
  50.                 Set TmpPoint = (Center of reg[(Integer A)])
  51.                 Unité - Create 10 Goomba[7] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  52.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  53.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  54.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  55.                 Wait 30.00 seconds
  56.                 -------- Vague 8 --------
  57.                 Set TmpPoint = (Center of reg[(Integer A)])
  58.                 Unité - Create 10 Goomba[8] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  59.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  60.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  61.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  62.                 Wait 30.00 seconds
  63.                 -------- Vague 9 --------
  64.                 Set TmpPoint = (Center of reg[(Integer A)])
  65.                 Unité - Create 10 Goomba[9] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  66.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  67.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  68.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  69.                 Wait 30.00 seconds
  70.                 -------- Vague 10 --------
  71.                 Set TmpPoint = (Center of reg[(Integer A)])
  72.                 Unité - Create 10 Goomba[10] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  73.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  74.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  75.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  76.                 Wait 30.00 seconds
  77.                 -------- Vague 11 --------
  78.                 Set TmpPoint = (Center of reg[(Integer A)])
  79.                 Unité - Create 10 Goomba[11] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  80.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  81.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  82.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  83.                 Wait 30.00 seconds
  84.                 -------- Vague 12 --------
  85.                 Set TmpPoint = (Center of reg[(Integer A)])
  86.                 Unité - Create 10 Goomba[12] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  87.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  88.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  89.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  90.                 Wait 30.00 seconds
  91.                 -------- Vague 13 --------
  92.                 Set TmpPoint = (Center of reg[(Integer A)])
  93.                 Unité - Create 10 Goomba[13] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  94.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  95.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  96.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  97.                 Wait 30.00 seconds
  98.                 -------- Vague 14 --------
  99.                 Set TmpPoint = (Center of reg[(Integer A)])
  100.                 Unité - Create 10 Goomba[14] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  101.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  102.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  103.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  104.                 Wait 30.00 seconds
  105.                 -------- Vague 15 --------
  106.                 Set TmpPoint = (Center of reg[(Integer A)])
  107.                 Unité - Create 10 Goomba[15] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  108.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  109.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  110.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  111.                 Wait 30.00 seconds
  112.                 -------- Vague 16 --------
  113.                 Set TmpPoint = (Center of reg[(Integer A)])
  114.                 Unité - Create 10 Goomba[16] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  115.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  116.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  117.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  118.                 Wait 30.00 seconds
  119.                 -------- Vague 17 --------
  120.                 Set TmpPoint = (Center of reg[(Integer A)])
  121.                 Unité - Create 10 Goomba[17] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  122.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  123.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  124.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  125.                 Wait 30.00 seconds
  126.                 -------- Vague 18 --------
  127.                 Set TmpPoint = (Center of reg[(Integer A)])
  128.                 Unité - Create 10 Goomba[18] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  129.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  130.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  131.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  132.                 Wait 30.00 seconds
  133.                 -------- Vague 19 --------
  134.                 Set TmpPoint = (Center of reg[(Integer A)])
  135.                 Unité - Create 10 Goomba[19] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  136.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  137.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  138.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  139.                 Wait 30.00 seconds
  140.                 -------- Vague 20 --------
  141.                 Set TmpPoint = (Center of reg[(Integer A)])
  142.                 Unité - Create 10 Goomba[20] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  143.                 Set Nombre_de_vague = (Nombre_de_vague - 1)
  144.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  145.                 Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(Nombre_de_vague))
  146.                 Wait 30.00 seconds
  147.                 -------- Victory --------
  148.                 Partie - Display to (All players) the text: Vous avez gagné la...
  149.                 Wait 2.00 seconds
  150.                 Déclencheur - Run VictoryTrigger <gen> (checking conditions)


n°4588795
Ayane
Posté le 31-03-2007 à 21:00:07  profilanswer
 

Le problème ce sont tes Wait 30.00 seconds avec la boucle sur (Integer A)
(Integer A) est une variable globale, donc si tu en fais une autre pendant ce temps alors less valeurs de (Integer A) seront faussées.
De plus, avant de passer à la valeur suivante il te faudrait 20*30sec, sachant qu'en plus à la fin de la première execution de la boucle le joueur gagne la partie...
Donc ce serait plutot:

Code :
  1. VagueDeGoomba
  2.     Evénements
  3.         Temps - Every 30.00 seconds
  4.     Conditions
  5.     Actions
  6.         Set NumVague = (NumVague + 1)
  7.         For each (Integer A) from 1 to 3, do (Actions)
  8.             Boucle - Actions
  9.                 Set TmpPoint = (Center of reg[(Integer A)])
  10.                 Unité - Create 10 Goomba[NumVague] for Joueur 12 (Marron) at TmpPoint facing Orientation bâtiment par défaut degrees
  11.                 Custom script:   call RemoveLocation( udg_TmpPoint )
  12.         Multitable - Set the text for (Last created multiboard) item in column 2, row 1 to (String(NumVague))



---------------
http://acathla.com
http://worldedit.free.fr/
n°4588801
evil-tediz
Posté le 31-03-2007 à 23:01:07  profilanswer
 

Merci , cela fonctionne parfaitement   :D


Aller à :
Ajouter une réponse