Вывод кастомной ошибки на худ

  • Автор темы Автор темы Danis
  • Дата начала Дата начала
[quote author=MahouShoujo link=topic=1143.msg6796#msg6796 date=1478190368]
Смотрим как реализовано здесь - https://github.com/DoctorGester/cru...cripts/vscripts/abilities/tinker/tinker_e.lua

Ошибку не покажет вообще если токена нет. Сами токены пишутся сюда https://github.com/DoctorGester/crumbling-island-arena/blob/master/game/resource/addon_english.txt (не в локализацию панорамы)
[/quote]
И чо? сделал так же только подстроил для себя и не работает нифига.
 
Ты учел что для способностей с разным типом целей используются разные методы?
Код:
CastFilterResultTarget( hTarget ) -- hTarget is the targeted NPC.
GetCustomCastErrorTarget( hTarget) -- hTarget is the targeted NPC. 
 
CastFilterResultLocation( vLocation ) -- vLocation is the targeted location.
GetCustomCastErrorLocation( vLocation ) -- vLocation is the targeted location.
 
CastFilterResult() -- No target abilities
GetCustomCastError() -- No target abilities
 
[quote author=ZLOY link=topic=1143.msg6801#msg6801 date=1478199641]
Ты учел что для способностей с разным типом целей используются разные методы?
Код:
CastFilterResultTarget( hTarget ) -- hTarget is the targeted NPC.
GetCustomCastErrorTarget( hTarget) -- hTarget is the targeted NPC. 
 
CastFilterResultLocation( vLocation ) -- vLocation is the targeted location.
GetCustomCastErrorLocation( vLocation ) -- vLocation is the targeted location.
 
CastFilterResult() -- No target abilities
GetCustomCastError() -- No target abilities
[/quote]

да
Код:
function item_dominator:CastFilterResult( hTarget )
	if IsServer() then
		print("Target"..hTarget:GetUnitName())
		if hTarget:IsAncient() then 
			return UF_FAIL_ANCIENT 
		elseif hTarget:IsMagicImmune() then 
			return UF_FAIL_MAGIC_IMMUNE_ENEMY 
		elseif IsBoss(hTarget) then 
			return UF_FAIL_CUSTOM
		elseif hTarget.dominated then 
			return UF_FAIL_DOMINATED
		end
	end
	return UF_SUCCESS
end

function item_dominator:GetCustomCastError()
	local result = self:CastFilterResult()
	if result == UF_FAIL_CUSTOM then return "#dota_hud_error_custom_is_boss" end
	return ""
end
 
Последнее редактирование модератором:
Попробуй внимательно прочитать комментарии к функциям в моем прошлом посте
 
Попробуй внимательно прочитать комментарии к функциям в моем прошлом посте
Типа делать так? если так то тоже не работает.
Код:
function item_dominator:GetCustomCastError()
	local result = self:CastFilterResult()
	if result == UF_FAIL_CUSTOM then return "dota_hud_error_custom_is_boss" end
   return ""
end
 
Последнее редактирование модератором:
Поясняю на русском.
Если твоя абилка применяется на юнитов, то ты используешь названия методов CastFilterResultTarget и GetCustomCastErrorTarget, вместо CastFilterResult и GetCustomCastError
 
ZLOY, Спасибо, работает, просто подумал что ты про другое свое сообщение говорил.
 
Реклама: