XGM Forum
Сайт - Статьи - Проекты - Ресурсы - Блоги

Форуме в режиме ТОЛЬКО ЧТЕНИЕ. Вы можете задать вопросы в Q/A на сайте, либо создать свой проект или ресурс.
Вернуться   XGM Forum > Warcraft> Академия: форум для вопросов> Jass
Ник
Пароль
Войти через VK в один клик
Сайт использует только имя.

Ответ
 
sleepw

offline
Опыт: 8,449
Активность:
Переменная 2 стринг
Каг заменить название переменной обычным стрингом? И для чего это используется?
Может и не правильные вопросы задал но вот меня интересует это:
шозанах и зочем?

Код:
local unit lTD=GetUnit(H2Tx(GetTriggeringTrigger()),"NightStalker")

и шо это за функция х2т?
Старый 05.03.2008, 16:08
J
expert
offline
Опыт: 48,447
Активность:
где ты ее хоть увидел?
Старый 05.03.2008, 16:11
DeT

offline
Опыт: 5,715
Активность:
эм....это кусок вдрнного кода наскока я понимаю...

H2Tx -RB функция
тут скорее всего из кеша получается ссылка на юнита, соотетствующего выплоненному триггеру

DeT добавил:
Жон...он порусски H как Х прочитал :)
Старый 05.03.2008, 16:11
J
expert
offline
Опыт: 48,447
Активность:
ну вообщем чисто из здравого смысла я подозревают что это такие функции...
Код:
constant function H2Tx takes handle h returns integer
    return h
    return 0
endfunction

constant function I2U takes integer h returns unit
    return h
    return null
endfunction  

function GetUnit takes integer h, string str returns unit
    return I2U(GetStoredInteger(udg_cache, I2S(h), str))
endfunction
Старый 05.03.2008, 16:13
sleepw

offline
Опыт: 8,449
Активность:
DeT
а шо оно както читаецо по другому? =\

Код:
// OpenDota 6.41 deprotected by NETRAT and DioD
// inspired by everyone who posted on forum threads and feedback page
// based on OpenDota 6.32b, deprotected by DimonT, NETRAT and TheBloodiest
// http://dimon.xgm.ru/opendota/
// Visit our modmaking community at http://xgm.ru/

// Objects used:
// 'A086' = Hunter in the Night (Night Stalker : Balanar)
// 'A08E' = Crippling Fear (Night Stalker : Balanar)
// 'S00A' = Hunter in the Night
// 'A08C' = Crippling Fear

// DEBUG Trigger Number : 315
function Trig_Crippling_Fear_Conditions takes nothing returns boolean
return(GetLearnedSkill()=='A086'or GetLearnedSkill()=='A08E')and IsUnitIllusion(GetTriggerUnit())==false
endfunction

function NightStalkMain takes nothing returns nothing
local unit lTD=GetUnit(H2Tx(GetTriggeringTrigger()),"NightStalker")
if(lTD!=null and IsDay()and GetUnitState(lTD,UNIT_STATE_LIFE)>1)then
call SetUnitAbilityLevel(lTD,'S00A',5)
call SetUnitAbilityLevel(lTD,'A08C',5)
elseif(lTD!=null and IsDay()==false and GetUnitState(lTD,UNIT_STATE_LIFE)>1)then
call SetUnitAbilityLevel(lTD,'S00A',GetUnitAbilityLevel(lTD,'A086'))
call SetUnitAbilityLevel(lTD,'A08C',GetUnitAbilityLevel(lTD,'A08E'))
endif
endfunction

function Trig_Crippling_Fear_Actions takes nothing returns nothing
local string lf5=H2Tx(GetTriggerUnit())
local trigger ltt
if(GetBoolean(lf5,"NightStalkerAlreadyLearned")==false)then
call SetBoolean(lf5,"NightStalkerAlreadyLearned",true)
set ltt=CreateTrigger()
call TriggerRegisterTimerEventPeriodic(ltt,2.)
call TriggerRegisterGameStateEventTimeOfDay(ltt,LESS_THAN,6.)
call TriggerRegisterGameStateEventTimeOfDay(ltt,GREATER_THAN,18.)
call TriggerAddAction(ltt,function NightStalkMain)
call SetHandle(H2Tx(ltt),"NightStalker",GetTriggerUnit())
endif
if(GetLearnedSkill()=='A086')then
call UnitAddAbility(GetTriggerUnit(),'S00A')
if(IsDay())then
call SetUnitAbilityLevel(GetTriggerUnit(),'S00A',5)
else
call SetUnitAbilityLevel(GetTriggerUnit(),'S00A',GetUnitAbilityLevel(GetTriggerUnit()  ,'A086'))
endif
endif
if(GetLearnedSkill()=='A08E')then
call UnitAddAbility(GetTriggerUnit(),'A08C')
if(IsDay())then
call SetUnitAbilityLevel(GetTriggerUnit(),'A08C',5)
else
call SetUnitAbilityLevel(GetTriggerUnit(),'A08C',GetUnitAbilityLevel(GetTriggerUnit()  ,'A08E'))
endif
endif
endfunction

function StartTrigger_Crippling_Fear takes nothing returns nothing
set gg_trg_Crippling_Fear=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Crippling_Fear,EVENT_PLAYER_HERO_SKILL)
call TriggerAddCondition(gg_trg_Crippling_Fear,Condition(function Trig_Crippling_Fear_Conditions))
call TriggerAddAction(gg_trg_Crippling_Fear,function Trig_Crippling_Fear_Actions)
endfunction

function InitTrig_Crippling_Fear takes nothing returns nothing
endfunction
Старый 05.03.2008, 16:14
DeT

offline
Опыт: 5,715
Активность:
ну не наю..жон расписал как по смыслу должно быть)
Старый 05.03.2008, 16:16
sleepw

offline
Опыт: 8,449
Активность:
и объясни плиз зочем там второй тригер с ивентом?
Старый 05.03.2008, 16:16
J
expert
offline
Опыт: 48,447
Активность:
и вообще H2Tx, какоето левое название, обычно ее назвают H2I, по крайне мере в статьях всегда юзается именно такое название
Старый 05.03.2008, 16:17
sleepw

offline
Опыт: 8,449
Активность:
вот из хендл?
Старый 05.03.2008, 16:19
J
expert
offline
Опыт: 48,447
Активность:
http://xgm.guru/articles.php?section=wc3&name=using_game_cache_with_jass

Jon добавил:
а про хендл написано и сдесь и сдесь в самом начале
Старый 05.03.2008, 16:22
sleepw

offline
Опыт: 8,449
Активность:
эх.. сенги.. будем читадь:)
Старый 05.03.2008, 16:35
Лось

offline
Опыт: 7,223
Активность:
Код:
function H2Tx takes handle pTarg returns string
    return I2S(H2Ix(pTarg))
endfunction

Вообше в опен доте есть эта ф-ия.
Старый 05.03.2008, 16:40
J
expert
offline
Опыт: 48,447
Активность:
ну тогда чтото вроде
» этого
Код:
constant function H2Ix takes handle h returns integer
    return h
    return 0
endfunction

constant function I2U takes integer h returns unit
    return h
    return null
endfunction  

constant function H2Tx takes handle pTarg returns string
    return I2S(H2Ix(pTarg))
endfunction

function GetUnit takes string k1, string k2 returns unit
    return I2U(GetStoredInteger(udg_cache, k1, k2))
endfunction


Jon добавил:
хотя непонятно почему у многих такое страсное желание впихнуть букву "x" во все что можно прочитать)
Старый 05.03.2008, 16:45
ZLOBICH
Kicked by XimikS
offline
Опыт: 4,727
Активность:
объясните мне идиоту как в карте могут существовать две функции с одинаковыми именами плз =\
Старый 05.03.2008, 17:38
J
expert
offline
Опыт: 48,447
Активность:
ZLOBICH никак
Старый 05.03.2008, 17:40
ZLOBICH
Kicked by XimikS
offline
Опыт: 4,727
Активность:
Цитата:
constant function H2Ix takes handle h returns integer
return h
return 0
endfunction


constant function H2Tx takes handle pTarg returns string
return I2S(H2Ix(pTarg))
endfunction
Старый 05.03.2008, 17:52
J
expert
offline
Опыт: 48,447
Активность:
и что ты тут одинакового увидел?
Старый 05.03.2008, 17:56
ZLOBICH
Kicked by XimikS
offline
Опыт: 4,727
Активность:
а чёрт сри я слеп)) ктонить потрите наш флуд плз^^
Старый 05.03.2008, 18:36
sleepw

offline
Опыт: 8,449
Активность:
это тоже я так понимаю юзание каше?

Код:
local string lTable=H2Tx(GetExpiredTimer())
    local unit lAxe=GetUnit(lTable,"Axe")
    local unit lCaster=GetUnit(lTable,"Hero")
    local real lAx=GetReal(lTable,"Ax")
    local real lAy=GetReal(lTable,"Ay")
    local real lCx=GetReal(lTable,"Cx")
    local real lCy=GetReal(lTable,"Cy")
    local real lBx=GetReal(lTable,"Bx")
    local real lBy=GetReal(lTable,"By")
    local real laa=GetReal(lTable,"a")
Старый 05.03.2008, 22:10
J
expert
offline
Опыт: 48,447
Активность:
да
Старый 05.03.2008, 22:14
Ответ

Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск

Ваши права в разделе
Вы не можете создавать темы
Вы не можете отвечать на сообщения
Вы не можете прикреплять файлы
Вы можете скачивать файлы

BB-коды Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход



Часовой пояс GMT +3, время: 14:15.