Ошибка при запуске скрипта

IntelTwix

Пользователь
25 Фев 2018
50
1
Проект
Humans vs Zombie
Вроде как пошёл какой-то прогресс.

В коде:

Код:
function GameMode:OnGameInProgress()
  DebugPrint("[BAREBONES] The game has officially begun")

  local playerID = 0
  local hero = PlayerResource:GetPlayer(playerID):GetAssignedHero()

  Timers:CreateTimer(3,
    function()
      local unit = CreateUnitByName('npc_unit_zombi', Vector(258.066, 711.922, 273), true, hero, hero, DOTA_TEAM_BADGUYS)
      unit:SetControllableByPlayer(playerID, false)
      return 60
    end)

  Timers:CreateTimer(30, -- Start this timer 30 game-time seconds later
    function()
      DebugPrint("This function is called 30 seconds after the game begins, and every 30 seconds thereafter")
      return 30.0 -- Rerun this timer every 30 game-time seconds
    end)
end
А именно вот в этой строчки
local unit = CreateUnitByName('npc_unit_zombi', Vector(258.066, 711.922, 273), true, hero, hero, DOTA_TEAM_BADGUYS)

Заменил npc_unit_zombi на npc_dota_hero_axe.
И как ни странно создался Акс. Я понял что дело в файле npc_units_custom.
Полез туда, вернул всё как было. А эффекта ноль. Акс создается, а вот юнит из unit_custom нет. Что за беда не пойму.
Код:
// Dota Units File
"DOTAUnits"
{
    "Version" "1"

    "npc_unit_zombi"
    {
        "BaseClass"                 "npc_dota_creature"
        "Model"                     "models/heroes/undying/undying_minion.vmdl"
        "Ability1"                  "dota_ability_xp_granter"
        "AttackCapabilities"        "DOTA_UNIT_CAP_NO_ATTACK"
        "BountyXP"                  "0"
        "MovementCapabilities"      "DOTA_UNIT_CAP_MOVE_NONE"
        "StatusHealth"              "5000"
        "TeamName"                  "DOTA_TEAM_NEUTRALS"
    }
 
20 Дек 2016
892
170
Код:
// Dota Units File
"DOTAUnits"
{
    "Version" "1"

    "npc_unit_zombi"
    {
        "BaseClass"                 "npc_dota_creature"
        "Model"                     "models/heroes/undying/undying_minion.vmdl"
        "Ability1"                  "dota_ability_xp_granter"
        "AttackCapabilities"        "DOTA_UNIT_CAP_NO_ATTACK"
        "BountyXP"                  "0"
        "MovementCapabilities"      "DOTA_UNIT_CAP_MOVE_NONE"
        "StatusHealth"              "5000"
        "TeamName"                  "DOTA_TEAM_NEUTRALS"
    }
В файле у тебя тоже последней скобки нет?
 
  • Нравится
Реакции: IntelTwix
Реклама: