[Tutorial] - Slide, Chain Spells

mình mới sử dụng cách khác nhưng vẫn không được. Mình up map lên đây bạn xem sai chỗ nào và edit giúp mình nhé, thank.
http://www.mediafire.com/?zmjnomwtynt
vấn đề là khi dummy chạm vào unit thì dummy không boom( tức remove và thunder clap). Tiện thể cho hỏi cái này luôn, làm sao để spell dam ra xung quanh của demon hunter có tác dụng lên cả phe địch lẫn phe ta, lười mò trong WE quá.:P
thế có ai giúp mình cái này không, không hiểu sao không remove dummy và special effect được. Thank trước nhé :D
 
chẳng hiểu gì cả, bạn đã mở map của mình ra xem thử chưa mà đã phán một câu như thế :-w. nếu làm được thì edit gúp mình map phía trên rồi up lên, hoặc chỉ ra mình sai chổ nào và cách khắc phục để mình còn biết
pick unit sau rồi làm cái if Picked unit not equal to no unit then remove....
chẳng biết quăng vào đâu. :-w
 
Nếu các bác ngại down map thì em xin post triger lên vậy:
Triger 1
Mã:
Bomb
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Triggering unit)) Equal to Bomb
    Actions
        Set TempUnit = (Triggering unit)
        Set TempLoc = (Position of TempUnit)
        -------- 0 degree --------
        Unit - Create 1 Flame for (Owner of TempUnit) at TempLoc facing 0.00 degrees
        Unit - Add a ((Mana of (Triggering unit)) x 0.80) second Generic expiration timer to (Last created unit)
        Set SlideIndex = (SlideIndex + 1)
        Set SlideUnit[SlideIndex] = (Last created unit)
        Set SlideTick[SlideIndex] = ((Integer((Mana of (Triggering unit)))) x 20)
        Set SlideDistance[SlideIndex] = 10.00
        Set SlideAngle[SlideIndex] = 0.00
        Set SlideUnitPoint[SlideIndex] = (Position of SlideUnit[SlideIndex])
        Unit Group - Pick every unit in (Units in (Region centered at SlideUnitPoint[SlideIndex] with size (300.00, 300.00))) and do (Unit Group - Add (Picked unit) to FlameTarget[SlideIndex])
        -------- --- --------
        -------- 90 degree --------
        Unit - Create 1 Flame for (Owner of TempUnit) at TempLoc facing 90.00 degrees
        Unit - Add a ((Mana of (Triggering unit)) x 0.80) second Generic expiration timer to (Last created unit)
        Set SlideIndex = (SlideIndex + 1)
        Set SlideUnit[SlideIndex] = (Last created unit)
        Set SlideTick[SlideIndex] = ((Integer((Mana of (Triggering unit)))) x 20)
        Set SlideDistance[SlideIndex] = 10.00
        Set SlideAngle[SlideIndex] = 90.00
        Set SlideUnitPoint[SlideIndex] = (Position of SlideUnit[SlideIndex])
        Unit Group - Pick every unit in (Units in (Region centered at SlideUnitPoint[SlideIndex] with size (300.00, 300.00))) and do (Unit Group - Add (Picked unit) to FlameTarget[SlideIndex])
        -------- --- --------
        -------- 180 degree --------
        Unit - Create 1 Flame for (Owner of TempUnit) at TempLoc facing 180.00 degrees
        Unit - Add a ((Mana of (Triggering unit)) x 0.80) second Generic expiration timer to (Last created unit)
        Set SlideIndex = (SlideIndex + 1)
        Set SlideUnit[SlideIndex] = (Last created unit)
        Set SlideDistance[SlideIndex] = 10.00
        Set SlideTick[SlideIndex] = ((Integer((Mana of (Triggering unit)))) x 20)
        Set SlideAngle[SlideIndex] = 180.00
        Set SlideUnitPoint[SlideIndex] = (Position of SlideUnit[SlideIndex])
        Unit Group - Pick every unit in (Units in (Region centered at SlideUnitPoint[SlideIndex] with size (300.00, 300.00))) and do (Unit Group - Add (Picked unit) to FlameTarget[SlideIndex])
        -------- --- --------
        -------- 270 degree --------
        Unit - Create 1 Flame for (Owner of TempUnit) at TempLoc facing 270.00 degrees
        Unit - Add a ((Mana of (Triggering unit)) x 0.80) second Generic expiration timer to (Last created unit)
        Set SlideIndex = (SlideIndex + 1)
        Set SlideUnit[SlideIndex] = (Last created unit)
        Set SlideDistance[SlideIndex] = 10.00
        Set SlideTick[SlideIndex] = ((Integer((Mana of (Triggering unit)))) x 20)
        Set SlideAngle[SlideIndex] = 270.00
        Set SlideUnitPoint[SlideIndex] = (Position of SlideUnit[SlideIndex])
        Unit Group - Pick every unit in (Units in (Region centered at SlideUnitPoint[SlideIndex] with size (300.00, 300.00))) and do (Unit Group - Add (Picked unit) to FlameTarget[SlideIndex])
        -------- --- --------
        Custom script:   call RemoveLocation( udg_TempLoc )
Triger 2
Mã:
BombMove
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to SlideIndex, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        [B](SlideTick[(Integer A)] Equal to 0) or ((Number of units in FlameTarget[(Integer A)]) Greater than 0)[/B]
                    Then - Actions
                        Unit - Remove SlideUnit[(Integer A)] from the game
                        Special Effect - Create a special effect at SlideUnitPoint[(Integer A)] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                        For each (Integer B) from (Integer A) to (SlideIndex - 1), do (Actions)
                            Loop - Actions
                                Set FlameTarget[(Integer A)] = FlameTarget[((Integer A) + 1)]
                                Set SlideUnitPoint[(Integer A)] = SlideUnitPoint[((Integer A) + 1)]
                                Set SlideAngle[(Integer A)] = SlideAngle[((Integer A) + 1)]
                                Set SlideDistance[(Integer A)] = SlideDistance[((Integer A) + 1)]
                                Set SlideTick[(Integer A)] = SlideTick[((Integer A) + 1)]
                                Set SlideUnit[(Integer A)] = SlideUnit[((Integer A) + 1)]
                        Set SlideIndex = (SlideIndex - 1)
                    Else - Actions
                -------- ---------------- --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        SlideTick[(Integer A)] Greater than 0
                    Then - Actions
                        Set SlideUnitPoint[(Integer A)] = (Position of SlideUnit[(Integer A)])
                        Unit Group - Pick every unit in (Units in (Region centered at SlideUnitPoint[(Integer A)] with size (300.00, 300.00))) and do (Unit Group - Add (Picked unit) to FlameTarget[(Integer A)])
                        Set SlideTick[(Integer A)] = (SlideTick[(Integer A)] - 1)
                        Set TempLoc = (Position of SlideUnit[(Integer A)])
                        Set TempLoc2 = (TempLoc offset by SlideDistance[(Integer A)] towards SlideAngle[(Integer A)] degrees)
                        Unit - Move SlideUnit[(Integer A)] instantly to TempLoc2
                        Custom script:   call RemoveLocation( udg_TempLoc )
                        Custom script:   call RemoveLocation( udg_TempLoc2 )
                    Else - Actions
Lưu ý, trong map up ở trên em phần (SlideTick[(Integer A)] Equal to 0) or ((Number of units in FlameTarget[(Integer A)]) Greater than 0) em chưa edit lại để nguyên 2 thằng không nối bằng or, giờ edit lại vẫn thấy khi dummy chạm vào unit vẫn không boom, các bác giúp em phần này với. :D
 
Đọc mỏi cả mắt... :|
Theo như mình thấy 2 cái Trigger trên có dòng nào order unit boom đâu nhỉ :|
 
triger chia làm 4 phần, phần nào cũng giống hệt nhau, khác cái slideangel thôi. Chỉ cần đọc một cái thui. còn vụ bôm thì đơn giản chỉ là remove unit và effect thunder clap thôi (ý của em là làm cho 1 flame khi chạm vào unit thì remove flame đó, còn efect chỉ là cho đẹp thôi). Cái order boom thì trong dòng mau đỏ này này:
Mã:
BombMove
    Events
        Time - Every 0.04 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to SlideIndex, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (SlideTick[(Integer A)] Equal to 0) or ((Number of units in FlameTarget[(Integer A)]) Greater than 0)
                    Then - Actions
                        [COLOR="Red"]Unit - Remove SlideUnit[(Integer A)] from the game
                        Special Effect - Create a special effect at SlideUnitPoint[(Integer A)] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl[/COLOR]
                        For each (Integer B) from (Integer A) to (SlideIndex - 1), do (Actions)
                            Loop - Actions
                                Set FlameTarget[(Integer A)] = FlameTarget[((Integer A) + 1)]
                                Set SlideUnitPoint[(Integer A)] = SlideUnitPoint[((Integer A) + 1)]
                                Set SlideAngle[(Integer A)] = SlideAngle[((Integer A) + 1)]
                                Set SlideDistance[(Integer A)] = SlideDistance[((Integer A) + 1)]
                                Set SlideTick[(Integer A)] = SlideTick[((Integer A) + 1)]
                                Set SlideUnit[(Integer A)] = SlideUnit[((Integer A) + 1)]
                        Set SlideIndex = (SlideIndex - 1)
                    Else - Actions
                -------- ---------------- --------
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        SlideTick[(Integer A)] Greater than 0
                    Then - Actions
                        Set SlideUnitPoint[(Integer A)] = (Position of SlideUnit[(Integer A)])
                        Unit Group - Pick every unit in (Units in (Region centered at SlideUnitPoint[(Integer A)] with size (300.00, 300.00))) and do (Unit Group - Add (Picked unit) to FlameTarget[(Integer A)])
                        Set SlideTick[(Integer A)] = (SlideTick[(Integer A)] - 1)
                        Set TempLoc = (Position of SlideUnit[(Integer A)])
                        Set TempLoc2 = (TempLoc offset by SlideDistance[(Integer A)] towards SlideAngle[(Integer A)] degrees)
                        Unit - Move SlideUnit[(Integer A)] instantly to TempLoc2
                        Custom script:   call RemoveLocation( udg_TempLoc )
                        Custom script:   call RemoveLocation( udg_TempLoc2 )
                    Else - Actions
 
Cái này có lẽ sai về phần thuật toán:
Bạn để ý biến SlideTick lúc nào cũng > 0 (Do phần set ở Trigger 1 của bạn), vì vậy ở câu if thứ nhất của Trigger 2 chỉ cần xét điều kiện là số Unit trong FlameTarget có > 0 hay ko
--- Lúc cast spell ở chỗ ko người: số Unit trong FlameTarget = 0, và bạn chỉ add Unit vào FlameTarget lúc Flame mới xuất hiện mà thôi nên sau này Flame có đụng Unit nào thì Unit đó cũng ko đc add vào FlameTarget
--- Lúc cast spell giữa 1 đám quái: số Unit trong FlameTarget > 0, nhưng có 4 group FlameTarget khác nhau theo 4 chiều, và chỉ những Flame ở góc nào có số Unit trong FlameTarget > 0 mới boom và boom ngay sau khi tạo chứ ko slide.
Cách khắc phục: mình sẽ nói sau vì còn đang rối rắm với cái vụ array với MUI :D (gà mà).
Bạn yên tâm vì box còn nhiều pro lắm >:D<
 
Cái này có lẽ sai về phần thuật toán:
Bạn để ý biến SlideTick lúc nào cũng > 0 (Do phần set ở Trigger 1 của bạn), vì vậy ở câu if thứ nhất của Trigger 2 chỉ cần xét điều kiện là số Unit trong FlameTarget có > 0 hay ko
--- Lúc cast spell ở chỗ ko người: số Unit trong FlameTarget = 0, và bạn chỉ add Unit vào FlameTarget lúc Flame mới xuất hiện mà thôi nên sau này Flame có đụng Unit nào thì Unit đó cũng ko đc add vào FlameTarget
--- Lúc cast spell giữa 1 đám quái: số Unit trong FlameTarget > 0, nhưng có 4 group FlameTarget khác nhau theo 4 chiều, và chỉ những Flame ở góc nào có số Unit trong FlameTarget > 0 mới boom và boom ngay sau khi tạo chứ ko slide.
Cách khắc phục: mình sẽ nói sau vì còn đang rối rắm với cái vụ array với MUI :D (gà mà).
Bạn yên tâm vì box còn nhiều pro lắm >:D<

Phần slide tick không phải lúc nào cũng lớn hơn 0, vì slidetick ở đây là biến aray. theo mình nghĩ ở triger chỉ set slidetick >0, cho một biến slidetick[A] nào đó, khi sang triger 2 thì slidetick sẽ giảm đi, đến khi slidetick = 0 thì thay đổi giá trị slidetick[A] thành slidetick[A+1], nghĩa là slidetick[A+1] hoàn toàn khác slidetick[A], và khi triger 1 tiếp tục sset giá trị cho slidetick thì sẽ là set cho slidetick[A+1] chứ không còn là slidetick[A] nữa. Biến slidetick[A] sẽ không bị chép đè giá trị vào nên vẫn có trường hợp = 0.

Phần flametarget thì mỗi lần slide unit thì triger sẽ kiểm tra nếu > 0, thì boom, <= 0 thì pick unit xung quanh add vào flametarget. Sau đó vòng lại kiểm tra, cứ thế cho đến khi flametarget >0 hoặc slidetick = 0 thì boom. Theo lyù thuyết của mình thì là vậy, nhưng khi đưa vào triger thì không biết có sai hoặc đặt nhầm vị trí không mà vẫn không hoạt động
 
hic, không ai giúp em cái này àh. Em bí quá rồi mấy anh xem giúp em cái này đi.:((
 
Ở giữa 2 cái dòng màu đỏ là order đúng không, mà ở đằng sau lại có action move thì con dummy bị disable nên không nổ ra dam được(hình như thế;))).

Với lại create effect ko destroy đi thì leak đó. :|
 
chỉ remove unit thôi chứ không nổ dam, còn cái move thì hình như nằm phía dưới cách nhau bởi hai If chắc không ảnh hưởng gì đâu, nếu có thì bạn edit giùm mình nhé. cái leak thì chưa cần quan tâm, hoàn thành spell sẽ remove leak sau.
 
hic, không lẽ cả box WE này không ai giúp được mình sao, nản quá đi.
 
Thôi dc rồi, nói lai xem dummy là dummy nào. Cái trái bomb hay là 4 cục lửa?
 
dummy là 4 cục lửa ấy. :D. nó có dam độc sẵn rồi, giờ chỉ cần khi chạm unit khác remove nó và effect thôi. :D
 
sao mãi chẳng thấy anh ST trả lời nhỉ. Có bạn nào khác giúp mình cái này không.
 
Chắc là đằng ấy đã "bí" rồi =))
Vào test thì nó vẫn create effect bình thường, có gì đâu :|
Tôi chỉ thắc mắc sao ở đây dùng Integer B mà chẳng có gì liên quan đến Integer B :-??
Mã:
For each (Integer B) from (Integer A) to (SlideIndex - 1), do (Actions)
                            Loop - Actions
                                Set FlameTarget[(Integer A)] = FlameTarget[((Integer A) + 1)]
                                Set SlideUnitPoint[(Integer A)] = SlideUnitPoint[((Integer A) + 1)]
                                Set SlideAngle[(Integer A)] = SlideAngle[((Integer A) + 1)]
                                Set SlideDistance[(Integer A)] = SlideDistance[((Integer A) + 1)]
                                Set SlideTick[(Integer A)] = SlideTick[((Integer A) + 1)]
                                Set SlideUnit[(Integer A)] = SlideUnit[((Integer A) + 1)]
Xin nói rõ lại xem bạn muốn gì :|
 
Chắc là đằng ấy đã "bí" rồi =))
Vào test thì nó vẫn create effect bình thường, có gì đâu :|
Tôi chỉ thắc mắc sao ở đây dùng Integer B mà chẳng có gì liên quan đến Integer B :-??
Mã:
For each (Integer B) from (Integer A) to (SlideIndex - 1), do (Actions)
                            Loop - Actions
                                Set FlameTarget[(Integer A)] = FlameTarget[((Integer A) + 1)]
                                Set SlideUnitPoint[(Integer A)] = SlideUnitPoint[((Integer A) + 1)]
                                Set SlideAngle[(Integer A)] = SlideAngle[((Integer A) + 1)]
                                Set SlideDistance[(Integer A)] = SlideDistance[((Integer A) + 1)]
                                Set SlideTick[(Integer A)] = SlideTick[((Integer A) + 1)]
                                Set SlideUnit[(Integer A)] = SlideUnit[((Integer A) + 1)]
Xin nói rõ lại xem bạn muốn gì :|

Chả là tôi đang nghịch cái EGUI nên không hề động vào cái spell kia thôi :-j. Còn vụ gặp unit thì del nói thiệt tôi làm rất nhiều spell rồi đấy nhưng thấy kh6ong khaói nên đã del (có cái spell Iceberg).
Còn WE thì chắc chả biết gì về MUI nhỉ? Cái trên là tăng array để MUI đấy ông nội.
 
sao phải mất thời gian thế nhỉ, muốn đụng unit nào nó chết thì add cho nó Mine - exploding (Goblin Land Mine) (Activation Delay: 0.01, Invisible Transition Time: 1000, Cast Range: 100)
còn deal dmg lúc chết thì add AOE damage upon death chỉnh Damage, Area of Effet, Target Allowed là xong
 
Sao anh không trả lời từ đầu cho nó gọn nhỉ? Để 1 đống bài spam blah blah trên kia :-@
 
Có ý kiến như thế này, nếu phần damage tốt rồi thì cut cái trigger effect bỏ vào đấy luôn
Không thì làm như anh Tom hoặc gọn hơn là làm 1 trigger create effect khi unit die
ST lại quăng tạ nữa rồi :|
Chắc là đằng ấy đã "bí" rồi =))
Chữ "chắc" rành rành đấy =D>
Với lại đừng nghĩ là chỉ có mỗi mình cậu làm nhiều spell mà khoe đấy /:)
Còn WE thì chắc chả biết gì về MUI nhỉ? Cái trên là tăng array để MUI đấy ông nội.
Xúc phạm, nhầm 1 tí mà ghê dữ vậy, với lại tui MUI theo cách khác :-??
P/S: Anh Tom có avatar mới, hài quá =))
 
Back
Top