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

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

Закрытая тема
 
Vulpes
Я жажду мёртвых овощей!%)
offline
Опыт: 639
Активность:
Заносы
В общем, есть юнит, который довольно быстро бегает. При сворачивании с траектории движения юнита должен, словно машина на большой скорости на повороте, должно "заносить". Подобное видел в карте "Hungry hungry feellhound".
Прошу помочь. Как это реализовать?
Старый 07.11.2009, 17:36
16GB
GhostOne User
offline
Опыт: 60,317
Активность:
Это делается без триггеров в РО. Как то случайно получилось.
Найду мапу кину!
Старый 07.11.2009, 17:42
Vulpes
Я жажду мёртвых овощей!%)
offline
Опыт: 639
Активность:
Найди, пожалуйста. Буду признателен.
Старый 07.11.2009, 17:48
SpiritWolf
Зеленый
offline
Опыт: 20,954
Активность:
Vulpes, сделай там где скорость поворота число - 5 или больше
Старый 07.11.2009, 17:49
Vulpes
Я жажду мёртвых овощей!%)
offline
Опыт: 639
Активность:
Headkillerboy, не получается. Минимальное значение 0.10
Старый 07.11.2009, 18:00
Tooy

offline
Опыт: 1,231
Активность:
Headkillerboy, Со скоростью поворота >3 или <0.10 юнит будет крутиться со стандартной скоростью.
Vulpes, shift+enter и можешь писать любые значения.
Старый 07.11.2009, 18:19
Vulpes
Я жажду мёртвых овощей!%)
offline
Опыт: 639
Активность:
Tooy, спасибо за шифт+энтер.
Но с отрицательным значением всё равно не получается. Видимо, что-то другое нужно юзать.
Мне же нужно что бы юнит не просто крутился, а его "заносило" как машину на крутом повороте, или как собачку в карте "hungry hungry fellhound"
Старый 07.11.2009, 18:23
BK.Jugg
террорист из КиП
offline
Опыт: 27,066
Активность:
Vulpes, щас посмотрю как там сделано.
Старый 07.11.2009, 18:38
Vulpes
Я жажду мёртвых овощей!%)
offline
Опыт: 639
Активность:
Перепробовал в РО всё, ничто нужного эффекта не даёт...
Старый 07.11.2009, 19:03
BK.Jugg
террорист из КиП
offline
Опыт: 27,066
Активность:
Vulpes, сделано не в РО, а на жассе.
Создаются три переменные, все real и массивы.
Код:
function Trig_Demon_Movement_Func001Func001C takes nothing returns boolean
    if ( not ( ModuloInteger(GetTriggerExecCount(GetTriggeringTrigger()), 20) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Demon_Movement_Func001Func005C takes nothing returns boolean
    if ( not ( GetLocationX(udg_pntTemp) < GetLocationX(udg_pntTemp2) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Demon_Movement_Func001Func006C takes nothing returns boolean
    if ( not ( GetLocationY(udg_pntTemp) < GetLocationY(udg_pntTemp2) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Demon_Movement_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = udg_intNumberOfActiveDemons
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_Demon_Movement_Func001Func001C() ) then
            set udg_reaDemonsAcceleration[GetForLoopIndexA()] = ( udg_reaDemonsAcceleration[GetForLoopIndexA()] + 0.01 )
        else
        endif
        set udg_pntTemp = GetUnitLoc(udg_untDemonUnits[GetForLoopIndexA()])
        set udg_pntTemp2 = GetUnitLoc(udg_untPlayerUnits[udg_intPlayerBeingTargetted])
        call ConditionalTriggerExecute( gg_trg_Kill_Foolish_Elf )
        if ( Trig_Demon_Movement_Func001Func005C() ) then
            set udg_reaDemonsXVelocity[GetForLoopIndexA()] = ( udg_reaDemonsXVelocity[GetForLoopIndexA()] + udg_reaDemonsAcceleration[GetForLoopIndexA()] )
        else
            set udg_reaDemonsXVelocity[GetForLoopIndexA()] = ( udg_reaDemonsXVelocity[GetForLoopIndexA()] - udg_reaDemonsAcceleration[GetForLoopIndexA()] )
        endif
        if ( Trig_Demon_Movement_Func001Func006C() ) then
            set udg_reaDemonsYVelocity[GetForLoopIndexA()] = ( udg_reaDemonsYVelocity[GetForLoopIndexA()] + udg_reaDemonsAcceleration[GetForLoopIndexA()] )
        else
            set udg_reaDemonsYVelocity[GetForLoopIndexA()] = ( udg_reaDemonsYVelocity[GetForLoopIndexA()] - udg_reaDemonsAcceleration[GetForLoopIndexA()] )
        endif
        call ConditionalTriggerExecute( gg_trg_Enforce_Velocity_Cap )
        call SetUnitPositionLocFacingBJ( udg_untDemonUnits[GetForLoopIndexA()], OffsetLocation(udg_pntTemp, udg_reaDemonsXVelocity[GetForLoopIndexA()], udg_reaDemonsYVelocity[GetForLoopIndexA()]), AngleBetweenPoints(udg_pntTemp, udg_pntTemp2) )
        call RemoveLocation(udg_pntTemp)
        call RemoveLocation(udg_pntTemp2)
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_Demon_Movement takes nothing returns nothing
    set gg_trg_Demon_Movement = CreateTrigger(  )
    call DisableTrigger( gg_trg_Demon_Movement )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Demon_Movement, 0.02 )
    call TriggerAddAction( gg_trg_Demon_Movement, function Trig_Demon_Movement_Actions )
endfunction


вот, но наверное код тебе ни о чем не говорит.
Старый 07.11.2009, 19:08
Vulpes
Я жажду мёртвых овощей!%)
offline
Опыт: 639
Активность:
Да, код ни о чём не говорит. Как его импортировать?
Старый 07.11.2009, 19:14
SpiritWolf
Зеленый
offline
Опыт: 20,954
Активность:
О господи хоть бы сократил его
function Trig_Demon_Movement_Func001Func001C takes nothing returns boolean
    return ModuloInteger(GetTriggerExecCount(GetTriggeringTrigger()), 20) == 0
endfunction

function Trig_Demon_Movement_Func001Func005C takes nothing returns boolean
    return GetLocationX(udg_pntTemp) < GetLocationX(udg_pntTemp2)
endfunction

function Trig_Demon_Movement_Func001Func006C takes nothing returns boolean
    return GetLocationY(udg_pntTemp) < GetLocationY(udg_pntTemp2)
endfunction

function Trig_Demon_Movement_Actions takes nothing returns nothing
    set bj_forLoopAIndex = 1
    set bj_forLoopAIndexEnd = udg_intNumberOfActiveDemons
    loop
        exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
        if ( Trig_Demon_Movement_Func001Func001C() ) then
            set udg_reaDemonsAcceleration[GetForLoopIndexA()] = ( udg_reaDemonsAcceleration[GetForLoopIndexA()] + 0.01 )
        else
        endif
        set udg_pntTemp = GetUnitLoc(udg_untDemonUnits[GetForLoopIndexA()])
        set udg_pntTemp2 = GetUnitLoc(udg_untPlayerUnits[udg_intPlayerBeingTargetted])
        call ConditionalTriggerExecute( gg_trg_Kill_Foolish_Elf )
        if ( Trig_Demon_Movement_Func001Func005C() ) then
            set udg_reaDemonsXVelocity[GetForLoopIndexA()] = ( udg_reaDemonsXVelocity[GetForLoopIndexA()] + udg_reaDemonsAcceleration[GetForLoopIndexA()] )
        else
            set udg_reaDemonsXVelocity[GetForLoopIndexA()] = ( udg_reaDemonsXVelocity[GetForLoopIndexA()] - udg_reaDemonsAcceleration[GetForLoopIndexA()] )
        endif
        if ( Trig_Demon_Movement_Func001Func006C() ) then
            set udg_reaDemonsYVelocity[GetForLoopIndexA()] = ( udg_reaDemonsYVelocity[GetForLoopIndexA()] + udg_reaDemonsAcceleration[GetForLoopIndexA()] )
        else
            set udg_reaDemonsYVelocity[GetForLoopIndexA()] = ( udg_reaDemonsYVelocity[GetForLoopIndexA()] - udg_reaDemonsAcceleration[GetForLoopIndexA()] )
        endif
        call ConditionalTriggerExecute( gg_trg_Enforce_Velocity_Cap )
        call SetUnitPositionLocFacingBJ( udg_untDemonUnits[GetForLoopIndexA()], OffsetLocation(udg_pntTemp, udg_reaDemonsXVelocity[GetForLoopIndexA()], udg_reaDemonsYVelocity[GetForLoopIndexA()]), AngleBetweenPoints(udg_pntTemp, udg_pntTemp2) )
        call RemoveLocation(udg_pntTemp)
        call RemoveLocation(udg_pntTemp2)
        set bj_forLoopAIndex = bj_forLoopAIndex + 1
    endloop
endfunction

//===========================================================================
function InitTrig_Demon_Movement takes nothing returns nothing
    set gg_trg_Demon_Movement = CreateTrigger(  )
    call DisableTrigger( gg_trg_Demon_Movement )
    call TriggerRegisterTimerEventPeriodic( gg_trg_Demon_Movement, 0.02 )
    call TriggerAddAction( gg_trg_Demon_Movement, function Trig_Demon_Movement_Actions )
endfunction
Старый 07.11.2009, 19:15
Rewenger
The culprit will not die
offline
Опыт: 35,873
Активность:
BK.Jugg, мне кажется, или это обычный гуи, переведённый в джасс? Вот ничего тут джассового не нашёл.
Rewenger добавил:
RemoveLocation отлично делается в Custom Script...а в UMSWE и без CS
Старый 07.11.2009, 19:18
BK.Jugg
террорист из КиП
offline
Опыт: 27,066
Активность:
Rewenger, да, он кривой, я хз кто его писал.. =)
Старый 07.11.2009, 19:19
Suddenly
Je t'aime, Razer Lachesis
offline
Опыт: 3,893
Активность:
А можно то же самое, только в гуи?
Старый 27.03.2013, 13:13
quq_CCCP
Я белый и пушистый!
offline
Опыт: 93,429
Активность:
Suddenly, хоспади откройте карту Slide kitty slide она на гуи, там движение триггерами сделано да и все...
Старый 27.03.2013, 13:22
ScorpioT1000
Работаем
offline
Опыт: отключен
Suddenly, нельзя из-за утечек памяти
закрыто
Старый 27.03.2013, 14:10
Закрытая тема

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

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

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

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



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