Topic hỏi đáp (tập 3) về cách làm map

Status
Không mở trả lời sau này.
Mã:
Untitled Trigger 001
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                TempReal Greater than 1.00
            Then - Actions
                Set TempReal = (TempReal - 1.00)
                Sound - Set Ambient Sounds to TempReal%
                Sound - Set Animation and Spell Sounds to TempReal%
                Sound - Set Combat Sounds to TempReal%
                Sound - Set Fire Sounds to TempReal%
                Sound - Set Music to TempReal%
                Sound - Set Unit Movement Sounds to TempReal%
                Sound - Set Unit Response Sounds to TempReal%
                Sound - Set User Interface Sounds to TempReal%
            Else - Actions
                Set TempReal = 100.00
                Sound - Set Ambient Sounds to TempReal%
                Sound - Set Animation and Spell Sounds to TempReal%
                Sound - Set Combat Sounds to TempReal%
                Sound - Set Fire Sounds to TempReal%
                Sound - Set Music to TempReal%
                Sound - Set Unit Movement Sounds to TempReal%
                Sound - Set Unit Response Sounds to TempReal%
                Sound - Set User Interface Sounds to TempReal%
                Trigger - Turn off (This trigger)

TempReal là 1 var real đặt sẵn là 100
theo trigger trên thì 1s nó giảm 1% tất cả các sound và music => 100s nó giảm hết rồi lại đặt tất cả từ đầu:-"



cái này là play sound=))


WE vốn mù JASS mà:))

Không phải trong map ấy rõ ràng không nghe music, không nghe âm thanh đánh nhau hay tiếng của hero mà play sound thì nghe rõ mồn một :@)
Mà hơi xúc phạm đấy, cái gì mà JASS lại đến nỗi "mù" hả, ta cũng biết làm vài spell JASS đấy chứ [..]
 
Mã:
library AdvancedItemSystem initializer Init    
// The_Witcher's
//
// <<advanced item system>>
//
// this system improves the warcraft III item engine
//
// if a unit gets an item which it already has it stacks
// in addition this works even if the inventory is full!!!
//
// if you double-right-click an item with charges it splits up
// and if you move a item onto an equal item and they are stackable they stack

// no Setup Part! don't touch anything

private struct data
unit u
item ite
integer index
real x
real y
endstruct

globals
    private data array DATAS
    private integer total = 0
    private hashtable h = InitHashtable()
    private timer tim = CreateTimer()
    private trigger trg = CreateTrigger(  )
endglobals

private function IsInventoryFull takes unit u returns boolean
    local integer i = 0
    loop
        exitwhen i == 6
        if UnitItemInSlot(u, i) == null then
            return false
        endif
        set i = i + 1
    endloop
    return true
endfunction

function ItemWalk takes nothing returns boolean
    local integer i = 0
    local unit u = GetTriggerUnit()
    local item ite = GetOrderTargetItem()
    local data dat
    if IsInventoryFull(u) and GetItemCharges(ite)!= 0 then
        loop
            exitwhen i > 5
            if GetItemTypeId(ite) == GetItemTypeId(UnitItemInSlot(u, i)) and UnitHasItem(u,ite)== false  then
                call IssuePointOrder( u, "move", GetItemX(ite),GetItemY(ite) )
                if LoadInteger(h,GetHandleId(u),0) == 0 then
                    set dat = data.create()
                    set DATAS[total] = dat
                    set dat.index = total
                    set total = total + 1
                    set dat.u = u
                    set dat.ite = ite
                    set dat.x = GetItemX(ite)
                    set dat.y = GetItemY(ite)
                    call SaveInteger(h,GetHandleId(u),0,dat)
                else                    
                    set dat = LoadInteger(h,GetHandleId(u),0)
                    set dat.u = u
                    set dat.ite = ite
                    set dat.x = GetItemX(ite)
                    set dat.y = GetItemY(ite)
                endif
                set i = 100
            endif
            set i = i + 1
        endloop
        set dat = LoadInteger(h,GetHandleId(u),0)
        if i < 10 and dat != 0 then
            set total = total - 1
            set DATAS[dat.index] = DATAS[total]
            set DATAS[dat.index].index = dat.index
            call FlushChildHashtable(h,GetHandleId(dat.u))
            call dat.destroy()
        endif
    endif
    set u = null
    set ite = null
    return false
endfunction

private function ItemStack takes nothing returns boolean
    local integer i = 0
    local integer id
    local item k
    local item m = GetManipulatedItem()
    local unit u = GetTriggerUnit()
    local integer ite = GetItemTypeId(m)
    local integer c = GetItemCharges(m)
    local integer it 
    if GetItemCharges(GetManipulatedItem()) > 0 then
        loop
            exitwhen i > 6
            set it = GetItemTypeId(UnitItemInSlot(u, i - 1))
            set k = UnitItemInSlot(u, i - 1)
            if ( ( it == ite ) and( m != k ) ) then
                call SetItemCharges( k,  GetItemCharges(k) + c  )
                call RemoveItem( m )
                set i = 10
            endif
            set i = i + 1
        endloop
    endif
    set k = null
    set m = null
    set u = null
    return false
endfunction

function ItemTake takes nothing returns nothing
    local real dx
    local real dy
    local item it
    local integer i
    local integer ii = 0
    local data dat
    loop
        exitwhen ii >= total
        set dat = DATAS[ii]
        set dx = GetItemX(dat.ite) - GetUnitX(dat.u)
        set dy = GetItemY(dat.ite) - GetUnitY(dat.u)
        if ( SquareRoot(dx * dx + dy * dy) < 100.00 ) and IsItemOwned(dat.ite) == false then
            set i = 0
            loop
                exitwhen i > 5
                set it = UnitItemInSlot(dat.u,i)
                if GetItemTypeId(dat.ite) == GetItemTypeId(it) then
                    set i = 5
                endif
                set i = i + 1
            endloop
            call SetItemCharges( it,  GetItemCharges(it) + GetItemCharges(dat.ite) )
            call RemoveItem( dat.ite )
            set total = total - 1
            set DATAS[ii] = DATAS[total]
            set DATAS[ii].index = ii
            call FlushChildHashtable(h,GetHandleId(dat.u))
            call dat.destroy()        
            call IssueImmediateOrder(dat.u,"stop")        
        endif
        set ii = ii + 1
    endloop
    set it = null
endfunction

private function ItemWalkAbort1 takes nothing returns boolean
    local data dat = LoadInteger(h,GetHandleId(GetTriggerUnit()),0)
    if dat != 0 and( GetOrderPointX() != dat.x  or  GetOrderPointY() != dat.y )then
        set total = total - 1
        set DATAS[dat.index] = DATAS[total]
        set DATAS[dat.index].index = dat.index
        call FlushChildHashtable(h,GetHandleId(dat.u))
        call dat.destroy()
    endif
    return false
endfunction

private function ItemWalkAbort2 takes nothing returns boolean
    local data dat = LoadInteger(h,GetHandleId(GetTriggerUnit()),0)
    if dat != 0 then
        set total = total - 1
        set DATAS[dat.index] = DATAS[total]
        set DATAS[dat.index].index = dat.index
        call FlushChildHashtable(h,GetHandleId(dat.u))
        call dat.destroy()
    endif
    return false
endfunction

function ItemSplit takes nothing returns boolean
    local integer i = GetItemCharges(GetOrderTargetItem())
    if GetIssuedOrderId() > 852001 and GetIssuedOrderId() < 852008 then
        if GetOrderTargetItem() == UnitItemInSlot(GetOrderedUnit(), GetIssuedOrderId()-852002) then
            if i > 1 then
                set i = i/2
                call SetItemCharges(GetOrderTargetItem(), GetItemCharges(GetOrderTargetItem()) - i)
                call DisableTrigger(trg)
                call UnitAddItemByIdSwapped(GetItemTypeId(GetOrderTargetItem()), GetTriggerUnit())
                call EnableTrigger(trg)
                call SetItemCharges(bj_lastCreatedItem, i)
            endif
        else
            if i > 0 and GetItemTypeId(GetOrderTargetItem()) == GetItemTypeId(UnitItemInSlot(GetOrderedUnit(), GetIssuedOrderId()-852002)) then
                call SetItemCharges(GetOrderTargetItem(), GetItemCharges(GetOrderTargetItem()) + GetItemCharges(UnitItemInSlot(GetOrderedUnit(), GetIssuedOrderId()-852002)))
                call RemoveItem(UnitItemInSlot(GetOrderedUnit(), GetIssuedOrderId()-852002))
            endif
        endif
    endif
    return false
endfunction

private function Init takes nothing returns nothing
local trigger a = CreateTrigger(  )
local trigger b = CreateTrigger(  )
local trigger c = CreateTrigger(  )

call TimerStart( tim, 0.05, true, function ItemTake )

call TriggerRegisterAnyUnitEventBJ( a, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
call TriggerAddCondition( a, Condition( function ItemWalkAbort1 ) )

call TriggerRegisterAnyUnitEventBJ( b, EVENT_PLAYER_UNIT_ISSUED_ORDER )
call TriggerAddCondition( a, Condition( function ItemWalkAbort2 ) )

call TriggerRegisterAnyUnitEventBJ( c, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
call TriggerAddCondition( c, Condition( function ItemWalk ) )
call TriggerAddCondition( c, Condition( function ItemSplit ) )

call TriggerRegisterAnyUnitEventBJ( trg, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( trg, Condition( function ItemStack ) )
endfunction

endlibrary

bi lỗi gì vậy:((test maps ng ta thi dc, copy thì ko chịu zo=((xài newgen lun:((khi xóa 1 chữ và chỉnh lại thì maps ng ta cũng ko zo lun:Dbác nào bit fix chỉ đệ tử cái
attachment.php
 

Attachments

  • BagSystem.rar
    BagSystem.rar
    25.6 KB · Đọc: 3
  • Untitled.jpg
    Untitled.jpg
    123.1 KB · Đọc: 84
Nói rõ hơn đi, hoặc post cả map lên :">

Hiểu!

attachment.php


Hỏi thêm phát, đã up 1.24b chưa, có hiệu lực UMSWE không ?

Lỗi này nghĩa là chưa up 1.24 rùi, vì nó không có native GetHandleId với type hashtable
 
bi lỗi gì vậy:((test maps ng ta thi dc, copy thì ko chịu zo=((xài newgen lun:((khi xóa 1 chữ và chỉnh lại thì maps ng ta cũng ko zo lun:Dbác nào bit fix chỉ đệ tử cái
attachment.php

Up cái map mà bị lỗi ấy, up map kô bị lỗi tác dụng gì :-<.
 
tại sao maps gốc cho zo, mà maps copy or edit ko cho zo test

----- merge ------- >:)

Up cái map mà bị lỗi ấy, up map kô bị lỗi tác dụng gì :-<.

bên trong có 2 cái system; cái nào cũng bị lỗi ko tét dc
JASS ép đồ thì ko quan trọng,tui có auto GUI rùi
 

Attachments

Không phải trong map ấy rõ ràng không nghe music, không nghe âm thanh đánh nhau hay tiếng của hero mà play sound thì nghe rõ mồn một :@)

Sound Editor (F5) -> click chuột phải vào sound cần chọn -> User As Sound -> click đúp vào sound đó -> chỉnh channel
nói đến đây chắc hiểu rồi chứ:>

mà đúng là anh em box WE ít khi động vào sound thật:(

Mà hơi xúc phạm đấy, cái gì mà JASS lại đến nỗi "mù" hả, ta cũng biết làm vài spell JASS đấy chứ [..]

tưởng cậu vẫn như ngày xưa=))
 
bên trong có 2 cái system; cái nào cũng bị lỗi ko tét dc
JASS ép đồ thì ko quan trọng,tui có auto GUI rùi

to_Kingwar2010: Cái map bạn gửi ổn 100%, xem lại World Editor của bạn đi, có thể bạn sẽ phải lùi về 1.24b đó!
 
Bác Tom ơi? sao em edit con priest này vô WE bị lỗi out ra vậy?
pác tìm cách khắc phục giúp với
http://www.mediafire.com/?vly3uym0iyz
=((

Lỗi WE văng ra nhiều vô kể!

- Map Corrupt ( ở đây database của map có vấn đề, cụ thể là map không thể tìm thấy code trong GUI => chuyển qua JASS lại thoát :D )

- Model gây error => thử dùng WinMPQ xóa tiêu cái model đó ra khỏi map

Tại sao model gây corrupt??

+ Vì trong quá trình sửa bằng War3 Model Editor bạn xóa animation một cách không cẩn thận!

Map bị dính virus =)), cái này ngày xưa gặp nhiều, hùi đó tập tành cracker nên máy dính khá nhiều vai rớt => Format cài lại win

Thế là quá đủ! :-"
 
Lỗi WE văng ra nhiều vô kể!

- Map Corrupt ( ở đây database của map có vấn đề, cụ thể là map không thể tìm thấy code trong GUI => chuyển qua JASS lại thoát :D )

- Model gây error => thử dùng WinMPQ xóa tiêu cái model đó ra khỏi map

Tại sao model gây corrupt??

+ Vì trong quá trình sửa bằng War3 Model Editor bạn xóa animation một cách không cẩn thận!

Map bị dính virus =)), cái này ngày xưa gặp nhiều, hùi đó tập tành cracker nên máy dính khá nhiều vai rớt => Format cài lại win

Thế là quá đủ! :-"
Xóa ko cẩn thận hả:-oMình xóa an toàn rùi(đã test = cách ẽ file trong mpq của bz ra chỉ sữ 1 chi tiết nhỏ cũng ko sử dụng đc:(()
Hay là bạn fix or xoa cay vk + cái túi của con priest dùm mình đi:-*
 
Xóa ko cẩn thận hả:-oMình xóa an toàn rùi(đã test = cách ẽ file trong mpq của bz ra chỉ sữ 1 chi tiết nhỏ cũng ko sử dụng đc:(()
Hay là bạn fix or xoa cay vk + cái túi của con priest ( không hiểu lắm ) dùm mình đi:-*

Post lại bài khác xem cái, lỗi chính tả nhiều làm tui đọc chả hỉu rì cả :|

Thực ra gợi ý trên kia là quá đủ rùi, lấy WinMPQ ra lục lại map xem, nó báo lỗi thiếu code nào thì xóa bớt cái đó đi xong vào WE mở thử

Ngày xưa mình còn gặp nhiều lỗi nát bươm cả map ra mà còn phải một mình xử lý đó, chả biết hỏi ai luôn :-j
 
bác YAN giúp em làm dùm cái trigger kill radian trong dota đi em cũng theo ý bác tự tìm hiểu khổ nổi tốn 6 tiếng công cốc bí quá mới nhờ bác thôi, bác làm dùm em nha thank:)
 
Post lại bài khác xem cái, lỗi chính tả nhiều làm tui đọc chả hỉu rì cả :|

Thực ra gợi ý trên kia là quá đủ rùi, lấy WinMPQ ra lục lại map xem, nó báo lỗi thiếu code nào thì xóa bớt cái đó đi xong vào WE mở thử

Ngày xưa mình còn gặp nhiều lỗi nát bươm cả map ra mà còn phải một mình xử lý đó, chả biết hỏi ai luôn :-j

Mã:
Xóa ko cẩn thận hả:-oMình xóa an toàn rùi(đã test = cách export file trong mpq của blizzard ra chỉ sữa 1 chi tiết nhỏ cũng ko sử dụng đc)
Hay là bạn fix or làm giúp mình con priest (bơm máu) xóa cây vũ khí + cái tui bên hông đi

Àh mà này-bạn down file về chưa mà toàn nói map ko vậy:-w
http://www.mediafire.com/?vly3uym0iyz
link mình đưa ở trên là mdx của con priest đã edit nhưng ko xài đc:((
 
Cho mình hỏi cái Blend Time trong Magos Model Editor có tác dụng gì, như kiểu là khoảng thời gian xuất hiện rùi biến mất nhất định :|
 
Status
Không mở trả lời sau này.
Back
Top