это актуально даже для хорде моде , там юниты также ходят )Тоже такое было, свой микропроект из-за этого закрыл, до того как до форума этого добрался, хз как это работает, но юнит замедлялся по прохождению по trigger_dota, иногда даже его оббегал, офк только при использовании path_corner, а сам герой спокойно перемещался в тех же местах
нашел ошибкупоявился еще вопросик. В магазине нельзя купить некоторые предметы, либо части покупаются но не складываются в один предмет. В каком скрипте это контролируется?
почему бы просто не сделать две кнопки на панораме?Есть ли какой-то слушатель команд в игре , допустим когда хост пишет -boss , то вызывалась бы одна функция
А когда любой игрок писал -tp то его телепортировало на точку спауна . . .
Да, есть слушатель такой, так же там спокойно считывается знак "-" в начале и можно смотреть кто писал, но насчет хоста - не знаю, если можно как то узнать что он хост - то легкоЕсть ли какой-то слушатель команд в игре , допустим когда хост пишет -boss , то вызывалась бы одна функция
А когда любой игрок писал -tp то его телепортировало на точку спауна . . .
Бля я разобрался уже не надоЯ вот делаю абилку и я хочу чтобы она была прокачана сразу но когда использую DOTA_ABILITY_BEHAVIOR_NOT_LEARNEABLE у меня просто скилл не может прокачатся а мне надо чтобы он сразу был прокачан
local itemSpawner = Entities:FindByName( nil, "itemSpawner"):GetAbsOrigin()
CreateItemOnPositionSync(itemSpawner, newItem)
GameMode:SpawnItemsTimer()
-- 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. а она не работает( в чем может быть пролема?Код:-- 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
а как правильно, прост это из файлов NoyaНе правильный запуск.
запихнуть иконки предметов по пути отображения абилокЧто нужно сделать, чтобы отображались иконки у модификаторов предмета? Пробовал TextureName, но не помогает.