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

Status
Không mở trả lời sau này.
Sr hỏi sai, làm sao để tạo 1 item ở trong shop khi mua cũng không cho gì hết ? Thanks nhìu.
 
khi mua không cho gì hết là sao, hay ý bạn là khi mua thì tăng Str, Agi, Int hay để chưng hok có tác dụng
 
^
^
ak` bạn biết Tome of Strength ko , nó đấy , xóa cái ability đi là nó ko + nữa .
p/s : mình có làm spell từ metamorphsis ( nôm na là hóa chaos) , chả hiểu sao spell này rất lỗi , vd mình lấy model normal lẫn alternate đều giống nhau , chỉ khác ở cái là alternate là nó sẫm hơn , thế mà lúc hóa lên nó delay 1 lúc lâu rồi màu sắc vẫn ko thay đổi , hết time thì nó trở về nó lại ở form alternate , thật là bó tay , có ai bị như vậy ko thì giúp mình sửa.
 
Chắc chỉnh nhầm form normal và form alternate chứ gì, thay ngược lại thử xem còn bị không :|
 
Tui cũng bị nè, con normal form biến lên con Alternate có màu đỏ, sau khi con alternate đó hết thời gian quay về bình thường vẫn màu đỏ lun:(
 
Làm theo như Leo, vậy trong map có bao nhiêu Hero thì phải set hết bấy nhiu à @@, item nữa chứ @@
Tất nhiên, không set thì biết item nào của agility, item nào của strength, cái gì cũng phải đăng kí thôi bạn ơi :|
 
Tuỳ vào đặc thù của map nữa đó. giống như của meomeo ấy, thì việc set system đó sẽ rất dễ dàng :|hơn 1 tí
Có ai biết vì sao Mal'Gannis trong Dday lúc nào hết dơi cũng về unit bộ mà không lơ lửng không? Làm xong con tướng cứ ây phơi phới vậy :(
 
Làm sao để xoá lightning effect đây, tạo bằng action create LE (advanced) của JNGP mà không có cách nào xoá được cả :| destroy, custom script cũng không xong.
 
Leo bữa nói đổi Type Armor = cách upgrade, tìm thấy cái dạng upgrade đổi armor rồi nhưng sao làm ko đc :(( Leo cho cái map demo lun nhá. Leo làm cái item Flame ArmorWater Armor, khi mạng Flame thì upgrade đổi wa armor Large Armor, còn Water thì đổi wa Medium Armor giúp nhá :D Thanks nhiều !
P/s: Còn cái đổi dame type ai biết chỉ hộ luôn.
 
Trong 1 trigger mình xài, khi mình gọi function này:
[Spoil]
Mã:
function Effect takes location Loc, unit Dummy returns nothing
    local real x1 = GetUnitX( Dummy )
    local real x1t = GetRandomReal( x1 - 100, x1 + 100 )
    local real y1 = GetUnitY( Dummy )
    local real y1t = GetRandomReal( y1 - 100, y1 + 100 )
    local real z1 = GetUnitFlyHeight( Dummy )
    local real z1t = GetRandomReal( z1 - 50, z1 + 50 )
    local real x2 = GetLocationX( Loc )
    local real y2 = GetLocationY( Loc )
    local lightning Light = AddLightningEx( "FORK", true, x1t, y1t, z1t, x2, y2, 0)
[B][COLOR="Red"]    call TriggerSleepAction(0.05)[/COLOR][/B]
    call DestroyLightningBJ( Light )
endfunction
[/Spoil]
toàn bộ action sau đó bị tê liệt, đã vậy Lighting Effect vẫn không bỏ được, có ai giúp với :(
P/S: mà hỏi thêm cái trên có leak không vậy ?
 
Chỉnh sửa cuối:
từ function nào mà gọi ra function đó?

và leak "Light" vì chưa destroy(như bạn nói) và chưa null (set Light = null)
 
[Spoil]
Mã:
effect
    Events
        Time - Every 0.50 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in TS_Group and do (Actions)
            Loop - Actions
                Set TS_TempInt = (Custom value of (Picked unit))
                Set TS_Count[TS_TempInt] = (TS_Count[TS_TempInt] - 1)
                Set TS_TLoc[TS_TempInt] = (TS_MLoc[TS_TempInt] offset by 200.00 towards 360.00 degrees)
                [B][COLOR="Red"]Custom script:   call Effect( udg_TS_TLoc[udg_TS_TempInt], GetEnumUnit() )[/COLOR][/B]
                Unit - Create 1 Ground Effect for Player 1 (Red) at TS_TLoc[TS_TempInt] facing Default building facing degrees
                Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                Custom script:   call RemoveLocation(udg_TS_TLoc[udg_TS_TempInt])
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        TS_Count[TS_TempInt] Equal to 0
                    Then - Actions
                        Unit Group - Remove (Picked unit) from TS_Group
                        Unit - Kill (Picked unit)
                        Custom script:   call RemoveLocation(udg_TS_MLoc[udg_TS_TempInt])
                    Else - Actions
[/Spoil]
Từ cái này đây, nếu bỏ cái dòng Sleep action thì nó chạy bình thường, nhưng Lightning Effect mất nhanh quá :(
 
bản thử dùng Custom script: call Effect.execute ( udg_TS_TLoc[udg_TS_TempInt], GetEnumUnit() ) xem có được không :)
 
không được dùng "wait" (TriggerSleepAction) trong Loop - Actions của Unit Group - Pick...

để giải quyết vụ này:
  • nếu bạn dùng JNGP: thì chỉ việc thêm .execute vào sau call Effect:

    [Spoil]
    Mã:
    effect
        Events
            Time - Every 0.50 seconds of game time
        Conditions
        Actions
            Unit Group - Pick every unit in TS_Group and do (Actions)
                Loop - Actions
                    Set TS_TempInt = (Custom value of (Picked unit))
                    Set TS_Count[TS_TempInt] = (TS_Count[TS_TempInt] - 1)
                    Set TS_TLoc[TS_TempInt] = (TS_MLoc[TS_TempInt] offset by 200.00 towards 360.00 degrees)
                    [B]Custom script:   call Effect[COLOR="Blue"].execute[/COLOR]( udg_TS_TLoc[udg_TS_TempInt], GetEnumUnit() )[/B]
                    Unit - Create 1 Ground Effect for Player 1 (Red) at TS_TLoc[TS_TempInt] facing Default building facing degrees
                    Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                    Custom script:   call RemoveLocation(udg_TS_TLoc[udg_TS_TempInt])
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            TS_Count[TS_TempInt] Equal to 0
                        Then - Actions
                            Unit Group - Remove (Picked unit) from TS_Group
                            Unit - Kill (Picked unit)
                            Custom script:   call RemoveLocation(udg_TS_MLoc[udg_TS_TempInt])
                        Else - Actions
    [/Spoil]

    các func đc gọi với ".execute" sẽ chạy ở một "thread" khác, nghĩa là sẽ chạy song song với func gọi nó (cái Loop - Actions), và chạy song song nên wait của func này sẽ ko ảnh hưởng tới func gọi nó (cái Loop - Actions ấy) nên Loop - Actions sẽ ko bị dừng.
  • Nếu không: tạo một trigger với các lệnh như trên, tuy nhiên phải thay đổi chút:

    [spoil]
    Mã:
    function Trig_DestroyLightWait_Actions takes nothing returns nothing
        local unit Dummy = udg_TempUnit
        local location Loc = udg_TS_TLoc[udg_TS_TempInt]
        local real x1 = GetUnitX( Dummy )
        local real x1t = GetRandomReal( x1 - 100, x1 + 100 )
        local real y1 = GetUnitY( Dummy )
        local real y1t = GetRandomReal( y1 - 100, y1 + 100 )
        local real z1 = GetUnitFlyHeight( Dummy )
        local real z1t = GetRandomReal( z1 - 50, z1 + 50 )
        local real x2 = GetLocationX( Loc )
        local real y2 = GetLocationY( Loc )
        local lightning Light = AddLightningEx( "FORK", true, x1t, y1t, z1t, x2, y2, 0)
        call TriggerSleepAction(0.05)
        call DestroyLightningBJ( Light )
        set Light = null
        set Dummy = null
        set Loc = null // chi la null chu ko la remove
    endfunction
    
    //===========================================================================
    function InitTrig_DestroyLightWait takes nothing returns nothing
        set gg_trg_DestroyLightWait = CreateTrigger(  )
        call TriggerAddAction( gg_trg_DestroyLightWait, function Trig_DestroyLightWait_Actions )
    endfunction
    [/spoil]

    trigger trên là gui convert ra jass, chú ý mấy dòng null
    ở trigger của bạn thì:

    [spoil]
    Mã:
    effect
        Events
            Time - Every 0.50 seconds of game time
        Conditions
        Actions
            Unit Group - Pick every unit in TS_Group and do (Actions)
                Loop - Actions
                    Set TS_TempInt = (Custom value of (Picked unit))
                    Set TS_Count[TS_TempInt] = (TS_Count[TS_TempInt] - 1)
                    Set TS_TLoc[TS_TempInt] = (TS_MLoc[TS_TempInt] offset by 200.00 towards 360.00 degrees)
                    [B][COLOR="Blue"]Set TempUnit = (Picked Unit)
                    Trigger - Run DestroyLightWait <gen> (ignoring conditions)[/COLOR][/B]
                    Unit - Create 1 Ground Effect for Player 1 (Red) at TS_TLoc[TS_TempInt] facing Default building facing degrees
                    Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
                    Custom script:   call RemoveLocation(udg_TS_TLoc[udg_TS_TempInt])
                    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        If - Conditions
                            TS_Count[TS_TempInt] Equal to 0
                        Then - Actions
                            Unit Group - Remove (Picked unit) from TS_Group
                            Unit - Kill (Picked unit)
                            Custom script:   call RemoveLocation(udg_TS_MLoc[udg_TS_TempInt])
                        Else - Actions
    [/spoil]

    Trigger được chạy với "Trigger - Run" sẽ chạy ở một "thread" khác, song song với Loop - Actions trên và ko ảnh hưởng tới cái Loop - Actions này và dĩ nhiên Loop - Actions ko bị dừng
 
Chỉnh sửa cuối:
:-s không được anh Kul ơi,syntax error, nó còn bắn ra khỏi loading screen nữa :(
P/s: Thx 2 bác, làm theo cách 2 đã được. Nhưng tại sao JNG của mình đã update nhưng lệnh execute đó nó không chạy được vậy ?
 
Chỉnh sửa cuối:
Mã:
Thunder Cloud Effect
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        For each (Integer A) from 1 to 50, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ThunderCloud_Unit[(Integer A)] Not equal to No unit
                    Then - Actions
                        Lightning - Destroy ThunderCloud_LE[(Integer A)]
                        Set TempPoint = (ThunderCloud_Point[(Integer A)] offset by (Random real number between 0.00 and 150.00) towards (Random angle) degrees)
                        Set ThunderCloud_X = (X of TempPoint)
                        Set ThunderCloud_Y = (Y of TempPoint)
                        Lightning - Create a Lightning Attack, Visible lightning effect from source (ThunderCloud_X,ThunderCloud_Y,500.00) to target (ThunderCloud_X,ThunderCloud_Y,0.00) 
                        Set ThunderCloud_LE[(Integer A)] = (Last created lightning effect)
                        Custom script:   call RemoveLocation(udg_TempPoint)
                    Else - Actions
Đây, trigger đây anh Tom giúp giùm em, tạo LE xong nó không xoá được :(
 
Status
Không mở trả lời sau này.
Back
Top