Отлов убийства нейтралов

Вот код консоли после респавна и убийства мобов ,как я понял скрытая способность здесь не фигурирует
[ VScript ]: }
[ VScript ]: [BAREBONES] NPC Spawned
[ VScript ]: {
[ VScript ]: entindex = 411 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] NPC Spawned
[ VScript ]: {
[ VScript ]: entindex = 410 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] NPC Spawned
[ VScript ]: {
[ VScript ]: entindex = 409 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] NPC Spawned
[ VScript ]: {
[ VScript ]: entindex = 366 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] OnPlayerLearnedAbility
[ VScript ]: {
[ VScript ]: player = 1 (number)
[ VScript ]: abilityname = "abaddon_aphotic_shield" (string)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] AbilityUsed
[ VScript ]: {
[ VScript ]: abilityname = "abaddon_aphotic_shield" (string)
[ VScript ]: PlayerID = 0 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] OnLastHit
[ VScript ]: {
[ VScript ]: EntKilled = 366 (number)
[ VScript ]: FirstBlood = 0 (number)
[ VScript ]: TowerKill = 0 (number)
[ VScript ]: HeroKill = 0 (number)
[ VScript ]: PlayerID = 0 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] OnEntityKilled Called
[ VScript ]: {
[ VScript ]: entindex_inflictor = 269 (number)
[ VScript ]: damagebits = 0 (number)
[ VScript ]: entindex_killed = 366 (number)
[ VScript ]: entindex_attacker = 267 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] OnLastHit
[ VScript ]: {
[ VScript ]: EntKilled = 410 (number)
[ VScript ]: FirstBlood = 0 (number)
[ VScript ]: TowerKill = 0 (number)
[ VScript ]: HeroKill = 0 (number)
[ VScript ]: PlayerID = 0 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] OnEntityKilled Called
[ VScript ]: {
[ VScript ]: entindex_inflictor = 269 (number)
[ VScript ]: damagebits = 0 (number)
[ VScript ]: entindex_killed = 410 (number)
[ VScript ]: entindex_attacker = 267 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] OnLastHit
[ VScript ]: {
[ VScript ]: EntKilled = 409 (number)
[ VScript ]: FirstBlood = 0 (number)
[ VScript ]: TowerKill = 0 (number)
[ VScript ]: HeroKill = 0 (number)
[ VScript ]: PlayerID = 0 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] OnEntityKilled Called
[ VScript ]: {
[ VScript ]: entindex_inflictor = 269 (number)
[ VScript ]: damagebits = 0 (number)
[ VScript ]: entindex_killed = 409 (number)
[ VScript ]: entindex_attacker = 267 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] OnLastHit
[ VScript ]: {
[ VScript ]: EntKilled = 411 (number)
[ VScript ]: FirstBlood = 0 (number)
[ VScript ]: TowerKill = 0 (number)
[ VScript ]: HeroKill = 0 (number)
[ VScript ]: PlayerID = 0 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
[ VScript ]: [BAREBONES] OnEntityKilled Called
[ VScript ]: {
[ VScript ]: entindex_inflictor = 269 (number)
[ VScript ]: damagebits = 0 (number)
[ VScript ]: entindex_killed = 411 (number)
[ VScript ]: entindex_attacker = 267 (number)
[ VScript ]: splitscreenplayer = -1 (number)
[ VScript ]: }
 
Последнее редактирование модератором:
[quote author=I_GRIN_I link=topic=958.msg4858#msg4858 date=1465759389]
Роман, короче смотри, тебе примерно нужно такое: ты через функцию GameMode:OnIntervalThink() [Не забудь IntervalThink выставить, например каждые 0.1 секунду] ищешь через FindByName твоих крипов на волнах, если же крипы не находятся то return_time выставляется 0, это же глобальная переменная. В общем тебе в любом случае нужно хоть немного знать луа, а то я может чушь сейчас написал.
[/quote]

В своем адоне я реализовал респ мобов после смерти чере AI. Не знаю на сколько это правильный выбор, но мне он показался более удобным.
Единственный минус, это то что придется прописать его у каждого крипа, которого ты спавнишь. Если кому интересно, то вот код:

Содержание AI файлика:
Код:
require('libraries/timers')

function Spawn( entityKeyValues )
 DebugPrintTable(entityKeyValues)
 thisEntity:SetContextThink( "Creep_Think", CreepThink, 2.0 )
 thisEntity:SetContextThink( "Creep_Respawn", CreepRespawn, 1.0 )
end

function CreepRespawn()
 local unit_name = thisEntity:GetUnitName()
 local unit_type = string.sub(unit_name, 16, 18)
 if not thisEntity:IsAlive() then
   Timers:CreateTimer({
    endTime = RandomInt(10,15),
    callback = function()
    if unit_type == "low" then
     StartRespawnTimerLow(thisEntity.spawnloc)
    elseif unit_type == "mid" then
     StartRespawnTimerMid(thisEntity.spawnloc)
    elseif unit_type == "top" then
     StartRespawnTimerTop(thisEntity.spawnloc)
    end
   end
   })
   return nil
 end
 return 1.0
end



function CreepThink()
 if not thisEntity:IsAlive() then
   return nil
 end

 if not thisEntity.position then
  thisEntity.position = thisEntity:GetAbsOrigin()
 end
 if not thisEntity:IsPositionInRange(thisEntity.position, 400.0) then
  thisEntity:MoveToPosition(thisEntity.position)
  return 4.0
 elseif not thisEntity:IsAttacking() and thisEntity:GetHealthPercent() > 25 then
  local random_vec = thisEntity:GetAbsOrigin() + RandomVector(RandomFloat(50,200))
  thisEntity:MoveToPositionAggressive(random_vec) 
  return RandomFloat( 3.0, 8.0 )
 elseif thisEntity:GetHealthPercent() < 25 then
  local random_vec = thisEntity:GetAbsOrigin() + RandomVector(RandomFloat(500,600))
  thisEntity:MoveToPosition(random_vec)
  thisEntity:SetBaseMoveSpeed(120)
  return 8.0
 else 
   return 0.25 + RandomFloat(0.25, 0.5)
 end
end

function StartRespawnTimerLow(location)
  local creeps = {}
  creeps[1] = "khaleon_forest_low_wolf"
  creeps[2] = "khaleon_forest_low_bear"
  creeps[3] = "khaleon_forest_low_harpy"
  local spawn_creep = CreateUnitByName(creeps[RandomInt(1,3)], location, true, nil, nil, DOTA_TEAM_BADGUYS )
  FindClearSpaceForUnit(spawn_creep, location, false)
  spawn_creep.spawnloc = location
end

function StartRespawnTimerMid(location)
  local creeps = {}
  creeps[1] = "khaleon_forest_mid_golem"
  creeps[2] = "khaleon_forest_mid_wildkin"
  creeps[3] = "khaleon_forest_mid_dragon"
  local spawn_creep = CreateUnitByName(creeps[RandomInt(1,3)], location, true, nil, nil, DOTA_TEAM_BADGUYS )
  FindClearSpaceForUnit(spawn_creep, location, false)
  spawn_creep.spawnloc = location
end

function StartRespawnTimerTop(location)
  local creeps = {}
  creeps[1] = "khaleon_forest_top_troll"
  creeps[2] = "khaleon_forest_top_centaur"
  creeps[3] = "khaleon_forest_top_golem"
  local spawn_creep = CreateUnitByName(creeps[RandomInt(1,3)], location, true, nil, nil, DOTA_TEAM_BADGUYS )
  FindClearSpaceForUnit(spawn_creep, location, false)
  spawn_creep.spawnloc = location
end

Тут респ после смерти, а также привязка юнита к месту где он был заспавнен, что-бы заспавнить следующего на том же месте, случайный выбор юнита из заданной таблицы, а также чуть чуть кода, для поведения крипа. Они у меня гуляющие в определенном месте, не "волновые".
 
Последнее редактирование модератором:
[quote author=RecoveryIt link=topic=958.msg4861#msg4861 date=1465760911]
В своем адоне я реализовал респ мобов после смерти чере AI. Не знаю на сколько это правильный выбор, но мне он показался более удобным.
Единственный минус, это то что придется прописать его у каждого крипа, которого ты спавнишь. Если кому интересно, то вот код:

Содержание AI файлика:
Код:
require('libraries/timers')

function Spawn( entityKeyValues )
 DebugPrintTable(entityKeyValues)
 thisEntity:SetContextThink( "Creep_Think", CreepThink, 2.0 )
 thisEntity:SetContextThink( "Creep_Respawn", CreepRespawn, 1.0 )
end

function CreepRespawn()
 local unit_name = thisEntity:GetUnitName()
 local unit_type = string.sub(unit_name, 16, 18)
 if not thisEntity:IsAlive() then
   Timers:CreateTimer({
    endTime = RandomInt(10,15),
    callback = function()
    if unit_type == "low" then
     StartRespawnTimerLow(thisEntity.spawnloc)
    elseif unit_type == "mid" then
     StartRespawnTimerMid(thisEntity.spawnloc)
    elseif unit_type == "top" then
     StartRespawnTimerTop(thisEntity.spawnloc)
    end
   end
   })
   return nil
 end
 return 1.0
end



function CreepThink()
 if not thisEntity:IsAlive() then
   return nil
 end

 if not thisEntity.position then
  thisEntity.position = thisEntity:GetAbsOrigin()
 end
 if not thisEntity:IsPositionInRange(thisEntity.position, 400.0) then
  thisEntity:MoveToPosition(thisEntity.position)
  return 4.0
 elseif not thisEntity:IsAttacking() and thisEntity:GetHealthPercent() > 25 then
  local random_vec = thisEntity:GetAbsOrigin() + RandomVector(RandomFloat(50,200))
  thisEntity:MoveToPositionAggressive(random_vec) 
  return RandomFloat( 3.0, 8.0 )
 elseif thisEntity:GetHealthPercent() < 25 then
  local random_vec = thisEntity:GetAbsOrigin() + RandomVector(RandomFloat(500,600))
  thisEntity:MoveToPosition(random_vec)
  thisEntity:SetBaseMoveSpeed(120)
  return 8.0
 else 
   return 0.25 + RandomFloat(0.25, 0.5)
 end
end

function StartRespawnTimerLow(location)
  local creeps = {}
  creeps[1] = "khaleon_forest_low_wolf"
  creeps[2] = "khaleon_forest_low_bear"
  creeps[3] = "khaleon_forest_low_harpy"
  local spawn_creep = CreateUnitByName(creeps[RandomInt(1,3)], location, true, nil, nil, DOTA_TEAM_BADGUYS )
  FindClearSpaceForUnit(spawn_creep, location, false)
  spawn_creep.spawnloc = location
end

function StartRespawnTimerMid(location)
  local creeps = {}
  creeps[1] = "khaleon_forest_mid_golem"
  creeps[2] = "khaleon_forest_mid_wildkin"
  creeps[3] = "khaleon_forest_mid_dragon"
  local spawn_creep = CreateUnitByName(creeps[RandomInt(1,3)], location, true, nil, nil, DOTA_TEAM_BADGUYS )
  FindClearSpaceForUnit(spawn_creep, location, false)
  spawn_creep.spawnloc = location
end

function StartRespawnTimerTop(location)
  local creeps = {}
  creeps[1] = "khaleon_forest_top_troll"
  creeps[2] = "khaleon_forest_top_centaur"
  creeps[3] = "khaleon_forest_top_golem"
  local spawn_creep = CreateUnitByName(creeps[RandomInt(1,3)], location, true, nil, nil, DOTA_TEAM_BADGUYS )
  FindClearSpaceForUnit(spawn_creep, location, false)
  spawn_creep.spawnloc = location
end

Тут респ после смерти, а также привязка юнита к месту где он был заспавнен, что-бы заспавнить следующего на том же месте, случайный выбор юнита из заданной таблицы, а также чуть чуть кода, для поведения крипа.
[/quote]
Блин да я первый способ понять не могу ,а вы даете мне другой ,так кто муже я не знаю что такое аи.По мимо всего этого у тебя если я верно понял моб респавниться сразу после смерти ,а у меня нужно чтобы вся пачка появлялась после смерти всех.
 
Последнее редактирование модератором:
Мне больше интересно когда срабатывает эта скрытая способность при смерти крипа это пишеться в консоли?
 
Вот файлик npc_unit_custom c примером одного моба.
Код:
	"example_unit_1"	
	{
		// General
		//----------------------------------------------------------------
		"Model"						"models/creeps/neutral_creeps/n_creep_gnoll/n_creep_gnoll_frost.vmdl"	// Model.
		"BaseClass"					"npc_dota_creature"
		"SoundSet"					"n_creep_Ranged"
		"GameSoundsFile"			"soundevents/game_sounds_creeps.vsndevts"
		"Level"						"1"
		"ModelScale" 				".9"

		// Abilities
		//----------------------------------------------------------------
		"Ability1"					""			// Ability 1
		"Ability2"					""			// Ability 2
		"Ability3"					""			// Ability 3
		"Ability4"					""			// Ability 4

		// Armor
		//----------------------------------------------------------------
		"ArmorPhysical"				"10"			// Physical protection.

		// Attack
		//----------------------------------------------------------------
		"AttackCapabilities"		"DOTA_UNIT_CAP_RANGED_ATTACK"
		"AttackDamageMin"			"30"		// Damage range min.
		"AttackDamageMax"			"36"		// Damage range max.
		"AttackRate"				"1.6"		// Speed of attack.
		"AttackAnimationPoint"		"0.4"		// Normalized time in animation cycle to attack.
		"AttackAcquisitionRange"	"800"		// Range within a target can be acquired.
		"AttackRange"				"500"		// Range within a target can be attacked.
		"ProjectileModel"			"particles/neutral_fx/gnoll_base_attack.vpcf" // Particle system model for projectile.
		"ProjectileSpeed"			"1500"		// Speed of projectile.		   

		// Bounds
		//----------------------------------------------------------------
		"RingRadius"				"40"
		"HealthBarOffset"			"170"

		// Bounty
		//----------------------------------------------------------------
		"BountyXP"					"24"		// Experience earn.
		"BountyGoldMin"				"21"		// Gold earned min.
		"BountyGoldMax"				"29"		// Gold earned max.

		// Movement
		//----------------------------------------------------------------
		"MovementCapabilities"		"DOTA_UNIT_CAP_MOVE_GROUND"
		"MovementSpeed"				"270"		// Speed.			

		// Status
		//----------------------------------------------------------------
		"StatusHealth"				"75"		// Base health.
		"StatusHealthRegen"			"0.5"		// Health regeneration rate.
		"StatusMana"				"0"			// Base mana.
		"StatusManaRegen"			"0.0"		// Mana regeneration rate.		 
		
		// Vision
		//----------------------------------------------------------------
		"VisionDaytimeRange"		"400"		// Range of vision during day light.
		"VisionNighttimeRange"		"400"		// Range of vision at night time.

		// Team
		//----------------------------------------------------------------
		"TeamName"					"DOTA_TEAM_GOODGUYS"						// Team name.
		"CombatClassAttack"			"DOTA_COMBAT_CLASS_ATTACK_PIERCE"
		"CombatClassDefend"			"DOTA_COMBAT_CLASS_DEFEND_BASIC"
		"UnitRelationshipClass"		"DOTA_NPC_UNIT_RELATIONSHIP_TYPE_DEFAULT"
		 "OnOwnerDied"
 {
  "RunScript"
  {
   "ScriptFile"  "addon_game_mode.lua"
   "Function"   "creep_die"
  }
 }
 		// Creature Data
		//----------------------------------------------------------------
		"Creature"
		{
			//Level Up
			"HPGain"					"50"
			"DamageGain"				"2"
			"ArmorGain"					"0.25"
			"MagicResistGain"			"0.1"
			"MoveSpeedGain"				"1"
			"BountyGain"				"3"
			"XPGain"					"15"
		}
	}
Вот этот кусок я вставил в свой код
Код:
		 "OnOwnerDied"
 {
  "RunScript"
  {
   "ScriptFile"  "addon_game_mode.lua"
   "Function"   "creep_die"
  }
 }
 
Последнее редактирование модератором:
[quote author=Роман link=topic=958.msg4864#msg4864 date=1465761355]
Вот файлик npc_unit_custom c примером одного моба.
Код:
	"example_unit_1"	
	{
		// General
		//----------------------------------------------------------------
		"Model"						"models/creeps/neutral_creeps/n_creep_gnoll/n_creep_gnoll_frost.vmdl"	// Model.
		"BaseClass"					"npc_dota_creature"
		"SoundSet"					"n_creep_Ranged"
		"GameSoundsFile"			"soundevents/game_sounds_creeps.vsndevts"
		"Level"						"1"
		"ModelScale" 				".9"

		// Abilities
		//----------------------------------------------------------------
		"Ability1"					""			// Ability 1
		"Ability2"					""			// Ability 2
		"Ability3"					""			// Ability 3
		"Ability4"					""			// Ability 4

		// Armor
		//----------------------------------------------------------------
		"ArmorPhysical"				"10"			// Physical protection.

		// Attack
		//----------------------------------------------------------------
		"AttackCapabilities"		"DOTA_UNIT_CAP_RANGED_ATTACK"
		"AttackDamageMin"			"30"		// Damage range min.
		"AttackDamageMax"			"36"		// Damage range max.
		"AttackRate"				"1.6"		// Speed of attack.
		"AttackAnimationPoint"		"0.4"		// Normalized time in animation cycle to attack.
		"AttackAcquisitionRange"	"800"		// Range within a target can be acquired.
		"AttackRange"				"500"		// Range within a target can be attacked.
		"ProjectileModel"			"particles/neutral_fx/gnoll_base_attack.vpcf" // Particle system model for projectile.
		"ProjectileSpeed"			"1500"		// Speed of projectile.		   

		// Bounds
		//----------------------------------------------------------------
		"RingRadius"				"40"
		"HealthBarOffset"			"170"

		// Bounty
		//----------------------------------------------------------------
		"BountyXP"					"24"		// Experience earn.
		"BountyGoldMin"				"21"		// Gold earned min.
		"BountyGoldMax"				"29"		// Gold earned max.

		// Movement
		//----------------------------------------------------------------
		"MovementCapabilities"		"DOTA_UNIT_CAP_MOVE_GROUND"
		"MovementSpeed"				"270"		// Speed.			

		// Status
		//----------------------------------------------------------------
		"StatusHealth"				"75"		// Base health.
		"StatusHealthRegen"			"0.5"		// Health regeneration rate.
		"StatusMana"				"0"			// Base mana.
		"StatusManaRegen"			"0.0"		// Mana regeneration rate.		 
		
		// Vision
		//----------------------------------------------------------------
		"VisionDaytimeRange"		"400"		// Range of vision during day light.
		"VisionNighttimeRange"		"400"		// Range of vision at night time.

		// Team
		//----------------------------------------------------------------
		"TeamName"					"DOTA_TEAM_GOODGUYS"						// Team name.
		"CombatClassAttack"			"DOTA_COMBAT_CLASS_ATTACK_PIERCE"
		"CombatClassDefend"			"DOTA_COMBAT_CLASS_DEFEND_BASIC"
		"UnitRelationshipClass"		"DOTA_NPC_UNIT_RELATIONSHIP_TYPE_DEFAULT"
		 "OnOwnerDied"
 {
  "RunScript"
  {
   "ScriptFile"  "addon_game_mode.lua"
   "Function"   "creep_die"
  }
 }
 		// Creature Data
		//----------------------------------------------------------------
		"Creature"
		{
			//Level Up
			"HPGain"					"50"
			"DamageGain"				"2"
			"ArmorGain"					"0.25"
			"MagicResistGain"			"0.1"
			"MoveSpeedGain"				"1"
			"BountyGain"				"3"
			"XPGain"					"15"
		}
	}
Вот этот кусок я вставил в свой код
Код:
		 "OnOwnerDied"
 {
  "RunScript"
  {
   "ScriptFile"  "addon_game_mode.lua"
   "Function"   "creep_die"
  }
 }
[/quote]

Неправильно. Не туда добавил. Нужно не в юнита, а в способность добавлять. А после этого, способность давать юниту, или сразу прописать в npc_unit_custom в блок Abilities. Судя по всему, тебе еще рановато делать это ;D Ты даже основ не изучил, а уже крипасов, которые бегают, делать собрался. Да еще отлавливать их смерть.
 
Последнее редактирование модератором:
Ага затупил вот так
npc_units_custom пример 1 юнита
Код:
	"example_unit_1"	
	{
		// General
		//----------------------------------------------------------------
		"Model"						"models/creeps/neutral_creeps/n_creep_gnoll/n_creep_gnoll_frost.vmdl"	// Model.
		"BaseClass"					"npc_dota_creature"
		"SoundSet"					"n_creep_Ranged"
		"GameSoundsFile"			"soundevents/game_sounds_creeps.vsndevts"
		"Level"						"1"
		"ModelScale" 				".9"

		// Abilities
		//----------------------------------------------------------------
		"Ability1"					"creep_die"			// Ability 1
		"Ability2"					""			// Ability 2
		"Ability3"					""			// Ability 3
		"Ability4"					""			// Ability 4

		// Armor
		//----------------------------------------------------------------
		"ArmorPhysical"				"10"			// Physical protection.

		// Attack
		//----------------------------------------------------------------
		"AttackCapabilities"		"DOTA_UNIT_CAP_RANGED_ATTACK"
		"AttackDamageMin"			"30"		// Damage range min.
		"AttackDamageMax"			"36"		// Damage range max.
		"AttackRate"				"1.6"		// Speed of attack.
		"AttackAnimationPoint"		"0.4"		// Normalized time in animation cycle to attack.
		"AttackAcquisitionRange"	"800"		// Range within a target can be acquired.
		"AttackRange"				"500"		// Range within a target can be attacked.
		"ProjectileModel"			"particles/neutral_fx/gnoll_base_attack.vpcf" // Particle system model for projectile.
		"ProjectileSpeed"			"1500"		// Speed of projectile.		   

		// Bounds
		//----------------------------------------------------------------
		"RingRadius"				"40"
		"HealthBarOffset"			"170"

		// Bounty
		//----------------------------------------------------------------
		"BountyXP"					"24"		// Experience earn.
		"BountyGoldMin"				"21"		// Gold earned min.
		"BountyGoldMax"				"29"		// Gold earned max.

		// Movement
		//----------------------------------------------------------------
		"MovementCapabilities"		"DOTA_UNIT_CAP_MOVE_GROUND"
		"MovementSpeed"				"270"		// Speed.			

		// Status
		//----------------------------------------------------------------
		"StatusHealth"				"75"		// Base health.
		"StatusHealthRegen"			"0.5"		// Health regeneration rate.
		"StatusMana"				"0"			// Base mana.
		"StatusManaRegen"			"0.0"		// Mana regeneration rate.		 
		
		// Vision
		//----------------------------------------------------------------
		"VisionDaytimeRange"		"400"		// Range of vision during day light.
		"VisionNighttimeRange"		"400"		// Range of vision at night time.

		// Team
		//----------------------------------------------------------------
		"TeamName"					"DOTA_TEAM_GOODGUYS"						// Team name.
		"CombatClassAttack"			"DOTA_COMBAT_CLASS_ATTACK_PIERCE"
		"CombatClassDefend"			"DOTA_COMBAT_CLASS_DEFEND_BASIC"
		"UnitRelationshipClass"		"DOTA_NPC_UNIT_RELATIONSHIP_TYPE_DEFAULT"
		// Creature Data
		//----------------------------------------------------------------
		"Creature"
		{
			//Level Up
			"HPGain"					"50"
			"DamageGain"				"2"
			"ArmorGain"					"0.25"
			"MagicResistGain"			"0.1"
			"MoveSpeedGain"				"1"
			"BountyGain"				"3"
			"XPGain"					"15"
		}
	}
А точнее
Код:
"Ability1"					"creep_die"
npc_abilites_custom
Код:
// Dota Heroes File
"DOTAAbilities"
{
	"Version"		"1"

	//=================================================================================================================
	// Templar Assassin: Refraction Holdout
	//=================================================================================================================
	"creep_die"
{
 "BaseClass"        "ability_datadriven"
 "AbilityBehavior"     "DOTA_ABILITY_BEHAVIOR_PASSIVE | DOTA_ABILITY_BEHAVIOR_HIDDEN"
 "AbilityTextureName"    ""
 "AbilityCastRange"    "0"
 "AbilityCastPoint"    "0"
 "AbilityCooldown"     "0"
 "OnOwnerDied"
 {
  "RunScript"
  {
   "ScriptFile"  "addon_game_mode.lua"
   "Function"   "creep_die"
  }
 }
}
"templar_assassin_refraction_holdout"
	{
		// General
		//-------------------------------------------------------------------------------------------------------------
		"AbilityBehavior"				"DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE"
		"AbilityUnitDamageType"			"DAMAGE_TYPE_PHYSICAL"	

		// Casting
		//-------------------------------------------------------------------------------------------------------------
		"AbilityCastPoint"				"0.0 0.0 0.0 0.0"

		// Time		
		//-------------------------------------------------------------------------------------------------------------
		"AbilityCooldown"				"17.0 17.0 17.0 17.0"

		// Cost
		//-------------------------------------------------------------------------------------------------------------
		"AbilityManaCost"				"100"
		
		// Special
		//-------------------------------------------------------------------------------------------------------------
		"AbilitySpecial"
		{
			"01"
			{
				"var_type"					"FIELD_INTEGER"
				"damage_absorb"				"200 300 400 500"
			}
			"02"
			{
				"var_type"					"FIELD_INTEGER"
				"bonus_damage"				"20 40 60 80"
			}
			"04"
			{
				"var_type"					"FIELD_FLOAT"
				"duration"					"17.0 17.0 17.0 17.0"
			}
		}
	}
}
А точнее
Код:
	"creep_die"
{
 "BaseClass"        "ability_datadriven"
 "AbilityBehavior"     "DOTA_ABILITY_BEHAVIOR_PASSIVE | DOTA_ABILITY_BEHAVIOR_HIDDEN"
 "AbilityTextureName"    ""
 "AbilityCastRange"    "0"
 "AbilityCastPoint"    "0"
 "AbilityCooldown"     "0"
 "OnOwnerDied"
 {
  "RunScript"
  {
   "ScriptFile"  "addon_game_mode.lua"
   "Function"   "creep_die"
  }
 }
}
Однако ничего не поменялось.Сообщение в консоли тоже и новая волна не идет.
 
Последнее редактирование модератором:
Роман, Насколько я знаю, вот этого делать нельзя:
Код:
"ScriptFile"  "addon_game_mode.lua"
Файлик должен быть отдельный, и в нем твоя функция.
 
Последнее редактирование модератором:
Роман, эм. Почему у тебя способность твоя написана в npc_heroes_custom? ???
Способности прописываются в npc_abilities_custom.
Хотя, ты, видимо, просто опечатался.
 
[quote author=RecoveryIt link=topic=958.msg4868#msg4868 date=1465763269]
Роман, Насколько я знаю, вот этого делать нельзя:
Код:
"ScriptFile"  "addon_game_mode.lua"
Файлик должен быть отдельный, и в нем твоя функция.
[/quote]
Спасибо так пойдет?
addon_game_mode.lua
Код:
require( 'timers' )
require( 'barebones' )
require('spawner')
GLOBAL_MOBS = 4
GAME_ROUND = 0
MAX_ROUNDS = 5
ROUND_DURATION = 10 
ROUND_UNITS = 2
function Precache( context )
	print("[BAREBONES] Performing pre-load precache")
	PrecacheResource("particle", "particles/econ/generic/generic_aoe_explosion_sphere_1/generic_aoe_explosion_sphere_1.vpcf", context)
	PrecacheResource("particle_folder", "particles/test_particle", context)
	PrecacheResource("model_folder", "particles/heroes/antimage", context)
	PrecacheResource("model", "particles/heroes/viper/viper.vmdl", context)
	PrecacheModel("models/heroes/viper/viper.vmdl", context)
	PrecacheResource("soundfile", "soundevents/game_sounds_heroes/game_sounds_gyrocopter.vsndevts", context)
	PrecacheUnitByNameSync("example_unit_1", context)
	PrecacheItemByNameSync("example_ability", context)
	PrecacheItemByNameSync("item_example_item", context)
	PrecacheUnitByNameSync("npc_dota_hero_ancient_apparition", context)
	PrecacheUnitByNameSync("npc_dota_hero_enigma", context)
end
function Activate()
	GameRules.GameMode = GameMode()
	GameRules.GameMode:InitGameMode()
end
function GameMode:OnGameInProgress()
   local point = Entities:FindByName( nil, "spawnerino"):GetAbsOrigin()
   local waypoint = Entities:FindByName( nil, "way1")
   local return_time = 10
   Timers:CreateTimer(10, function()		 
		 GAME_ROUND = GAME_ROUND + 1
		 if GAME_ROUND == MAX_ROUNDS then
      return_time = nil
     end
     Say(nil,"Wave №" .. GAME_ROUND, false)
          if GAME_ROUND == 1 then
     	GLOBAL_MOBS = 4
     	end
     for i=1, ROUND_UNITS do
		  local unit = CreateUnitByName( "example_unit_" .. GAME_ROUND, point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
		  unit:SetInitialGoalEntity( waypoint )
		  local uni = CreateUnitByName( "example_unit_" .. GAME_ROUND + 1, point + RandomVector( RandomFloat( 0, 200 ) ), true, nil, nil, DOTA_TEAM_GOODGUYS )
		  	uni:SetInitialGoalEntity( waypoint )
     end   
     	if GLOBAL_MOBS == 0 then
     return return_time
   end
   end)
end
А точнее
Код:
require('spawner')
spawner.lua
Код:
function creep_die(keys)
 GLOBAL_MOBS = GLOBAL_MOBS - 1
end
npc_abilities_custom
Код:
// Dota Heroes File
"DOTAAbilities"
{
	"Version"		"1"

	//=================================================================================================================
	// Templar Assassin: Refraction Holdout
	//=================================================================================================================
	"creep_die"
{
 "BaseClass"        "ability_datadriven"
 "AbilityBehavior"     "DOTA_ABILITY_BEHAVIOR_PASSIVE | DOTA_ABILITY_BEHAVIOR_HIDDEN"
 "AbilityTextureName"    ""
 "AbilityCastRange"    "0"
 "AbilityCastPoint"    "0"
 "AbilityCooldown"     "0"
 "OnOwnerDied"
 {
  "RunScript"
  {
   "ScriptFile"  "spawner.lua"
   "Function"   "creep_die"
  }
 }
}
"templar_assassin_refraction_holdout"
	{
		// General
		//-------------------------------------------------------------------------------------------------------------
		"AbilityBehavior"				"DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE"
		"AbilityUnitDamageType"			"DAMAGE_TYPE_PHYSICAL"	

		// Casting
		//-------------------------------------------------------------------------------------------------------------
		"AbilityCastPoint"				"0.0 0.0 0.0 0.0"

		// Time		
		//-------------------------------------------------------------------------------------------------------------
		"AbilityCooldown"				"17.0 17.0 17.0 17.0"

		// Cost
		//-------------------------------------------------------------------------------------------------------------
		"AbilityManaCost"				"100"
		
		// Special
		//-------------------------------------------------------------------------------------------------------------
		"AbilitySpecial"
		{
			"01"
			{
				"var_type"					"FIELD_INTEGER"
				"damage_absorb"				"200 300 400 500"
			}
			"02"
			{
				"var_type"					"FIELD_INTEGER"
				"bonus_damage"				"20 40 60 80"
			}
			"04"
			{
				"var_type"					"FIELD_FLOAT"
				"duration"					"17.0 17.0 17.0 17.0"
			}
		}
	}
}
А точнее
Код:
	"creep_die"
{
 "BaseClass"        "ability_datadriven"
 "AbilityBehavior"     "DOTA_ABILITY_BEHAVIOR_PASSIVE | DOTA_ABILITY_BEHAVIOR_HIDDEN"
 "AbilityTextureName"    ""
 "AbilityCastRange"    "0"
 "AbilityCastPoint"    "0"
 "AbilityCooldown"     "0"
 "OnOwnerDied"
 {
  "RunScript"
  {
   "ScriptFile"  "spawner.lua"
   "Function"   "creep_die"
  }
 }
}
А ещё точнее :)
Код:
"ScriptFile"  "spawner.lua"
Так пойдет?
 
Последнее редактирование модератором:
[quote author=RecoveryIt link=topic=958.msg4871#msg4871 date=1465764049]
Роман, Пробуй.
[/quote]
Уже попробовал вот новые ошибочки ;D
Код:
[  VScript       ]: [BAREBONES] Hero spawned in game for first time -- npc_dota_hero_abaddon
[ W General       ]: Could not find data for item! item_example_item
[  Server        ]: PR:SetPlayerReservedState 0:[U:1:289175028] false
[  Server        ]: PR:SetSelectedHero 0:[U:1:289175028] npc_dota_hero_abaddon(102)
[  VScript       ]: [BAREBONES] OnPlayerPickHero
[  VScript       ]: {
[  VScript       ]:  player             	= 1 (number)
[  VScript       ]:  heroindex            	= 233 (number)
[  VScript       ]:  hero              	= "npc_dota_hero_abaddon" (string)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnPlayerLearnedAbility
[  VScript       ]: {
[  VScript       ]:  player             	= 1 (number)
[  VScript       ]:  abilityname           	= "abaddon_aphotic_shield" (string)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] Performing Post-Load precache
[  VScript       ]: [BAREBONES] All Players have loaded into the game
[  VScript       ]: [BAREBONES] AbilityUsed
[  VScript       ]: {
[  VScript       ]:  abilityname           	= "abaddon_aphotic_shield" (string)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] NPC Spawned
[  VScript       ]: {
[  VScript       ]:  entindex            	= 246 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] NPC Spawned
[  VScript       ]: {
[  VScript       ]:  entindex            	= 248 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] NPC Spawned
[  VScript       ]: {
[  VScript       ]:  entindex            	= 250 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] NPC Spawned
[  VScript       ]: {
[  VScript       ]:  entindex            	= 252 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  Developer      ]: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[  Developer      ]: stack traceback:
[  Developer      ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[ W VScript       ]: Script Runtime Error: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[ W VScript       ]: stack traceback:
[ W VScript       ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[  VScript       ]: [BAREBONES] OnLastHit
[  VScript       ]: {
[  VScript       ]:  EntKilled            	= 250 (number)
[  VScript       ]:  FirstBlood           	= 0 (number)
[  VScript       ]:  TowerKill            	= 0 (number)
[  VScript       ]:  HeroKill            	= 0 (number)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnEntityKilled Called
[  VScript       ]: {
[  VScript       ]:  entindex_inflictor       	= 235 (number)
[  VScript       ]:  damagebits           	= 0 (number)
[  VScript       ]:  entindex_killed         	= 250 (number)
[  VScript       ]:  entindex_attacker        	= 233 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  Developer      ]: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[  Developer      ]: stack traceback:
[  Developer      ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[ W VScript       ]: Script Runtime Error: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[ W VScript       ]: stack traceback:
[ W VScript       ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[  VScript       ]: [BAREBONES] OnLastHit
[  VScript       ]: {
[  VScript       ]:  EntKilled            	= 252 (number)
[  VScript       ]:  FirstBlood           	= 0 (number)
[  VScript       ]:  TowerKill            	= 0 (number)
[  VScript       ]:  HeroKill            	= 0 (number)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnEntityKilled Called
[  VScript       ]: {
[  VScript       ]:  entindex_inflictor       	= 235 (number)
[  VScript       ]:  damagebits           	= 0 (number)
[  VScript       ]:  entindex_killed         	= 252 (number)
[  VScript       ]:  entindex_attacker        	= 233 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  Developer      ]: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[  Developer      ]: stack traceback:
[  Developer      ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[ W VScript       ]: Script Runtime Error: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[ W VScript       ]: stack traceback:
[ W VScript       ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[  VScript       ]: [BAREBONES] OnLastHit
[  VScript       ]: {
[  VScript       ]:  EntKilled            	= 246 (number)
[  VScript       ]:  FirstBlood           	= 0 (number)
[  VScript       ]:  TowerKill            	= 0 (number)
[  VScript       ]:  HeroKill            	= 0 (number)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnEntityKilled Called
[  VScript       ]: {
[  VScript       ]:  entindex_inflictor       	= 235 (number)
[  VScript       ]:  damagebits           	= 0 (number)
[  VScript       ]:  entindex_killed         	= 246 (number)
[  VScript       ]:  entindex_attacker        	= 233 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  Developer      ]: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[  Developer      ]: stack traceback:
[  Developer      ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[ W VScript       ]: Script Runtime Error: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[ W VScript       ]: stack traceback:
[ W VScript       ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[  VScript       ]: [BAREBONES] OnLastHit
[  VScript       ]: {
[  VScript       ]:  EntKilled            	= 248 (number)
[  VScript       ]:  FirstBlood           	= 0 (number)
[  VScript       ]:  TowerKill            	= 0 (number)
[  VScript       ]:  HeroKill            	= 0 (number)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnEntityKilled Called
[  VScript       ]: {
[  VScript       ]:  entindex_inflictor       	= 235 (number)
[  VScript       ]:  damagebits           	= 0 (number)
[  VScript       ]:  entindex_killed         	= 248 (number)
[  VScript       ]:  entindex_attacker        	= 233 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
 
Последнее редактирование модератором:
[quote author=Роман link=topic=958.msg4872#msg4872 date=1465764149]
Уже попробовал вот новые ошибочки ;D
Код:
[  VScript       ]: [BAREBONES] Hero spawned in game for first time -- npc_dota_hero_abaddon
[ W General       ]: Could not find data for item! item_example_item
[  Server        ]: PR:SetPlayerReservedState 0:[U:1:289175028] false
[  Server        ]: PR:SetSelectedHero 0:[U:1:289175028] npc_dota_hero_abaddon(102)
[  VScript       ]: [BAREBONES] OnPlayerPickHero
[  VScript       ]: {
[  VScript       ]:  player             	= 1 (number)
[  VScript       ]:  heroindex            	= 233 (number)
[  VScript       ]:  hero              	= "npc_dota_hero_abaddon" (string)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnPlayerLearnedAbility
[  VScript       ]: {
[  VScript       ]:  player             	= 1 (number)
[  VScript       ]:  abilityname           	= "abaddon_aphotic_shield" (string)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] Performing Post-Load precache
[  VScript       ]: [BAREBONES] All Players have loaded into the game
[  VScript       ]: [BAREBONES] AbilityUsed
[  VScript       ]: {
[  VScript       ]:  abilityname           	= "abaddon_aphotic_shield" (string)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] NPC Spawned
[  VScript       ]: {
[  VScript       ]:  entindex            	= 246 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] NPC Spawned
[  VScript       ]: {
[  VScript       ]:  entindex            	= 248 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] NPC Spawned
[  VScript       ]: {
[  VScript       ]:  entindex            	= 250 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] NPC Spawned
[  VScript       ]: {
[  VScript       ]:  entindex            	= 252 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  Developer      ]: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[  Developer      ]: stack traceback:
[  Developer      ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[ W VScript       ]: Script Runtime Error: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[ W VScript       ]: stack traceback:
[ W VScript       ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[  VScript       ]: [BAREBONES] OnLastHit
[  VScript       ]: {
[  VScript       ]:  EntKilled            	= 250 (number)
[  VScript       ]:  FirstBlood           	= 0 (number)
[  VScript       ]:  TowerKill            	= 0 (number)
[  VScript       ]:  HeroKill            	= 0 (number)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnEntityKilled Called
[  VScript       ]: {
[  VScript       ]:  entindex_inflictor       	= 235 (number)
[  VScript       ]:  damagebits           	= 0 (number)
[  VScript       ]:  entindex_killed         	= 250 (number)
[  VScript       ]:  entindex_attacker        	= 233 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  Developer      ]: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[  Developer      ]: stack traceback:
[  Developer      ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[ W VScript       ]: Script Runtime Error: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[ W VScript       ]: stack traceback:
[ W VScript       ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[  VScript       ]: [BAREBONES] OnLastHit
[  VScript       ]: {
[  VScript       ]:  EntKilled            	= 252 (number)
[  VScript       ]:  FirstBlood           	= 0 (number)
[  VScript       ]:  TowerKill            	= 0 (number)
[  VScript       ]:  HeroKill            	= 0 (number)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnEntityKilled Called
[  VScript       ]: {
[  VScript       ]:  entindex_inflictor       	= 235 (number)
[  VScript       ]:  damagebits           	= 0 (number)
[  VScript       ]:  entindex_killed         	= 252 (number)
[  VScript       ]:  entindex_attacker        	= 233 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  Developer      ]: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[  Developer      ]: stack traceback:
[  Developer      ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[ W VScript       ]: Script Runtime Error: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[ W VScript       ]: stack traceback:
[ W VScript       ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[  VScript       ]: [BAREBONES] OnLastHit
[  VScript       ]: {
[  VScript       ]:  EntKilled            	= 246 (number)
[  VScript       ]:  FirstBlood           	= 0 (number)
[  VScript       ]:  TowerKill            	= 0 (number)
[  VScript       ]:  HeroKill            	= 0 (number)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnEntityKilled Called
[  VScript       ]: {
[  VScript       ]:  entindex_inflictor       	= 235 (number)
[  VScript       ]:  damagebits           	= 0 (number)
[  VScript       ]:  entindex_killed         	= 246 (number)
[  VScript       ]:  entindex_attacker        	= 233 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  Developer      ]: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[  Developer      ]: stack traceback:
[  Developer      ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[ W VScript       ]: Script Runtime Error: ...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: attempt to perform arithmetic on global 'GLOBAL_MOBS' (a nil value)
[ W VScript       ]: stack traceback:
[ W VScript       ]: 	...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:2: in function <...eta\game\dota_addons\gkpdfd\scripts\vscripts\spawner.lua:1>
[  VScript       ]: [BAREBONES] OnLastHit
[  VScript       ]: {
[  VScript       ]:  EntKilled            	= 248 (number)
[  VScript       ]:  FirstBlood           	= 0 (number)
[  VScript       ]:  TowerKill            	= 0 (number)
[  VScript       ]:  HeroKill            	= 0 (number)
[  VScript       ]:  PlayerID            	= 0 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[  VScript       ]: [BAREBONES] OnEntityKilled Called
[  VScript       ]: {
[  VScript       ]:  entindex_inflictor       	= 235 (number)
[  VScript       ]:  damagebits           	= 0 (number)
[  VScript       ]:  entindex_killed         	= 248 (number)
[  VScript       ]:  entindex_attacker        	= 233 (number)
[  VScript       ]:  splitscreenplayer        	= -1 (number)
[  VScript       ]: }
[/quote]

Поменяй GLOBAL_MOBS na GameMode.WaveCreeps , везде где используешь.

GameMode.WaveCreeps = 4
GameMode.WaveCreeps = GameMode.WaveCreeps - 1
и так далее
 
Последнее редактирование модератором:
Значит где то , что то пропустил. Ищи.
Создал новый проэкт получилось так
addon_game_mode.lua
Код:
-- Generated from template
require('spawner')
GameMode.WaveCreeps = 1
if CAddonTemplateGameMode == nil then
	CAddonTemplateGameMode = class({})
end

function Precache( context )
	--[[
		Precache things we know we'll use. Possible file types include (but not limited to):
			PrecacheResource( "model", "*.vmdl", context )
			PrecacheResource( "soundfile", "*.vsndevts", context )
			PrecacheResource( "particle", "*.vpcf", context )
			PrecacheResource( "particle_folder", "particles/folder", context )
	]]
end

-- Create the game mode when we activate
function Activate()
	GameRules.AddonTemplate = CAddonTemplateGameMode()
	GameRules.AddonTemplate:InitGameMode()
end

function CAddonTemplateGameMode:InitGameMode()
		if GameMode.WaveCreeps == 0 then
		print("lol")
	end
	print( "Template addon is loaded." )
	GameRules:GetGameModeEntity():SetThink( "OnThink", self, "GlobalThink", 2 )
end

-- Evaluate the state of the game
function CAddonTemplateGameMode:OnThink()
	if GameRules:State_Get() == DOTA_GAMERULES_STATE_GAME_IN_PROGRESS then
		--print( "Template addon script is running." )
	elseif GameRules:State_Get() >= DOTA_GAMERULES_STATE_POST_GAME then
		return nil
	end
	return 1
end
spawner.lua
Код:
function creep_die(keys)
 GameMode.WaveCreeps = GameMode.WaveCreeps - 1
end
npc_heroes_custom
Код:
// Dota Heroes File
// NOTE: This is not for creating new heroes, this is for taking a currently existing hero as a template and overriding
// the specified key-value combinations. Use override_hero <hero_to_override> for this.
"DOTAHeroes"
{
	"npc_dota_hero_pudge"
	{
		"Ability1"		"creep_die"
	}
	//=================================================================================================================
	// HERO: Templar Assassin
	//=================================================================================================================
	"npc_dota_hero_templar_assassin_template"
	{
		"override_hero"				"npc_dota_hero_templar_assassin"			// Hero to override
		"Ability1"					"templar_assassin_refraction_holdout"		// Ability 1
		"VisionNighttimeRange"		"1800"										// Range of vision at night time.
	}
}
npc_abilities_custom
Код:
// Dota Heroes File
"DOTAAbilities"
{
	"Version"		"1"

	//=================================================================================================================
	// Templar Assassin: Refraction Holdout
	//=================================================================================================================
		"creep_die"
{
 "BaseClass"        "ability_datadriven"
 "AbilityBehavior"     "DOTA_ABILITY_BEHAVIOR_PASSIVE | DOTA_ABILITY_BEHAVIOR_HIDDEN"
 "AbilityTextureName"    ""
 "AbilityCastRange"    "0"
 "AbilityCastPoint"    "0"
 "AbilityCooldown"     "0"
 "OnOwnerDied"
 {
  "RunScript"
  {
   "ScriptFile"  "spawner.lua"
   "Function"   "creep_die"
  }
 }
}
"templar_assassin_refraction_holdout"
	{
		// General
		//-------------------------------------------------------------------------------------------------------------
		"AbilityBehavior"				"DOTA_ABILITY_BEHAVIOR_NO_TARGET | DOTA_ABILITY_BEHAVIOR_IMMEDIATE"
		"AbilityUnitDamageType"			"DAMAGE_TYPE_PHYSICAL"	

		// Casting
		//-------------------------------------------------------------------------------------------------------------
		"AbilityCastPoint"				"0.0 0.0 0.0 0.0"

		// Time		
		//-------------------------------------------------------------------------------------------------------------
		"AbilityCooldown"				"17.0 17.0 17.0 17.0"

		// Cost
		//-------------------------------------------------------------------------------------------------------------
		"AbilityManaCost"				"100"
		
		// Special
		//-------------------------------------------------------------------------------------------------------------
		"AbilitySpecial"
		{
			"01"
			{
				"var_type"					"FIELD_INTEGER"
				"damage_absorb"				"200 300 400 500"
			}
			"02"
			{
				"var_type"					"FIELD_INTEGER"
				"bonus_damage"				"20 40 60 80"
			}
			"04"
			{
				"var_type"					"FIELD_FLOAT"
				"duration"					"17.0 17.0 17.0 17.0"
			}
		}
	}
}
Опять ошибка в новом проэкте,скорей всего мне скинули кривой код...
 
Последнее редактирование модератором:
[quote author=I_GRIN_I link=topic=958.msg4890#msg4890 date=1465818003]
Роман, вообще посмотри вот тут: http://dota2.ru/forum/threads/gajd-po-scripting-chast-2.602694/
Про динамический лагерь.
[/quote]
Да я уже смотрел этот гайд проблема в том ,что этот гайд сделан через onentitykilled ,а я хотел бы доделать через скрытую способность раз уж начал ,хотя скорей всего прийдется делать через onentitykilled.
 
Реклама: