Простые вопросы #2

Статус
В этой теме нельзя размещать новые ответы.

shesmu

Продвинутый
22 Фев 2018
158
22
Активируется тригер от npc_dota_hero_announcer_killing_spree и npc_dota_hero_announcer, как задефаться от них?
 

vulkantsk

Супермодератор
Команда форума
21 Июн 2017
1,147
196
www.dotabuff.com
Проект
Roshan defense
Тоже такое было, свой микропроект из-за этого закрыл, до того как до форума этого добрался, хз как это работает, но юнит замедлялся по прохождению по trigger_dota, иногда даже его оббегал, офк только при использовании path_corner, а сам герой спокойно перемещался в тех же местах
это актуально даже для хорде моде , там юниты также ходят )
Пофиксить это можно увеличив радиус агра , когда в агрессивном состоянии то скорость становится обычная...
 

almazist1

Продвинутый
появился еще вопросик. В магазине нельзя купить некоторые предметы, либо части покупаются но не складываются в один предмет. В каком скрипте это контролируется?
нашел ошибку :D
 

vulkantsk

Супермодератор
Команда форума
21 Июн 2017
1,147
196
www.dotabuff.com
Проект
Roshan defense
Есть ли какой-то слушатель команд в игре , допустим когда хост пишет -boss , то вызывалась бы одна функция
А когда любой игрок писал -tp то его телепортировало на точку спауна . . .
 

Дикий Пёс

Друзья CG
28 Июн 2017
411
96
Проект
Petri Reborn
Есть ли какой-то слушатель команд в игре , допустим когда хост пишет -boss , то вызывалась бы одна функция
А когда любой игрок писал -tp то его телепортировало на точку спауна . . .
почему бы просто не сделать две кнопки на панораме?
 

Дикий Пёс

Друзья CG
28 Июн 2017
411
96
Проект
Petri Reborn
а вообще я вроде в barebones видел что-то вроде OnPlayerChat, посмотри там
 

00zveroboi

Активный
14 Июл 2015
103
17
Есть ли какой-то слушатель команд в игре , допустим когда хост пишет -boss , то вызывалась бы одна функция
А когда любой игрок писал -tp то его телепортировало на точку спауна . . .
Да, есть слушатель такой, так же там спокойно считывается знак "-" в начале и можно смотреть кто писал, но насчет хоста - не знаю, если можно как то узнать что он хост - то легко
 

SniperX

Друзья CG
26 Фев 2018
539
100
Проект
Dota 2x4
Я вот делаю абилку и я хочу чтобы она была прокачана сразу но когда использую DOTA_ABILITY_BEHAVIOR_NOT_LEARNEABLE у меня просто скилл не может прокачатся а мне надо чтобы он сразу был прокачан
 

SniperX

Друзья CG
26 Фев 2018
539
100
Проект
Dota 2x4
Я вот делаю абилку и я хочу чтобы она была прокачана сразу но когда использую DOTA_ABILITY_BEHAVIOR_NOT_LEARNEABLE у меня просто скилл не может прокачатся а мне надо чтобы он сразу был прокачан
Бля я разобрался уже не надо
 

SomeKindOfNoName

Пользователь
23 Июл 2018
12
1
Как спавнить предметы?

Да-да, я поискал и почитал.
Код:
local itemSpawner = Entities:FindByName( nil, "itemSpawner"):GetAbsOrigin()
CreateItemOnPositionSync(itemSpawner, newItem)
И запихнул я это ( а точнее функцию, которая вызывает другую функцию, содержащую это) в GameMode:OnThink()
Код:
GameMode:SpawnItemsTimer()

Правильно ли я сделал? И что является необходимым Entity для этой строки? Если их через CTRL+T создавать, то там выбор из триггеров в основном идет, и я как бы хз.
 

almazist1

Продвинутый
Привет всем. Решил сделать абилку Алкопанды примал сплит и чтоб появлялся только один спирит нашел такой файл
Код:
-- Starts the ability
function PrimalSplit( event )
    local caster = event.caster
    local player = caster:GetPlayerID()
    local ability = event.ability
    local duration = ability:GetLevelSpecialValueFor( "duration" , ability:GetLevel() - 1 )
    local level = ability:GetLevel()

    -- Set the unit names to create,concatenated with the level number


    -- STORM
    local unit_name_storm = event.unit_name_storm
    unit_name_storm = unit_name_storm..level


    -- Set the positions
    local forwardV = caster:GetForwardVector()
    local origin = caster:GetAbsOrigin()
    local distance = 100
    local ang_right = QAngle(0, -90, 0)
    local ang_left = QAngle(0, 90, 0)


    -- Storm at the left, a bit behind
    local storm_position = origin + forwardV * distance


    -- Create the units
    caster.Storm = CreateUnitByName(unit_name_storm, storm_position, true, caster, caster, caster:GetTeamNumber())


    -- Make them controllable

    caster.Storm:SetControllableByPlayer(player, true)


    -- Set all of them looking at the same point as the caster

    caster.Storm:SetForwardVector(forwardV)


    -- Ultimate Scepter rule:
    -- If the caster has it, summoned units get all their abilities
    if caster:HasScepter() then
        LearnAllAbilities(caster.Earth, 1)
        LearnAllAbilities(caster.Storm, 1)
        LearnAllAbilities(caster.Fire, 1)
    else   
    -- If the item is not found, do not skill these abilities:
        local earth_scepter_ability = "brewmaster_thunder_clap"
        LearnAllAbilitiesExcluding(caster.Earth, 1, earth_scepter_ability)

        local storm_scepter_ability = "brewmaster_drunken_haze"
        LearnAllAbilitiesExcluding(caster.Storm, 1, storm_scepter_ability)

        local fire_scepter_ability = "brewmaster_drunken_brawler"
        LearnAllAbilitiesExcluding(caster.Fire, 1, fire_scepter_ability)
    end   

    -- Apply modifiers to detect units dying

    ability:ApplyDataDrivenModifier(caster, caster.Storm, "modifier_split_unit", {})


    -- Make them expire after the duration

    caster.Storm:AddNewModifier(caster, ability, "modifier_kill", {duration = duration})

    -- Set the Earth unit as the primary active of the split (the hero will be periodically moved to the ActiveSplit location)
    caster.ActiveSplit = caster.Storm

    -- Hide the hero underground
    local underground_position = Vector(origin.x, origin.y, origin.z - 322)
    caster:SetAbsOrigin(underground_position)

end

-- When the spell ends, the Brewmaster takes Earth's place.
-- If Earth is dead he takes Storm's place, and if Storm is dead he takes Fire's place.
function SplitUnitDied( event )
    local caster = event.caster
    local attacker = event.attacker
    local unit = event.unit

    -- Chech which spirits are still alive
    if IsValidEntity(caster.Earth) and caster.Earth:IsAlive() then
        caster.ActiveSplit = caster.Earth
    if IsValidEntity(caster.Storm) and caster.Storm:IsAlive() then
        caster.ActiveSplit = caster.Storm
    elseif IsValidEntity(caster.Fire) and caster.Fire:IsAlive() then
        caster.ActiveSplit = caster.Fire
    else
        -- Check if they died because the spell ended, or where killed by an attacker
        -- If the attacker is the same as the unit, it means the summon duration is over.
        if attacker == unit then
            print("Primal Split End Succesfully")
        elseif attacker ~= unit then
            -- Kill the caster with credit to the attacker.
            caster:Kill(nil, attacker)
            caster.ActiveSplit = nil
        end
    end

    if caster.ActiveSplit then
        print(caster.ActiveSplit:GetUnitName() .. " is active now")
    else
        print("All Split Units were killed!")
    end

end

-- While the main spirit is alive, reposition the hero to its position so that auras are carried over.
-- This will also help finding the current Active primal split unit with the hero hotkey
function PrimalSplitAuraMove( event )
    -- Hide the hero underground on the Active Split position
    local caster = event.caster
    local active_split_position = caster.ActiveSplit:GetAbsOrigin()
    local underground_position = Vector(active_split_position.x, active_split_position.y, active_split_position.z - 322)
    caster:SetAbsOrigin(underground_position)

end

-- Ends the the ability, repositioning the hero on the latest active split unit
function PrimalSplitEnd( event )
    local caster = event.caster
    local facing_direction = caster.ActiveSplit:GetForwardVector()
    if caster.ActiveSplit then
        local position = caster.ActiveSplit:GetAbsOrigin()
        FindClearSpaceForUnit(caster, position, true)
        caster:SetForwardVector(facing_direction)
    end

end

-- Auxiliar Function to loop over all the abilities of the unit and set them to a level
function LearnAllAbilities( unit, level )

    for i=0,15 do
        local ability = unit:GetAbilityByIndex(i)
        if ability then
            ability:SetLevel(level)
            print("Set Level "..level.." on "..ability:GetAbilityName())
        end
    end
end

-- Same but ignoring one ability
function LearnAllAbilitiesExcluding( unit, level, excludedAbilityName)
    for i=0,15 do
        local ability = unit:GetAbilityByIndex(i)
        if ability and ability:GetAbilityName() ~= excludedAbilityName then
            ability:SetLevel(level)
            print("Set Level "..level.." on "..ability:GetAbilityName())
        end
    end
end
вписал расположение скрипта в heroes custom. а она не работает( в чем может быть пролема?
 

HappyFeedFriends

Друзья CG
14 Авг 2017
540
32
Проект
Battle Heroes Arena
Привет всем. Решил сделать абилку Алкопанды примал сплит и чтоб появлялся только один спирит нашел такой файл
Код:
-- Starts the ability
function PrimalSplit( event )
    local caster = event.caster
    local player = caster:GetPlayerID()
    local ability = event.ability
    local duration = ability:GetLevelSpecialValueFor( "duration" , ability:GetLevel() - 1 )
    local level = ability:GetLevel()

    -- Set the unit names to create,concatenated with the level number


    -- STORM
    local unit_name_storm = event.unit_name_storm
    unit_name_storm = unit_name_storm..level


    -- Set the positions
    local forwardV = caster:GetForwardVector()
    local origin = caster:GetAbsOrigin()
    local distance = 100
    local ang_right = QAngle(0, -90, 0)
    local ang_left = QAngle(0, 90, 0)


    -- Storm at the left, a bit behind
    local storm_position = origin + forwardV * distance


    -- Create the units
    caster.Storm = CreateUnitByName(unit_name_storm, storm_position, true, caster, caster, caster:GetTeamNumber())


    -- Make them controllable

    caster.Storm:SetControllableByPlayer(player, true)


    -- Set all of them looking at the same point as the caster

    caster.Storm:SetForwardVector(forwardV)


    -- Ultimate Scepter rule:
    -- If the caster has it, summoned units get all their abilities
    if caster:HasScepter() then
        LearnAllAbilities(caster.Earth, 1)
        LearnAllAbilities(caster.Storm, 1)
        LearnAllAbilities(caster.Fire, 1)
    else  
    -- If the item is not found, do not skill these abilities:
        local earth_scepter_ability = "brewmaster_thunder_clap"
        LearnAllAbilitiesExcluding(caster.Earth, 1, earth_scepter_ability)

        local storm_scepter_ability = "brewmaster_drunken_haze"
        LearnAllAbilitiesExcluding(caster.Storm, 1, storm_scepter_ability)

        local fire_scepter_ability = "brewmaster_drunken_brawler"
        LearnAllAbilitiesExcluding(caster.Fire, 1, fire_scepter_ability)
    end  

    -- Apply modifiers to detect units dying

    ability:ApplyDataDrivenModifier(caster, caster.Storm, "modifier_split_unit", {})


    -- Make them expire after the duration

    caster.Storm:AddNewModifier(caster, ability, "modifier_kill", {duration = duration})

    -- Set the Earth unit as the primary active of the split (the hero will be periodically moved to the ActiveSplit location)
    caster.ActiveSplit = caster.Storm

    -- Hide the hero underground
    local underground_position = Vector(origin.x, origin.y, origin.z - 322)
    caster:SetAbsOrigin(underground_position)

end

-- When the spell ends, the Brewmaster takes Earth's place.
-- If Earth is dead he takes Storm's place, and if Storm is dead he takes Fire's place.
function SplitUnitDied( event )
    local caster = event.caster
    local attacker = event.attacker
    local unit = event.unit

    -- Chech which spirits are still alive
    if IsValidEntity(caster.Earth) and caster.Earth:IsAlive() then
        caster.ActiveSplit = caster.Earth
    if IsValidEntity(caster.Storm) and caster.Storm:IsAlive() then
        caster.ActiveSplit = caster.Storm
    elseif IsValidEntity(caster.Fire) and caster.Fire:IsAlive() then
        caster.ActiveSplit = caster.Fire
    else
        -- Check if they died because the spell ended, or where killed by an attacker
        -- If the attacker is the same as the unit, it means the summon duration is over.
        if attacker == unit then
            print("Primal Split End Succesfully")
        elseif attacker ~= unit then
            -- Kill the caster with credit to the attacker.
            caster:Kill(nil, attacker)
            caster.ActiveSplit = nil
        end
    end

    if caster.ActiveSplit then
        print(caster.ActiveSplit:GetUnitName() .. " is active now")
    else
        print("All Split Units were killed!")
    end

end

-- While the main spirit is alive, reposition the hero to its position so that auras are carried over.
-- This will also help finding the current Active primal split unit with the hero hotkey
function PrimalSplitAuraMove( event )
    -- Hide the hero underground on the Active Split position
    local caster = event.caster
    local active_split_position = caster.ActiveSplit:GetAbsOrigin()
    local underground_position = Vector(active_split_position.x, active_split_position.y, active_split_position.z - 322)
    caster:SetAbsOrigin(underground_position)

end

-- Ends the the ability, repositioning the hero on the latest active split unit
function PrimalSplitEnd( event )
    local caster = event.caster
    local facing_direction = caster.ActiveSplit:GetForwardVector()
    if caster.ActiveSplit then
        local position = caster.ActiveSplit:GetAbsOrigin()
        FindClearSpaceForUnit(caster, position, true)
        caster:SetForwardVector(facing_direction)
    end

end

-- Auxiliar Function to loop over all the abilities of the unit and set them to a level
function LearnAllAbilities( unit, level )

    for i=0,15 do
        local ability = unit:GetAbilityByIndex(i)
        if ability then
            ability:SetLevel(level)
            print("Set Level "..level.." on "..ability:GetAbilityName())
        end
    end
end

-- Same but ignoring one ability
function LearnAllAbilitiesExcluding( unit, level, excludedAbilityName)
    for i=0,15 do
        local ability = unit:GetAbilityByIndex(i)
        if ability and ability:GetAbilityName() ~= excludedAbilityName then
            ability:SetLevel(level)
            print("Set Level "..level.." on "..ability:GetAbilityName())
        end
    end
end
вписал расположение скрипта в heroes custom. а она не работает( в чем может быть пролема?
Не правильный запуск.
 

Pancer

Активный
30 Мар 2017
127
5
steamcommunity.com
Проект
MARVEL Heroes
Что нужно сделать, чтобы отображались иконки у модификаторов предмета? Пробовал TextureName, но не помогает.
 
Статус
В этой теме нельзя размещать новые ответы.
Реклама: