langthangbairac
T.E.T.Я.I.S
Theo mình thấy thì khá nhiều bạn sau khi tạo map thì phần random / chọn hero khá mắc cứng. Vậy nên mình tạo cái pic này hướng dẫn về vấn đề này như khi random thì hero trùng hoặc là random phải hero đã được chọn. Đó là do bạn chưa remove khoi nhà chọn hero hoặc chưa set đúng biến trong random hero.
Đầu tiên mình post trigger xong sẽ giải thích phương thưc s:
Phần hướng dẫn :
Cách thức hoạt động khá đơn giản, ai hiểu được bản chất của nó thì làm dẽ thôi
Thế này nhé : Khi -random, sẽ random 1 số từ 1 -> total_hero thì sẽ set Random_system[ Random_hero] thành số cuối cùng ( là total_hero )
Và total_hero sẽ trừ 1.
Cốt lõi chỉ đơn giản như vậy thôi
Xem demo map là hiểu ngay
Link epicwar
Hoặc bên dưới
Đầu tiên mình post trigger xong sẽ giải thích phương thưc s:
Mã:
System hero
Events
Time - Elapsed game time is 1.00 seconds
Conditions
Actions
Set Total_hero = 8
Set Random_system[1] = Paladin
Set Random_system[2] = Archmage
Set Random_system[3] = Mountain King
Set Random_system[4] = Blood Mage
Set Random_system[5] = Blademaster
Set Random_system[6] = Far Seer
Set Random_system[7] = Tauren Chieftain
Set Random_system[8] = Shadow Hunter
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player Group - Add (Picked player) to Players_hero
For each (Integer A) from 1 to 10, do (Actions)
Loop - Actions
Set Can_pick[(Integer A)] = True
Unit - Create 1 Zone Indicator (Custom Campaign) for (Player((Integer A))) at (Center of Chon hero <gen>) facing Default building facing degrees
Unit - Add a 120.00 second Generic expiration timer to (Last created unit)
Mã:
Make visi
Events
Unit - A unit Sells a unit
Conditions
((Sold unit) is A Hero) Equal to True
Actions
Player Group - Pick every player in Players_hero and do (Actions)
Loop - Actions
Player - Make (Unit-type of (Sold unit)) Unavailable for training/construction by (Picked player)
Set Can_pick[(Player number of (Owner of (Sold unit)))] = False
Selection - Select (Sold unit) for (Owner of (Sold unit))
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Sold unit)) Equal to Random_system[(Integer A)]
Then - Actions
Set Random_system[(Integer A)] = Random_system[Total_hero]
Set Total_hero = (Total_hero - 1)
Else - Actions
Mã:
Random hero
Events
Player - Player 1 (Red) types a chat message containing -random as An exact match
Conditions
Can_pick[(Player number of (Triggering player))] Equal to True
Actions
Set Random_Hero = (Random integer number between 1 and Total_hero)
Unit - Create 1 Random_system[Random_Hero] for (Triggering player) at (Center of Chon hero <gen>) facing Default building facing degrees
Camera - Pan camera for (Owner of (Last created unit)) to (Center of Chon hero <gen>) over 0.00 seconds
Selection - Select (Last created unit) for (Triggering player)
Player Group - Pick every player in Players_hero and do (Actions)
Loop - Actions
Player - Make (Unit-type of (Last created unit)) Unavailable for training/construction by (Picked player)
Set Random_system[Random_Hero] = Random_system[Total_hero]
Set Total_hero = (Total_hero - 1)
Set Can_pick[(Player number of (Triggering player))] = False
Phần hướng dẫn :
Cách thức hoạt động khá đơn giản, ai hiểu được bản chất của nó thì làm dẽ thôi

Thế này nhé : Khi -random, sẽ random 1 số từ 1 -> total_hero thì sẽ set Random_system[ Random_hero] thành số cuối cùng ( là total_hero )
Và total_hero sẽ trừ 1.
Cốt lõi chỉ đơn giản như vậy thôi
Xem demo map là hiểu ngay

Link epicwar
Hoặc bên dưới
Attachments
Chỉnh sửa cuối:
