Topic hỏi đáp về cách làm map | version 15

Thảo luận trong 'World Editor' bắt đầu bởi Tom_Kazansky, 2/9/12.

  1. whisky137

    whisky137 Dragon Quest

    Tham gia ngày:
    7/2/07
    Bài viết:
    1,318
    Bạn ơi, mình edit lại thế này chuẩn chưa, chạy thấy ngon lành rồi, ko biết còn leak gì ko :9cool_haha:
    Đại loại là mình tạo một khu vực riêng. Khi 1 Hero mua "vé" Devil Invation thì vào được khu vực đấy. Từ lúc đó game tạo ra bọn quái để farm. Sau 20s, Hero bị tống cổ về nhà.
    Mã:
    Invitation
        Events
            Unit - A unit Acquires an item
        Conditions
            (Item-type of (Item being manipulated)) Equal to Devil Invitation
            ((Triggering unit) is A Hero) Equal to True
        Actions
            Item - Remove (Item being manipulated)
            Unit - Move (Triggering unit) instantly to (Center of Devil Square <gen>)
            Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Devil Square <gen>) over 0.00 seconds
            Trigger - Turn on Devil Square <gen>
            Wait 20.00 seconds
            Unit - Move (Triggering unit) instantly to (Center of Revive zone <gen>)
            Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Revive zone <gen>) over 0.00 seconds
    

    Mã:
    Devil Square
        Events
            Time - Every 1.00 seconds of game time
        Conditions
        Actions
            Set UnitGroup_DevilSquare = (Units in Devil Square <gen> matching ((((Matching unit) belongs to an ally of Player 10 (Light Blue)) Equal to True) and (((Matching unit) is alive) Equal to True)))
            Set UnitGroup_Hero = (Units in Devil Square <gen> matching (((Matching unit) is A Hero) Equal to True))
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Number of units in UnitGroup_DevilSquare) Equal to 0
                Then - Actions
                    Unit - Create 12 Devil Earthbound Infernal for Player 10 (Light Blue) at (Center of Devil Square <gen>) facing Default building facing degrees
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Number of units in UnitGroup_Hero) Equal to 0
                Then - Actions
                    Trigger - Turn off (This trigger)
                Else - Actions
            Custom script:   call DestroyGroup( udg_UnitGroup_DevilSquare ) 
            Custom script:   call DestroyGroup( udg_UnitGroup_Hero ) 
    
     
  2. Ngoc LeO

    Ngoc LeO Mario & Luigi

    Tham gia ngày:
    23/7/06
    Bài viết:
    839
    Nơi ở:
    Nothing...
    Màu đỏ là leak,dùng một biến point nào để set thành (Center of Devil Square <gen>),sau đó remove point đó đi.
    Màu xanh là vẫn chưa MUI,nếu có nhiều hơn 1 Hero vào vùng đó thì sau 20 giây warIII sẽ không biết (Triggering unit) là ai để mà move ra khỏi cả.
    Bạn biết dùng MUI rồi chứ ?
     
  3. whisky137

    whisky137 Dragon Quest

    Tham gia ngày:
    7/2/07
    Bài viết:
    1,318
    Center of Devil Square là trung tâm của 1 Region mà cũng gây leak hả bạn. Zz. Nếu mình set là Random Point thì thế nào ? Vì một số trigger linh tinh khác mình có dùng random point mà.

    MUI là gì mình chưa biết, ngâm cứu thôi vậy :(
    Việc War3 ko biết đứa nào là triggering unit mình cũng có nghĩ tới. Vì rất có thể khi chơi đông người, 2 hoặc nhiều Hero có thể vào khu vực đó cùng lúc. Nhưng khi mình thử với nhiều Hero thì game vẫn move Hero vào đầu tiên trước, sau đó mới move Hero kia sau theo đúng time giới hạn của mỗi Hero. Ơn giời, nói chung chưa thấy trục trặc này xảy ra :D
    Điên với đống trigger với chả MUI này mất.
     
  4. Evil_Hunter

    Evil_Hunter Mario & Luigi

    Tham gia ngày:
    18/9/11
    Bài viết:
    786
    Nơi ở:
    Evil Forest
    Demo skill đầu đây
    http://www.mediafire.com/?t0iagw76v6dm6tt
    Tưởng skill kia khó, hóa ra làm nhanh :D
    Demo 2 luôn: http://www.mediafire.com/?610dodyh9hw5p89

    ^ Tham khảo
    Mã:
    Melee Initialization
        Events
        Conditions
        Actions
            Set point = (Random point in (Playable map area))
            Unit - Move (Triggering unit) instantly to point
            Custom script:   call RemoveLocation(udg_point)
    
     
    Chỉnh sửa cuối: 23/11/12
  5. Ngoc LeO

    Ngoc LeO Mario & Luigi

    Tham gia ngày:
    23/7/06
    Bài viết:
    839
    Nơi ở:
    Nothing...
    Cứ liên quan đến point dù random hay xác định sẵn thì vẫn cứ leak,nhớ nhé \m/
     
  6. Stork[gm]

    Stork[gm] Donkey Kong

    Tham gia ngày:
    29/5/09
    Bài viết:
    438
    Nơi ở:
    서울한국
    Làm thế nào để tạo weather effect xung quanh 1 con unit nào đó? Khi unit di chuyển thì weather effect cũng di chuyển theo? Làm theo MUI nhé, ai biết làm hộ vs :). Mình làm cả tuần nay vẫn ko đc :| À còn cái nữa, là ai cho mình bài hướng dẫn cụ thể về MUI đi, tỉ năm ko làm bh ko nhớ nữa
     
    Chỉnh sửa cuối: 24/11/12
  7. whisky137

    whisky137 Dragon Quest

    Tham gia ngày:
    7/2/07
    Bài viết:
    1,318
    Thảo nào hôm trước tạo trigger cho Hero chạy vào 1 vùng là tạo random unit trong vùng đó, đánh một lúc thấy hơi lag, cứ nghĩ là do nhiều xác unit quá :))
    Mà đến cái Position của Casting unit hay target unit vẫn dính leak thì nản thật :6cool_beat_shot:
     
  8. Meepolisk

    Meepolisk Donkey Kong

    Tham gia ngày:
    8/2/08
    Bài viết:
    336
    thưa các bác cho em hỏi, nguyên nhân của fatal error là vòng lặp vô tận hả :@)
     
  9. Tom_Kazansky

    Tom_Kazansky

    Tham gia ngày:
    28/12/06
    Bài viết:
    3,454
    Nơi ở:
    Hà Nội
    nếu đột nhiên War3 exit, ko báo lỗi gì cả => có thể do vòng lặp vô tận
    còn báo lỗi thì... nhiều cái, ví dụ: call Player(-1) (ko phải vòng lặp vô tận)
     
  10. LeoNguyen112

    LeoNguyen112 Dragon Quest

    Tham gia ngày:
    22/5/10
    Bài viết:
    1,438
    Nơi ở:
    TP.HCM
    MUI thì dùng Indexer là dễ nhất thôi, còn dùng system Indexer nào thì tùy, lên hive mà search.
     
  11. HKGH_TruyMenh

    HKGH_TruyMenh Youtube Master Race

    Tham gia ngày:
    15/11/12
    Bài viết:
    48
    Woa ngon.Tks.Để zo test.Mình còn nhiều ý tưởng spell lắm mà hok bik viết,mới học We hơn 2 tuần thôi,mà hay wa' ghiền rồi :4cool_beauty:

    - - - Updated - - -


    Ủa sao lag thành 2 cái thế kia,mà ko edit bài viết của mình đc nên double post 1 cái.Ai chỉ dùm edit bài kiểu j,hok thấy hiện chỗ nào edit.
    Evil_Hunter ơi cái Spell 1 làm chỗ 30% nhiễm độc đúng chưa mà lần nào ném độc cũng thấy dinh',sao ko xài cái j mà ...1 to 100 equal 30.
    Còn spell 2 có lúc xài mình lại bị mất 30% máu 2 lần liền và damage mình nói là damage/s cơ,đây nó damage có 1 lần lúc đầu.Cho hỏi cái chỗ set Point effect spell 2 cái số 380 để làm j nữa.
    Sr double post


    TOM: gửi đủ 50 bài mới có thể Edit
     
    Last edited by a moderator: 24/11/12
  12. Evil_Hunter

    Evil_Hunter Mario & Luigi

    Tham gia ngày:
    18/9/11
    Bài viết:
    786
    Nơi ở:
    Evil Forest
    Thì random percent cũng vậy thôi, random percent là từ 1-100 đấy,
    Spell 2 để xem lại...
    Mất máu 2 lần sao cho đc :|,xem lại xem
    Còn set point kia để màu mè cho đẹp thôi ý mà :D, bỏ cũng đc
    Nếu deal đmg theo s thì làm như skill 1 ấy, tạo một trigger với event là mỗi 0.1s, rồi tạo biến real, mỗi 0.1s set nó + thêm 0.1, rồi thêm lệnh if real equal to bao nhiêu thì deal dmg
     
    Chỉnh sửa cuối: 24/11/12
  13. Drakkar Knight

    Drakkar Knight Mr & Ms Pac-Man Lão Làng GVN

    Tham gia ngày:
    13/11/11
    Bài viết:
    269
    Nơi ở:
    Hà Nội
    Em ngại tạo nhiều trigger nên tích hợp hết các trigger ghép item thành 1 như thế này liệu có gây lag map không:

    Mã:
    Item Upgrades
        Events
            Unit - A unit Acquires an item
        Conditions
        Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Item-type of (Item being manipulated)) Equal to Upgrade Strength +10
                Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            ((Triggering unit) has an item of type Strength +5) Equal to True
                        Then - Actions
                            Item - Remove (Item carried by (Triggering unit) of type Strength +5)
                            Hero - Create Strength +10 and give it to (Triggering unit)
                            Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                            Special Effect - Destroy (Last created special effect)
                        Else - Actions
                            Hero - Create Upgrade Strength +10 and give it to (Triggering unit)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) has an item of type Strength +5) Equal to True
                    ((Triggering unit) has an item of type Upgrade Strength +10) Equal to True
                Then - Actions
                    Item - Remove (Item carried by (Triggering unit) of type Strength +5)
                    Item - Remove (Item carried by (Triggering unit) of type Upgrade Strength +10)
                    Hero - Create Strength +10 and give it to (Triggering unit)
                    Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Item-type of (Item being manipulated)) Equal to Upgrade Agility +10
                Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            ((Triggering unit) has an item of type Agility +5) Equal to True
                        Then - Actions
                            Item - Remove (Item carried by (Triggering unit) of type Agility +5)
                            Hero - Create Agility +10 and give it to (Triggering unit)
                            Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                            Special Effect - Destroy (Last created special effect)
                        Else - Actions
                            Hero - Create Upgrade Agility +10 and give it to (Triggering unit)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) has an item of type Agility +5) Equal to True
                    ((Triggering unit) has an item of type Upgrade Agility +10) Equal to True
                Then - Actions
                    Item - Remove (Item carried by (Triggering unit) of type Agility +5)
                    Item - Remove (Item carried by (Triggering unit) of type Upgrade Agility +10)
                    Hero - Create Agility +10 and give it to (Triggering unit)
                    Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Item-type of (Item being manipulated)) Equal to Upgrade Intelligence +10
                Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            ((Triggering unit) has an item of type Intelligence +5) Equal to True
                        Then - Actions
                            Item - Remove (Item carried by (Triggering unit) of type Intelligence +5)
                            Hero - Create Intelligence +10 and give it to (Triggering unit)
                            Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                            Special Effect - Destroy (Last created special effect)
                        Else - Actions
                            Hero - Create Upgrade Intelligence +10 and give it to (Triggering unit)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) has an item of type Intelligence +5) Equal to True
                    ((Triggering unit) has an item of type Upgrade Intelligence +10) Equal to True
                Then - Actions
                    Item - Remove (Item carried by (Triggering unit) of type Upgrade Intelligence +10)
                    Item - Remove (Item carried by (Triggering unit) of type Intelligence +5)
                    Hero - Create Intelligence +10 and give it to (Triggering unit)
                    Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Item-type of (Item being manipulated)) Equal to Upgrade All Attributes +10
                Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            ((Triggering unit) has an item of type All Attributes +5) Equal to True
                        Then - Actions
                            Item - Remove (Item carried by (Triggering unit) of type All Attributes +5)
                            Hero - Create All Attributes +10 and give it to (Triggering unit)
                            Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                            Special Effect - Destroy (Last created special effect)
                        Else - Actions
                            Hero - Create Upgrade All Attributes +10 and give it to (Triggering unit)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) has an item of type All Attributes +5) Equal to True
                    ((Triggering unit) has an item of type Upgrade All Attributes +10) Equal to True
                Then - Actions
                    Item - Remove (Item carried by (Triggering unit) of type All Attributes +5)
                    Item - Remove (Item carried by (Triggering unit) of type Upgrade All Attributes +10)
                    Hero - Create All Attributes +10 and give it to (Triggering unit)
                    Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Item-type of (Item being manipulated)) Equal to Upgrade Strength +15
                Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            ((Triggering unit) has an item of type Strength +10) Equal to True
                        Then - Actions
                            Item - Remove (Item carried by (Triggering unit) of type Strength +10)
                            Hero - Create Strength +15 and give it to (Triggering unit)
                            Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                            Special Effect - Destroy (Last created special effect)
                        Else - Actions
                            Hero - Create Upgrade Strength +15 and give it to (Triggering unit)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) has an item of type Strength +10) Equal to True
                    ((Triggering unit) has an item of type Upgrade Strength +15) Equal to True
                Then - Actions
                    Item - Remove (Item carried by (Triggering unit) of type Strength +10)
                    Item - Remove (Item carried by (Triggering unit) of type Upgrade Strength +15)
                    Hero - Create Strength +15 and give it to (Triggering unit)
                    Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Item-type of (Item being manipulated)) Equal to Upgrade Agility +15
                Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            ((Triggering unit) has an item of type Agility +10) Equal to True
                        Then - Actions
                            Item - Remove (Item carried by (Triggering unit) of type Agility +10)
                            Hero - Create Agility +15 and give it to (Triggering unit)
                            Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                            Special Effect - Destroy (Last created special effect)
                        Else - Actions
                            Hero - Create Upgrade Agility +15 and give it to (Triggering unit)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) has an item of type Agility +10) Equal to True
                    ((Triggering unit) has an item of type Upgrade Agility +15) Equal to True
                Then - Actions
                    Item - Remove (Item carried by (Triggering unit) of type Agility +10)
                    Item - Remove (Item carried by (Triggering unit) of type Upgrade Agility +15)
                    Hero - Create Agility +15 and give it to (Triggering unit)
                    Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Item-type of (Item being manipulated)) Equal to Upgrade Intelligence +15
                Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            ((Triggering unit) has an item of type Intelligence +10) Equal to True
                        Then - Actions
                            Item - Remove (Item carried by (Triggering unit) of type Intelligence +10)
                            Hero - Create Intelligence +15 and give it to (Triggering unit)
                            Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                            Special Effect - Destroy (Last created special effect)
                        Else - Actions
                            Hero - Create Upgrade Intelligence +15 and give it to (Triggering unit)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) has an item of type Intelligence +10) Equal to True
                    ((Triggering unit) has an item of type Upgrade Intelligence +15) Equal to True
                Then - Actions
                    Item - Remove (Item carried by (Triggering unit) of type Intelligence +10)
                    Item - Remove (Item carried by (Triggering unit) of type Upgrade Intelligence +15)
                    Hero - Create Intelligence +15 and give it to (Triggering unit)
                    Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Item-type of (Item being manipulated)) Equal to Upgrade Ring of Health
                Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            ((Triggering unit) has an item of type Ring of Regeneration) Equal to True
                        Then - Actions
                            Item - Remove (Item carried by (Triggering unit) of type Ring of Regeneration)
                            Hero - Create Ring of Health and give it to (Triggering unit)
                            Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                            Special Effect - Destroy (Last created special effect)
                        Else - Actions
                            Hero - Create Upgrade Void Stone and give it to (Triggering unit)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) has an item of type Ring of Regeneration) Equal to True
                    ((Triggering unit) has an item of type Upgrade Ring of Health) Equal to True
                Then - Actions
                    Item - Remove (Item carried by (Triggering unit) of type Ring of Regeneration)
                    Item - Remove (Item carried by (Triggering unit) of type Upgrade Ring of Health)
                    Hero - Create Ring of Health and give it to (Triggering unit)
                    Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    (Item-type of (Item being manipulated)) Equal to Upgrade Void Stone
                Then - Actions
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            ((Triggering unit) has an item of type Sobi Mask) Equal to True
                        Then - Actions
                            Item - Remove (Item carried by (Triggering unit) of type Sobi Mask)
                            Hero - Create Void Stone and give it to (Triggering unit)
                            Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                            Special Effect - Destroy (Last created special effect)
                        Else - Actions
                            Hero - Create Upgrade Void Stone and give it to (Triggering unit)
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    ((Triggering unit) has an item of type Sobi Mask) Equal to True
                    ((Triggering unit) has an item of type Upgrade Void Stone) Equal to True
                Then - Actions
                    Item - Remove (Item carried by (Triggering unit) of type Sobi Mask)
                    Item - Remove (Item carried by (Triggering unit) of type Upgrade Void Stone)
                    Hero - Create Void Stone and give it to (Triggering unit)
                    Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
                    Special Effect - Destroy (Last created special effect)
                Else - Actions
     
  14. Ngoc LeO

    Ngoc LeO Mario & Luigi

    Tham gia ngày:
    23/7/06
    Bài viết:
    839
    Nơi ở:
    Nothing...
    Mình khuyên bạn ngay từ lúc này hãy kiếm cho mình lấy 1 system repice để tránh rắc rối,vất vả về sau,còn 1 trigger nhiều code thì theo minh nghiệm của mình sẽ ko gây lag
     
  15. HKGH_TruyMenh

    HKGH_TruyMenh Youtube Master Race

    Tham gia ngày:
    15/11/12
    Bài viết:
    48
    Spell 2 mình test tầm 10 lần 2 lần bị mất máu 2 lần.Để mày mò làm thử.Mới bik nhìn và làm 2 kiểu 1 skill có Dummy với 1 skill có buff trên người thì spell hoạt động(vừa làm vừa nhìn lại mẫu :D).Mình còn nhiều ý tưởng spell lắm post lên Evil_Hunter làm giúp đc ko.Ý của mình nghĩ ra nên đọc vào Trig dễ hiểu rồi học dần.Cái Trig spell 1 có rút gọn được ko,thấy nó lặp lại mấy lần
     
  16. Evil_Hunter

    Evil_Hunter Mario & Luigi

    Tham gia ngày:
    18/9/11
    Bài viết:
    786
    Nơi ở:
    Evil Forest
  17. Drakkar Knight

    Drakkar Knight Mr & Ms Pac-Man Lão Làng GVN

    Tham gia ngày:
    13/11/11
    Bài viết:
    269
    Nơi ở:
    Hà Nội
    Em mới copy spells Demon Swap bên Hiveworkshop về, nhưng thỉnh thoảng nó lại bị lỗi thằng caster hoặc target cứ xoay đi xoay lại đến khi 1 thằng chết mới dừng lại. Các bác kiểm tra cái trigger cho em với:

    Mã:
    DeS Config
        Events
            Map initialization
        Conditions
        Actions
            -------- Is the caster alive?? --------
            Set DeS_Condition_Config[0] = True
            -------- Is the target alive?? --------
            Set DeS_Condition_Config[1] = True
            -------- The distance dividing integer --------
            Set DeS_Middle_Distance_Divider = 2
            -------- The speed of swapping places --------
            Set DeS_Swap_Speed = 15.00
            -------- The attachment of the special effect on the caster --------
            Set DeS_Attachment_1 = chest
            -------- The attachment of the special effect on the target --------
            Set DeS_Attachment_2 = chest
            -------- The model file of the special effect on caster --------
            Set DeS_Effect_Model_1 = Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
            -------- The model file of the special effect on target --------
            Set DeS_Effect_Model_2 = Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
            Set DeS_Spell = Fire Swap
    Mã:
    DeS Cast
        Events
            Unit - A unit Starts the effect of an ability
        Conditions
            (Ability being cast) Equal to DeS_Spell
        Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    DeS_Index_Listener Equal to 0
                Then - Actions
                    Trigger - Turn on DeS Loop <gen>
                Else - Actions
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                If - Conditions
                    DeS_Recycle_Size Greater than 0
                Then - Actions
                    Set DeS_Recycle_Size = (DeS_Recycle_Size - 1)
                    Set DeS_Current_Index = DeS_Recycle_Container[DeS_Recycle_Size]
                Else - Actions
                    Set DeS_Current_Index = DeS_Index_Size
                    Set DeS_Index_Size = (DeS_Index_Size + 1)
            Set DeS_Caster[DeS_Current_Index] = (Triggering unit)
            Set DeS_Target[DeS_Current_Index] = (Target unit of ability being cast)
            Set DeS_Caster_Point = (Position of DeS_Caster[DeS_Current_Index])
            Set DeS_Target_Point = (Position of DeS_Target[DeS_Current_Index])
            Set DeS_Start_Point = (Position of DeS_Caster[DeS_Current_Index])
            Set DeS_End_Point = (Position of DeS_Target[DeS_Current_Index])
            Set DeS_Middle_Distance[DeS_Current_Index] = ((Distance between DeS_Caster_Point and DeS_Target_Point) / (Real(DeS_Middle_Distance_Divider)))
            Set DeS_Middle_Point = (DeS_Caster_Point offset by DeS_Middle_Distance[DeS_Current_Index] towards (Angle from DeS_Caster_Point to DeS_Target_Point) degrees)
            Unit - Create 1 Dummy for (Owner of DeS_Caster[DeS_Current_Index]) at DeS_Middle_Point facing Default building facing degrees
            Set DeS_Middle_Unit[DeS_Current_Index] = (Last created unit)
            Special Effect - Create a special effect attached to the DeS_Attachment_1 of DeS_Caster[DeS_Current_Index] using DeS_Effect_Model_1
            Set DeS_Special_Effect_1[DeS_Current_Index] = (Last created special effect)
            Special Effect - Create a special effect attached to the DeS_Attachment_2 of DeS_Target[DeS_Current_Index] using DeS_Effect_Model_2
            Set DeS_Special_Effect_2[DeS_Current_Index] = (Last created special effect)
            Unit - Turn collision for DeS_Caster[DeS_Current_Index] Off
            Unit - Turn collision for DeS_Target[DeS_Current_Index] Off
            Custom script:   call RemoveLocation(udg_DeS_Caster_Point)
            Custom script:   call RemoveLocation(udg_DeS_Target_Point)
            Set DeS_Index_Container[DeS_Index_Listener] = DeS_Current_Index
            Set DeS_Index_Listener = (DeS_Index_Listener + 1)
    Mã:
    DeS Loop
        Events
            Time - Every 0.03 seconds of game time
        Conditions
        Actions
            For each (Integer DeS_Loop) from 0 to (DeS_Index_Listener - 1), do (Actions)
                Loop - Actions
                    Set DeS_Current_Index = DeS_Index_Container[DeS_Loop]
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            (DeS_Caster[DeS_Current_Index] is alive) Equal to DeS_Condition_Config[0]
                            (DeS_Target[DeS_Current_Index] is alive) Equal to DeS_Condition_Config[1]
                        Then - Actions
                            Set DeS_Caster_Point = (Position of DeS_Caster[DeS_Current_Index])
                            Set DeS_Target_Point = (Position of DeS_Target[DeS_Current_Index])
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                If - Conditions
                                    (Distance between DeS_Caster_Point and DeS_End_Point) Less than or equal to 50.00
                                    (Distance between DeS_Target_Point and DeS_Start_Point) Less than or equal to 50.00
                                Then - Actions
                                    Unit - Turn collision for DeS_Caster[DeS_Current_Index] On
                                    Unit - Turn collision for DeS_Target[DeS_Current_Index] On
                                    Special Effect - Destroy DeS_Special_Effect_1[DeS_Current_Index]
                                    Special Effect - Destroy DeS_Special_Effect_2[DeS_Current_Index]
                                    Set DeS_Index_Listener = (DeS_Index_Listener - 1)
                                    Set DeS_Index_Container[DeS_Loop] = DeS_Index_Container[DeS_Index_Listener]
                                    Set DeS_Recycle_Container[DeS_Current_Index] = DeS_Current_Index
                                    Set DeS_Recycle_Size = (DeS_Recycle_Size + 1)
                                    Set DeS_Loop = (DeS_Loop - 1)
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        If - Conditions
                                            DeS_Index_Listener Equal to 0
                                        Then - Actions
                                            Unit - Cause DeS_Caster[DeS_Current_Index] to damage DeS_Target[DeS_Current_Index], dealing (50.00 + (50.00 x (Real((Level of Fire Swap  for DeS_Caster[DeS_Current_Index]))))) damage of attack type Spells and damage type Normal
                                            Unit - Remove DeS_Middle_Unit[DeS_Current_Index] from the game
                                            Trigger - Turn off DeS Loop <gen>
                                        Else - Actions
                                Else - Actions
                                    Set DeS_Angle_1 = ((Angle from DeS_Middle_Point to DeS_Caster_Point) + DeS_Swap_Speed)
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        If - Conditions
                                            DeS_Angle_1 Greater than or equal to 359.00
                                        Then - Actions
                                            Set DeS_Angle_1 = 0.00
                                        Else - Actions
                                    Custom script:   call SetUnitX(udg_DeS_Caster[udg_DeS_Current_Index],GetUnitX(udg_DeS_Middle_Unit[udg_DeS_Current_Index]) + udg_DeS_Middle_Distance[udg_DeS_Current_Index] * Cos(udg_DeS_Angle_1 * bj_DEGTORAD))
                                    Custom script:   call SetUnitY(udg_DeS_Caster[udg_DeS_Current_Index],GetUnitY(udg_DeS_Middle_Unit[udg_DeS_Current_Index]) + udg_DeS_Middle_Distance[udg_DeS_Current_Index] * Sin(udg_DeS_Angle_1 * bj_DEGTORAD))
                                    Custom script:   call RemoveLocation(udg_DeS_Caster_Point)
                                    Set DeS_Angle_2 = ((Angle from DeS_Middle_Point to DeS_Target_Point) + DeS_Swap_Speed)
                                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        If - Conditions
                                            DeS_Angle_2 Greater than or equal to 359.00
                                        Then - Actions
                                            Set DeS_Angle_2 = 0.00
                                        Else - Actions
                                    Custom script:   call SetUnitX(udg_DeS_Target[udg_DeS_Current_Index],GetUnitX(udg_DeS_Middle_Unit[udg_DeS_Current_Index]) + udg_DeS_Middle_Distance[udg_DeS_Current_Index] * Cos(udg_DeS_Angle_2 * bj_DEGTORAD))
                                    Custom script:   call SetUnitY(udg_DeS_Target[udg_DeS_Current_Index],GetUnitY(udg_DeS_Middle_Unit[udg_DeS_Current_Index]) + udg_DeS_Middle_Distance[udg_DeS_Current_Index] * Sin(udg_DeS_Angle_2 * bj_DEGTORAD))
                                    Custom script:   call RemoveLocation(udg_DeS_Target_Point)
                        Else - Actions
                            Unit - Turn collision for DeS_Caster[DeS_Current_Index] On
                            Unit - Turn collision for DeS_Target[DeS_Current_Index] On
                            Special Effect - Destroy DeS_Special_Effect_1[DeS_Current_Index]
                            Special Effect - Destroy DeS_Special_Effect_2[DeS_Current_Index]
                            Set DeS_Index_Listener = (DeS_Index_Listener - 1)
                            Set DeS_Index_Container[DeS_Loop] = DeS_Index_Container[DeS_Index_Listener]
                            Set DeS_Recycle_Container[DeS_Current_Index] = DeS_Current_Index
                            Set DeS_Recycle_Size = (DeS_Recycle_Size + 1)
                            Set DeS_Loop = (DeS_Loop - 1)
                            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                If - Conditions
                                    DeS_Index_Listener Equal to 0
                                Then - Actions
                                    Unit - Remove DeS_Middle_Unit[DeS_Current_Index] from the game
                                    Trigger - Turn off DeS Loop <gen>
                                Else - Actions
     
  18. DylandKyo

    DylandKyo Donkey Kong

    Tham gia ngày:
    28/10/10
    Bài viết:
    358
    cho m` hỏi: Làm thế nào để disable 1 skill và khi sử dụng 1 skill khác thì skill đó mới enble đc.
    Vd: ban đầu skill b disable, sử dụng skill a thì enble skill b. Sau khi sử dụng skill b thì disable skill b (bằng jass càng tốt). Tks trước
     
  19. Drakkar Knight

    Drakkar Knight Mr & Ms Pac-Man Lão Làng GVN

    Tham gia ngày:
    13/11/11
    Bài viết:
    269
    Nơi ở:
    Hà Nội
    *QUOTE!

    *Cho em hỏi thêm câu nữa: Hôm trước em cài X Design Pack nhưng quên ko tắt cái Bkav đi, nó báo là có virus rồi diệt luôn. Giờ khi test map thì nó chạy thẳng vào war toàn màn hình (đoạn này em không biết miêu tả thế nào, hồi trước test map thì nó chạy cái war nhỏ nhỏ đấy). Cái này có phải là do bị diệt mất cái file đó không (Bkav của em là bản Pro nhá)?

    Hình file bị diệt đây:

    4.jpg
     
    Chỉnh sửa cuối: 24/11/12
  20. LeoNguyen112

    LeoNguyen112 Dragon Quest

    Tham gia ngày:
    22/5/10
    Bài viết:
    1,438
    Nơi ở:
    TP.HCM
    PHP:
    //===========================================================================
    function SetSpellAvailability takes nothing returns nothing
        
    if GetSpellAbilityId() == 'Atau' then
            call SetPlayerAbilityAvailable
    GetTriggerPlayer() , 'ACtc' true )
        endif
        
        if 
    GetSpellAbilityId() == 'ACtc' then
            call SetPlayerAbilityAvailable
    GetTriggerPlayer() , 'ACtc' false )
        endif
    endfunction

    function Init2 takes nothing returns nothing
        call SetPlayerAbilityAvailable
    GetEnumPlayer() , 'ACtc' false )
    endfunction

    function Init takes nothing returns nothing
        local trigger t 
    CreateTrigger()
        
    local force f GetPlayersAll()
            
        
    call ForForce, function Init2 )
        
    call DestroyForce(f)
        
    set f null
            
        call TriggerRegisterAnyUnitEventBJ
    EVENT_PLAYER_UNIT_SPELL_CAST )
        
    call TriggerAddAction, function SetSpellAvailability )
        
    set t null
    endfunction

    //===========================================================================
    function InitTrig_Test takes nothing returns nothing
        set gg_trg_Test 
    CreateTrigger(  )
        
    call TriggerRegisterTimerEventgg_trg_Test false )
        
    call TriggerAddActiongg_trg_Test, function Init )
    endfunction
    'Atau' = Taunt (Mountain Giant)
    'ACtc' = Slam (Neutral Hostle)

    Code trên MPI (Multi-Player Instantability), và đã remove leak (nhưng còn leak hay không thì không biết :-" )
     
    DylandKyo thích bài này.

Chia sẻ trang này