Cần giúp cách làm thời tiết trong War3

Lord World

Youtube Master Race
Tham gia ngày
21/3/07
Bài viết
41
Reaction score
0
Tui muốn làm 1 cái thời tiết trong war3 nhưng mà nó không cố định, nó lúc thì mưa lúc thì nắng tùy theo random giờ. Chẳng hạn: từ 6h - 18h có thể có mưa và có nắng, từ 18h - 6h có thể có mưa và có ánh trăng. Đã thử làm theo kiểu trigger turn on / off trigger nhưng thấy nó dài quá, có cách nào tối ưu không ?
P/s: tui chưa bít rõ về Jass lắm nên xin các bro chỉ giúp cách làm bằng trigger được rồi. Cảm ơn các bro và pro nhiều
 
Cách của bạn có thể gọi là ngắn rồi bạn ạ! Bạn cứ làm theo GUI đi là được, không nhất thiết phải jass đâu!
 
Mã:
Day
    Events
        Game - The in-game time of day becomes Greater than or equal to 6.00
        Game - The in-game time of day becomes Less than or equal to 18.00
    Conditions
    Actions
        Set Random = (Random integer number between 1 and 2)
Mã:
Night
    Events
        Game - The in-game time of day becomes Less than or equal to 6.00
        Game - The in-game time of day becomes Greater than or equal to 18.00
    Conditions
    Actions
        Set Random = (Random integer number between 2 and 3)
Mã:
Weather
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        Environment - Remove Weather
        If (Random Equal to (==) 1) then do (Environment - Create at (Playable map area) the weather effect Rays Of Light) else do (Set Weather = (Last created weather effect))
        If (Random Equal to (==) 2) then do (Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)) else do (Set Weather = (Last created weather effect))
        If (Random Equal to (==) 3) then do (Environment - Create at (Playable map area) the weather effect Rays Of Moonlight) else do (Set Weather = (Last created weather effect))
        Environment - Turn Weather On
Làm như trên thì được nhưng sẽ không hay lắm vì thời tiết sẽ giật mỗi 5s :|. Muốn thêm bao nhiêu kiểu thời tiết thì thêm bấy nhiêu hàm if ở trigger Weather thôi.
 
cảm ơn bác đã giúp đỡ, cho tui hỏi là làm sao để xây hiệu ứng ảnh hưởng của thời tiết đó. VD: Với Weather là WIND (heavy) tui muốn movement speed of all unit xuống còn 50 % thì làm sao ?
 
Thêm 1 con unit giữa bản đồ có cái aura Wind dựa trên endurance aura chỗ speed điền -0.5(shift double click) phạm vi globals(999999)

Còn đổi thời tiết:

Every 1 giờ of game time

Action
set randomint = GetRandomInt(1,2)
if ( là ban ngày ) then
---if (randomint = 1) then -->tạo weather nắng
---else -->tạo weather mưa
---endif
else
---if (randomint = 1) then -->tạo weather moonlight
---else -->tạo weather mưa(tạo thêm unit trừ speed)
---endif
endif
 
Chỉnh sửa cuối:
Mã:
Day
    Events
        Game - The in-game time of day becomes Greater than or equal to 6.00
        Game - The in-game time of day becomes Less than or equal to 18.00
    Conditions
    Actions
        Set Random = (Random integer number between 1 and 2)
Mã:
Night
    Events
        Game - The in-game time of day becomes Less than or equal to 6.00
        Game - The in-game time of day becomes Greater than or equal to 18.00
    Conditions
    Actions
        Set Random = (Random integer number between 2 and 3)
Mã:
Weather
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        Environment - Remove Weather
        If (Random Equal to (==) 1) then do (Environment - Create at (Playable map area) the weather effect Rays Of Light) else do (Set Weather = (Last created weather effect))
        If (Random Equal to (==) 2) then do (Environment - Create at (Playable map area) the weather effect Ashenvale Rain (Heavy)) else do (Set Weather = (Last created weather effect))
        If (Random Equal to (==) 3) then do (Environment - Create at (Playable map area) the weather effect Rays Of Moonlight) else do (Set Weather = (Last created weather effect))
        Environment - Turn Weather On
Làm như trên thì được nhưng sẽ không hay lắm vì thời tiết sẽ giật mỗi 5s :|. Muốn thêm bao nhiêu kiểu thời tiết thì thêm bấy nhiêu hàm if ở trigger Weather thôi.

Bác cho e hỏi, e đã làm giống bác rồi, nhưng nó vẫn chỉ ra có 1 kiểu thời tiết là Ray of Light à
 
Back
Top