XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Академия: форум для вопросов> Jass
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Закрытая тема
 
16GB
GhostOne User
offline
Опыт: 60,317
Активность:
Помогите с Кодом
Вот пытался сделать гранату исправте плиз ошибок до кучи выдаёт
function Trig_Granade_Jass_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'h00N' ) ) then
        return false
    endif
    return true
endfunction

function damage takes nothing return nothing
local timer t=GetExpiredTimer()
local integer i = LoadIntegerHandle(udg_Hash,GetHandleId(t) , 1)
local texttag g = LoadTextTagHandle(udg_Hash,GetHandleId(t),2)
local unit u = LoadUnitHandle(udg_Hash,GetHandleId(t),0)
  call SetTextTagTextBJ( g, ( "|cffFF0000" + ( I2S(i) + "|r" ) ), 9.00 )
set i = i-1
if i<1 then

call DestroyTimer(t)
call FlushChildHashtableBJ( GetHandleIdBJ(u), udg_Hash )
call Kill(u)
else
call SaveIntegerHandle(udg_Hash,GetHandleBJ(t) , 1, i)
endif
set u = null
set t = null
endfunction

function Trig_Granade_Jass_Actions takes nothing returns nothing
local unit u=GetEnteringUnit()
local timer t=CreateTimer()
local integer i = 100
local texttag g = call CreateTextTagUnitBJ( "", u, 0, 9.00, 100, 100, 100, 0 )
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDus​t.mdl",GetUnitX(u),GetUnitY(u)))
call SaveTextTagHandle(udg_Hash,GetHandleId(t) , 2, g)
call SaveUnitHandle(udg_Hash,GetHandleId(t),0,u)
call SaveIntegerHandle(udg_Hash,GetHandleId(t) , 1, i)
call TimerStart(t,0.01,true,function damage)
set t=null
set u=null
endfunction

//===========================================================================
function InitTrig_Granade_Jass takes nothing returns nothing
    set gg_trg_Granade_Jass = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Granade_Jass, GetPlayableMapRect() )
    call TriggerAddCondition( gg_trg_Granade_Jass, Condition( function Trig_Granade_Jass_Conditions ) )
    call TriggerAddAction( gg_trg_Granade_Jass, function Trig_Granade_Jass_Actions )
endfunction

Отредактировано 16GB, 09.05.2010 в 10:50.
Старый 09.05.2010, 10:41
Sergarr

offline
Опыт: 4,677
Активность:
function Trig_Granade_Jass_Conditions takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetEnteringUnit()) == 'h00N' ) ) then
        return false
    endif
    return true
endfunction
это че, прямой перевод с гуи? xD
Старый 09.05.2010, 10:48
16GB
GhostOne User
offline
Опыт: 60,317
Активность:
это да
16GB добавил:
остальное не перевод с гуи
я просто джасс не знаю воще вот пытаюсь
так чё не так?
16GB добавил:
Поможет кто?
Старый 09.05.2010, 11:01
bobok1

offline
Опыт: 1,213
Активность:
Ору - SaveIntegerHandle(...), LoadIntegerHandle(...), Kill(u)
FlushChildHashtableBJ, SetTextTagTextBJ - FFFFFFFFFFUUUUUUUUUUUU~
GetHandleIdBJ(u) - лол
local texttag g = CreateTextTagUnitBJ( "", u, 0, 9.00, 100, 100, 100, 0 ) - тут без call
globals
hashtable udg_Hash = InitHashtable()
endglobals

function damage takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer i = LoadInteger(udg_Hash,GetHandleId(t) , 1)
local texttag g = LoadTextTagHandle(udg_Hash,GetHandleId(t),2)
local unit u = LoadUnitHandle(udg_Hash,GetHandleId(t),0)
  call SetTextTagTextBJ( g, ( "|cffFF0000" + ( I2S(i) + "|r" ) ), 9.00 )
set i = i-1
if i<1 then
call DestroyTimer(t)
call FlushChildHashtable(udg_Hash, GetHandleId(t) )
call KillUnit(u)
// else
// call SaveInteger(udg_Hash,GetHandleId(t) , 1, i) //Это еще зачем? О_О Число уже сохранилось.
endif
set u = null
set t = null
endfunction

function Trig_Granade_Jass_Actions takes nothing returns nothing
local unit u=GetEnteringUnit()
local timer t=CreateTimer()
local integer i = 100
local texttag g = CreateTextTagUnitBJ( "", u, 0, 9.00, 100, 100, 100, 0 )
if (GetUnitTypeId(u) == 'h00N') then
call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDus​?t.mdl",GetUnitX(u),GetUnitY(u)))
call SaveTextTagHandle(udg_Hash,GetHandleId(t) , 2, g)
call SaveUnitHandle(udg_Hash,GetHandleId(t),0,u)
call SaveInteger(udg_Hash,GetHandleId(t) , 1, i)
call TimerStart(t,0.01,true,function damage)
endif
set t=null
set u=null
endfunction

//===========================================================================
function InitTrig_Granade_Jass takes nothing returns nothing
    set gg_trg_Granade_Jass = CreateTrigger(  )
    call TriggerRegisterEnterRectSimple( gg_trg_Granade_Jass, GetPlayableMapRect() )
    call TriggerAddAction( gg_trg_Granade_Jass, function Trig_Granade_Jass_Actions )
endfunction
Старый 09.05.2010, 11:12
16GB
GhostOne User
offline
Опыт: 60,317
Активность:
обьясни чё не так было
16GB добавил:
я же говорю я в джаззе не шарю
Старый 09.05.2010, 11:16
bobok1

offline
Опыт: 1,213
Активность:
16GB:
обьясни чё не так было
Во первых - integer не handle (ору).
call SaveIntegerHandle(udg_Hash,GetHandleId(t) , 1, i) - до
call SaveInteger(udg_Hash,GetHandleId(t) , 1, i) - после
Во вторых - кривое обозначение в функции returns
function damage takes nothing return nothing - до
function damage takes nothing returns nothing - после
Во третьих - BJ-BJ (я оптимизировал чтоли? О_О)
Во четвертых - кривые название функции
call Kill(u) - до
call KillUnit(u) - после
И в пятых
local texttag g = call CreateTextTagUnitBJ( "", u, 0, 9.00, 100, 100, 100, 0 ) - до
local texttag g = CreateTextTagUnitBJ( "", u, 0, 9.00, 100, 100, 100, 0 ) - после (тут без call)
Старый 09.05.2010, 11:25
16GB
GhostOne User
offline
Опыт: 60,317
Активность:
всё спасиб буду учиться дальше
16GB добавил:
в моём стиле тупые ошибки
Старый 09.05.2010, 11:28
Закрытая тема

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 02:49.