Новые нативные функции в 1.29

Добавлен , опубликован
В вышедшем сегодня патче для Warcraft III помимо огромного количества правок баланса и соревновательных карт была включена целая гора новых нативных JASS-функций (без малого почти сотня). Некоторые из них являются более удобными версиями уже бывшего доступным функционала, но большинство несут совершенно новые возможности, до сих пор бывшие недоступными простому смертному картоделу.
В общем, ознакамливайтесь и радуйтесь! Ну или не радуйтесь. Сами уж как-нибудь разберётесь.
type mousebuttontype extends handle

constant native GetBJMaxPlayers             takes nothing returns integer
constant native GetBJPlayerNeutralVictim    takes nothing returns integer
constant native GetBJPlayerNeutralExtra     takes nothing returns integer
constant native GetBJMaxPlayerSlots         takes nothing returns integer
constant native GetPlayerNeutralPassive     takes nothing returns integer
constant native GetPlayerNeutralAggressive  takes nothing returns integer

constant integer            PLAYER_NEUTRAL_PASSIVE              = GetPlayerNeutralPassive()
constant integer            PLAYER_NEUTRAL_AGGRESSIVE           = GetPlayerNeutralAggressive()

constant mousebuttontype    MOUSE_BUTTON_TYPE_LEFT              = ConvertMouseButtonType(1)
constant mousebuttontype    MOUSE_BUTTON_TYPE_MIDDLE            = ConvertMouseButtonType(2)
constant mousebuttontype    MOUSE_BUTTON_TYPE_RIGHT             = ConvertMouseButtonType(3)

constant playerevent        EVENT_PLAYER_MOUSE_DOWN             = ConvertPlayerEvent(269)
constant playerevent        EVENT_PLAYER_MOUSE_UP               = ConvertPlayerEvent(270)
constant playerevent        EVENT_PLAYER_MOUSE_MOVE             = ConvertPlayerEvent(271)

constant playerunitevent    EVENT_PLAYER_UNIT_SELL              = ConvertPlayerUnitEvent(272)
constant playerunitevent    EVENT_PLAYER_UNIT_CHANGE_OWNER      = ConvertPlayerUnitEvent(273)
constant playerunitevent    EVENT_PLAYER_UNIT_SELL_ITEM         = ConvertPlayerUnitEvent(274)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_CHANNEL     = ConvertPlayerUnitEvent(275)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_CAST        = ConvertPlayerUnitEvent(276)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_EFFECT      = ConvertPlayerUnitEvent(277)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_FINISH      = ConvertPlayerUnitEvent(278)
constant playerunitevent    EVENT_PLAYER_UNIT_SPELL_ENDCAST     = ConvertPlayerUnitEvent(279)
constant playerunitevent    EVENT_PLAYER_UNIT_PAWN_ITEM         = ConvertPlayerUnitEvent(280)

constant unitevent          EVENT_UNIT_SELL                     = ConvertUnitEvent(289)
constant unitevent          EVENT_UNIT_CHANGE_OWNER             = ConvertUnitEvent(290)
constant unitevent          EVENT_UNIT_SELL_ITEM                = ConvertUnitEvent(291)
constant unitevent          EVENT_UNIT_SPELL_CHANNEL            = ConvertUnitEvent(292)
constant unitevent          EVENT_UNIT_SPELL_CAST               = ConvertUnitEvent(293)
constant unitevent          EVENT_UNIT_SPELL_EFFECT             = ConvertUnitEvent(294)
constant unitevent          EVENT_UNIT_SPELL_FINISH             = ConvertUnitEvent(295)
constant unitevent          EVENT_UNIT_SPELL_ENDCAST            = ConvertUnitEvent(296)
constant unitevent          EVENT_UNIT_PAWN_ITEM                = ConvertUnitEvent(297)


//===================
// Player input
//===================

native GetTriggerPlayerMouseX               takes nothing returns real
native GetTriggerPlayerMouseY               takes nothing returns real
native GetTriggerPlayerMousePosition        takes nothing returns location
native GetTriggerPlayerMouseButton          takes nothing returns mousebuttontype


//===================
// Items UI
//===================

native SetItemName                          takes item whichItem, string name returns nothing
native SetItemDescription                   takes item whichItem, string name returns nothing
native SetItemTooltip                       takes item whichItem, string name returns nothing
native SetItemExtendedTooltip               takes item whichItem, string name returns nothing
native SetItemIconPath                      takes item whichItem, string name returns nothing

native GetItemDescription                   takes item whichItem returns string
native GetItemTooltip                       takes item whichItem returns string
native GetItemExtendedTooltip               takes item whichItem returns string
native GetItemIconPath                      takes item whichItem returns string


//===================
// Abils
//===================

    // Stats

native GetAbilityManaCost                   takes integer abilId, integer level returns integer
native GetAbilityCooldown                   takes integer abilId, integer level returns real

    // Text

native SetAbilityTooltip                    takes integer abilCode, string tooltip, integer level returns nothing
native SetAbilityOnTooltip                  takes integer abilCode, string tooltip, integer level returns nothing
native SetAbilityExtendedTooltip            takes integer abilCode, string ExtendedTooltip, integer level returns nothing
native SetAbilityOnExtendedTooltip          takes integer abilCode, string ExtendedTooltip, integer level returns nothing
native SetAbilityResearchTooltip            takes integer abilCode, string researchTooltip, integer level returns nothing
native SetAbilityResearchExtendedTooltip    takes integer abilCode, string researchExtendedTooltip, integer level returns nothing

native GetAbilityTooltip                    takes integer abilCode, integer level returns string
native GetAbilityOnTooltip                  takes integer abilCode, integer level returns string
native GetAbilityExtendedTooltip            takes integer abilCode, integer level returns string
native GetAbilityOnExtendedTooltip          takes integer abilCode, integer level returns string
native GetAbilityResearchTooltip            takes integer abilCode, integer level returns string
native GetAbilityResearchExtendedTooltip    takes integer abilCode, integer level returns string

    // Button

native SetAbilityIcon                       takes integer abilCode, string iconPath, integer level returns nothing
native SetAbilityOnIcon                     takes integer abilCode, string iconPath returns nothing
native SetAbilityPosX                       takes integer abilCode, integer x returns nothing
native SetAbilityPosY                       takes integer abilCode, integer y returns nothing
native SetAbilityOnPosX                     takes integer abilCode, integer x returns nothing
native SetAbilityOnPosY                     takes integer abilCode, integer y returns nothing

native GetAbilityIcon                       takes integer abilCode, integer level returns string
native GetAbilityOnIcon                     takes integer abilCode returns string
native GetAbilityPosX                       takes integer abilCode returns integer
native GetAbilityPosY                       takes integer abilCode returns integer
native GetAbilityOnPosX                     takes integer abilCode returns integer
native GetAbilityOnPosY                     takes integer abilCode returns integer


//===================
// Unit
//===================

    // Stats

native SetUnitArmor                         takes unit whichUnit, real armorAmount returns nothing
native SetUnitMaxHP                         takes unit whichUnit, integer hp returns nothing
native SetUnitMaxMana                       takes unit whichUnit, integer mana returns nothing
native SetUnitBaseDamage                    takes unit whichUnit, integer baseDamage, integer weaponIndex returns nothing
native SetUnitDiceNumber                    takes unit whichUnit, integer diceNumber, integer weaponIndex returns nothing
native SetUnitDiceSides                     takes unit whichUnit, integer diceSides, integer weaponIndex returns nothing
native SetUnitAttackCooldown                takes unit whichUnit, real cooldown, integer weaponIndex returns nothing

native GetUnitArmor                         takes unit whichUnit returns real
native GetUnitMaxHP                         takes unit whichUnit returns integer
native GetUnitMaxMana                       takes unit whichUnit returns integer
native GetUnitBaseDamage                    takes unit whichUnit, integer weaponIndex returns integer
native GetUnitDiceNumber                    takes unit whichUnit, integer weaponIndex returns integer
native GetUnitDiceSides                     takes unit whichUnit, integer weaponIndex returns integer
native GetUnitAttackCooldown                takes unit whichUnit, integer weaponIndex returns real

native GetUnitCollisionSize                 takes unit whichUnit returns real
native GetLocalUnitZ                        takes unit whichUnit returns real

native SetUnitName                          takes unit whichUnit, string name returns nothing
native SetUnitNameAll                       takes unit whichUnit, string name returns nothing
native SetHeroProperName                    takes unit whichUnit, string name returns nothing

    // Abils

native SetUnitAbilityCooldown               takes unit whichUnit, integer abilId, integer level, real cooldown returns nothing
native GetUnitAbilityCooldown               takes unit whichUnit, integer abilId, integer level returns real
native GetUnitAbilityCooldownRemaining      takes unit whichUnit, integer abilId returns real
native EndUnitAbilityCooldown               takes unit whichUnit, integer abilCode returns nothing

native GetUnitAbilityManaCost               takes unit whichUnit, integer abilId, integer level returns integer

native UnitHideAbility                      takes unit whichUnit, integer abilId, boolean flag returns nothing
native UnitDisableAbility                   takes unit whichUnit, integer abilId, boolean flag, boolean hideUI returns nothing
native DeleteHeroAbility                    takes unit whichUnit, integer abilCode returns nothing

    // Misc.

native UnitInterruptAttack                  takes unit whichUnit returns nothing
native UnitCancelTimedLife                  takes unit whichUnit returns nothing

native IsUnitSelectable                     takes unit whichUnit returns boolean
native IsUnitInvulnerable                   takes unit whichUnit returns boolean


//===================
// Special effect
//===================

    // Appearance

native SetSpecialEffectColorByPlayer        takes effect whichEffect, player whichPlayer returns nothing
native SetSpecialEffectColor                takes effect whichEffect, integer r, integer g, integer b returns nothing
native SetSpecialEffectAlpha                takes effect whichEffect, integer alpha returns nothing
native SetSpecialEffectScale                takes effect whichEffect, real scale returns nothing
native SetSpecialEffectHeight               takes effect whichEffect, real height returns nothing
native SetSpecialEffectTimeScale            takes effect whichEffect, real timeScale returns nothing
native SetSpecialEffectTime                 takes effect whichEffect, real time returns nothing

    // Position

native SetSpecialEffectX                    takes effect whichEffect, real x returns nothing
native SetSpecialEffectY                    takes effect whichEffect, real y returns nothing
native SetSpecialEffectZ                    takes effect whichEffect, real z returns nothing
native SetSpecialEffectPosition             takes effect whichEffect, real x, real y, real z returns nothing
native SetSpecialEffectPositionLoc          takes effect whichEffect, location loc returns nothing

native GetLocalSpecialEffectX               takes effect whichEffect returns real
native GetLocalSpecialEffectY               takes effect whichEffect returns real
native GetLocalSpecialEffectZ               takes effect whichEffect returns real

native SetSpecialEffectOrientation          takes effect whichEffect, real yaw, real pitch, real roll returns nothing
native SetSpecialEffectYaw                  takes effect whichEffect, real yaw returns nothing
native SetSpecialEffectPitch                takes effect whichEffect, real pitch returns nothing
native SetSpecialEffectRoll                 takes effect whichEffect, real roll returns nothing

    // Playback

native PlaySpecialEffect                    takes effect whichEffect, integer anim returns nothing
native PlaySpecialEffectWithTimeScale       takes effect whichEffect, integer anim, real timeScale returns nothing


//===================
// Misc.
//===================

native SetEventDamage                       takes real damage returns nothing

native AutomationTestStart                  takes string testName returns nothing
native AutomationTestEnd                    takes string testName returns nothing

constant native IncPlayerTechResearched     takes player whichPlayer, integer techid, integer levels returns nothing
constant native DecPlayerTechResearched     takes player whichPlayer, integer techid, integer levels returns nothing


//===================
// Not yet impl.
//===================

// native GetUnitMovementType               takes unit whichUnit returns integer
// native SetUnitMovementType               takes unit whichUnit, integer movementType returns nothing
// native GetUnitArmorType                  takes unit whichUnit returns integer
// native SetHeroStatEx                     takes unit whichHero, integer whichStat, integer statValue, boolean permanent returns nothing
// native GetHeroPrimaryStat                takes unit whichHero returns integer
// native GetHeroPrimaryStatById            takes unit whichHero returns integer
// native GetHeroStat                       takes unit whichHero, integer whichStat, boolean includeBonuses returns integer
0
29
6 лет назад
0
Ну так проси, предлагай, пиши
2 комментария удалено
1
29
6 лет назад
Отредактирован Волчачка
1
H:
хм, у меня jngp падает при попытки вставить хоть сколько длинную строку в gui (не измерял, но по ощущением 60-100 русских букв, возможно там лимит в 128 символов (ascii) и соответственно в 64 если использовать юникод).
Но через vJass я спокойно могу вписать туда целую поэму.
local string tmp_string = "<куча русских букв>"
Варик спокойно читает подобное, я проверял через внедренный текст в Blizzard.j. Даже не надо ставить (\n) |n, спокойно без переносов всо делает.
правда не проверял на патче 1.29.
0
13
6 лет назад
0
pp.userapi.com/c830309/v830309999/d5514/5LIAtw5i9IQ.jpg спокойно делал карту на 1.29 PTR но после обновления карта не хочет запускаться на 1.29, в чём может быть проблема?
1
37
6 лет назад
1
Cancel, что-то с триггером на гуи. Ну и забей на это, на то он и ptr
3
13
6 лет назад
3
ScorpioT1000, да хер знает, я много времени вложил, не хочется забивать
youtu.be/TmaOJ0iMzEQ
youtu.be/y7xnXUw8t5Q
2
30
6 лет назад
2
Cancel, подход вызывает уважение, должен сказать
0
13
6 лет назад
0
Clamp, благодарю, но босюсь пользы от этого подхода будет не много, если я так и не смогу запустить карту в релизной версии редактора.
0
20
6 лет назад
0
Cancel, ну в релизной версии будет иметь смысл копаться в архиве карты и искать проблемы внутри кода. Если они вообще будут, конечно
0
37
6 лет назад
0
Cancel, зачем ты что-то делал на тестовой версии редактора, не подходящей для продакшена?
0
13
6 лет назад
0
ScorpioT1000, руки чесались. Я раньше на ПТР ничего не делал и не знал, что наработки не будут актуальны при релизе
Чтобы оставить комментарий, пожалуйста, войдите на сайт.