• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Producer Update: Natives List

Status
Not open for further replies.
Level 14
Joined
Jan 16, 2009
Messages
716
Maybe your lack of understanding of what I am talking about make it vague to you but then you should have just stayed it that way.
It's not pointless since cheaters have a negative impact on the map and its community since they devaluate the efforts of legit players. Thus, there is a reason to make cheating as hard as possible.
Of course, one could always find a way to cheat. However the chance of someone hacking a server to cheat in a Warcraft 3 map is very slim.
 
Level 6
Joined
Aug 28, 2015
Messages
213
I don't know if something like this was already requested I think so but just in case something like
JASS:
startUnitAbilityCooldown takes unit, abilityId returns boolean is cooldown started
It returns true when the cooldown could be started like the unit cast the ability but without the cast effect.
And false if the ability wasn't added to the unit or couldn't start the cooldown for other reasons.
I dont know if it should reset the cooldown to its maximum when its in cooldown when the trigger is fired tho, I would say yes it should.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
I don't know if something like this was already requested I think so but just in case something like
JASS:
startUnitAbilityCooldown takes unit, abilityId returns boolean is cooldown started
It returns true when the cooldown could be started like the unit cast the ability but without the cast effect.
And false if the ability wasn't added to the unit or couldn't start the cooldown for other reasons.
I dont know if it should reset the cooldown to its maximum when its in cooldown when the trigger is fired tho, I would say yes it should.
A native like that was already requested 2 times, and it won't work because it doesn't support passive abilities.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
If you change the ability level of a aura spell the buff marker does not update until you select/deselect the unit. This bug is probably old though.

These have probably already been suggested.
function SetUnitAttackRange takes unit u, real range returns nothing
function GetUnitAttackRange takes unit u returns real
function SetUnitModel takes unit u, string modelFile returns nothing

Make it possible to save using Unit or Item types as keys in GUI. I think the only way to do it now (if Im not completely wrong here) is to make a custom script.

But what I really want would be more data structures other than the hashtable.
 
Last edited:
Level 4
Joined
May 8, 2016
Messages
58
The folloving functions needs a fix:
vJASS:
native CreateSound(path,looping,3D,stopWhenOutOfRange,0,0,"DefaultEAXON")
//Parameter stopWhenOutOfRange = false does not disable the sound cutoff.
    
native SetSoundDistances(s,fadeIn,fadeOut)
//Low fadeIn value (<100) prevent sound from playing for some reason
//The sound is still hearable when the distance from the sound position to the game camera is greater than fadeOut
 
Last edited:
Some more natives to suggest (that probably have already been suggested):

JASS:
native GetCurrentOpLimit takes nothing returns integer
    // This gets the operation limit of the current thread. (Although it is technically a global)

native SetCurrentOpLimit takes integer newLimit returns nothing
    // Setting it to 10 or below removes the limit entirely. (Only for the current thread).
    // This also undoes any operation expenses the native spends.
 
Level 12
Joined
Nov 3, 2013
Messages
989
It would be nice to be able to change the hotkeys of abilities ingame for a specific unit, so you could have the abilities Q W E R T etc. on custom hero maps without having to make 4+ versions of the same ability, but with different hotkeys. (So you can combine any combination of abilities without some of them having the same hotkey.)


native SetAbilityHotkey takes unit whichUnit, integer whichAbilityId, string whichHotkey returns nothing


Also, I don't think I've seen getting and setting the position of buttons on the command card either, which goes hand in hand with this.
 
Level 11
Joined
Mar 6, 2008
Messages
898
I don't know if this has been suggested already but for my Line Tower Wars map I oftentimes wanted the below API to be existent.
It would have been a convenience feature for the players since that's mainly the first thing what every experienced player does at the beginning of each game.

JASS:
// Constants for hotkeys 0 to 9 for the new type named controlgroup
constant controlgroup CONTROL_GROUP_0
constant controlgroup CONTROL_GROUP_1
...
constant controlgroup CONTROL_GROUP_9

native ControlGroupPlayerAddUnit takes controlgroup whichControlGroup, player whichPlayer, unit whichUnit returns nothing
native ControlGroupPlayerRemoveUnit takes controlgroup whichControlGroup, player whichPlayer, unit whichUnit returns nothing
native ClearControlGroup takes controlgroup whichControlGroup, player whichPlayer returns nothing

Which adds or removes the target unit to a control group for the given player.

Maybe we could even simply the API to be used without the player handle since one can only put his or her own units into a controlgroup.

JASS:
native ControlGroupAddUnit takes controlgroup whichControlGroup, unit whichUnit returns nothing
native ControlGroupRemoveUnit takes controlgroup whichControlGroup, unit whichUnit returns nothing
 
Last edited:
Is there a full list of unit types? If not, a full unit types list should be considered to aid the unit type natives, e.g.
Code:
IsUnitType
.
This is very useful for type identification of units, e.g. a guard.

constant native IsUnitType takes unit whichUnit, unittype whichUnitType returns boolean

Notice it takes unittype as a parameter. If you search for it in the common.j you will find this:

JASS:
//===================================================
// Unit Type Constants for use with IsUnitType()
//===================================================
    constant unittype UNIT_TYPE_HERO                        = ConvertUnitType(0)
    constant unittype UNIT_TYPE_DEAD                        = ConvertUnitType(1)
    constant unittype UNIT_TYPE_STRUCTURE                   = ConvertUnitType(2)
    constant unittype UNIT_TYPE_FLYING                      = ConvertUnitType(3)
    constant unittype UNIT_TYPE_GROUND                      = ConvertUnitType(4)
    constant unittype UNIT_TYPE_ATTACKS_FLYING              = ConvertUnitType(5)
    constant unittype UNIT_TYPE_ATTACKS_GROUND              = ConvertUnitType(6)
    constant unittype UNIT_TYPE_MELEE_ATTACKER              = ConvertUnitType(7)
    constant unittype UNIT_TYPE_RANGED_ATTACKER             = ConvertUnitType(8)
    constant unittype UNIT_TYPE_GIANT                       = ConvertUnitType(9)
    constant unittype UNIT_TYPE_SUMMONED                    = ConvertUnitType(10)
    constant unittype UNIT_TYPE_STUNNED                     = ConvertUnitType(11)
    constant unittype UNIT_TYPE_PLAGUED                     = ConvertUnitType(12)
    constant unittype UNIT_TYPE_SNARED                      = ConvertUnitType(13)
    constant unittype UNIT_TYPE_UNDEAD                      = ConvertUnitType(14)
    constant unittype UNIT_TYPE_MECHANICAL                  = ConvertUnitType(15)
    constant unittype UNIT_TYPE_PEON                        = ConvertUnitType(16)
    constant unittype UNIT_TYPE_SAPPER                      = ConvertUnitType(17)
    constant unittype UNIT_TYPE_TOWNHALL                    = ConvertUnitType(18) 
    constant unittype UNIT_TYPE_ANCIENT                     = ConvertUnitType(19)
 
    constant unittype UNIT_TYPE_TAUREN                      = ConvertUnitType(20)
    constant unittype UNIT_TYPE_POISONED                    = ConvertUnitType(21)
    constant unittype UNIT_TYPE_POLYMORPHED                 = ConvertUnitType(22)
    constant unittype UNIT_TYPE_SLEEPING                    = ConvertUnitType(23)
    constant unittype UNIT_TYPE_RESISTANT                   = ConvertUnitType(24)
    constant unittype UNIT_TYPE_ETHEREAL                    = ConvertUnitType(25)
    constant unittype UNIT_TYPE_MAGIC_IMMUNE                = ConvertUnitType(26)

Unless of course you mean there are more types that aren't defined here that can be used.
 
Level 7
Joined
Jun 5, 2018
Messages
180
@TriggerHappy Yes, there are still many unit types that aren't defined, e.g. UNIT_TYPE_WARD. So the unit identification for the missing types becomes a bit difficult and complex.

I think the missing and independent constants are:
vJASS:
// Unit types
UNIT_TYPE_WARD
UNIT_TYPE_NEUTRAL
// Sound types
SOUND_TYPE_3D
SOUND_TYPE_UI

Missing natives:
vJASS:
native IsDestructableDebris takes destructable d returns boolean
 
Last edited:
These may or may not have already been suggested. Just a few natives I'd find useful.
JASS:
// Returns the absolute value of the input number.
native AbsI takes integer i returns integer
native AbsR takes real r returns real

// Returns the unit/player at the given index. Returns null when index is out of bounds.
native GroupGetUnit   takes group g, integer index returns unit
native ForceGetPlayer takes force f, integer index returns player

// Returns the current number of units/players in a group/force.
native GroupGetUnitCount   takes group g returns integer
native ForceGetPlayerCount takes force f returns integer

// Changes the model file of an effect.
native SetSpecialEffectModel takes effect e, string file returns nothing

// Sets the 3D rotation of the effect using forward and up vectors.
native SetSpecialEffectRotation takes effect e, real fwX, real fwY, real fwZ, real upX, real upY, real upZ returns nothing

// Sets the 3D rotation of the effect using quaternion rotation.
native SetSpecialEffectRotationQuat takes effect e, real x, real y, real z, real w returns nothing

// Enables/disables rendering of an effect.
native SetSpecialEffectVisibility takes effect e, boolean flag returns nothing

// Replaces a replaceable texture for an effect model.
native SetSpecialEffectReplaceableTexture takes effect e, integer replaceableId, string file returns nothing

// Changes the texture of an image.
native SetImageTexture takes image img, string file returns nothing

// Sets the texture UV coordinates for an image.
native SetImageUV takes image img, real x1, real y1, real x2, real y2, real x3, real y3, real x4, real y4 returns nothing

// Returns the Z height of the terrain at the given point. Should return the same value on all clients to prevent desyncs.
native GetWorldHeight takes real x, real y returns real

// Returns the pathing cost between two points for the given movement type (foot, float, flying, amphibious, etc.)
// The cost scales with the length of the path.
// Results in -1 if the path is blocked.
native GetPathingCost takes integer pathingType, real x1, real y1, real x2, real y2 returns integer

// Returns the end point of a path as determined by the internal pathfinder.
native GetPathingEndPoint takes integer pathingType, real x1, real y1, real x2, real y2 returns location

// Returns a string representation of the given boolean ("True" or "False").
native B2S takes boolean b returns string

// Converts a boolean to an integer (0 if false and 1 if true).
native B2I takes boolean b returns integer

// Changes the type of a unit.
// The unit should retain its properties such as handle id, variable pointers, unit groups, control groups and selection state.
native SetUnitTypeId takes unit whichUnit, integer unitid returns nothing
 
Last edited:
Odd, I thought there was a new post here.

If the ability to return arrays as objects will be introduced, there would be some things that need to be tweaked (in the JASS VM) in order to (probably) not free them by the end of a function statement or on a return call.

Local arrays are of particular interest and is an example of the above, since they are generated on a function call and cleaned up thereafter, leading to the above.

In the compiler, there would be a compiler-only type that accepts all sorts of arrays and can return type-safe values, based on how arrays themselves are implemented. Moreover, the compiler-only type can, at runtime, discern the primary meta-type of the associated array.

Objects of the compiler-only type are created on the setting of a compiler-only type variable to an array (read instruction before write to variable, which can be filtered and generated.) To destroy them, the assignment to the variable must be to a null object (when set to null, the reference count of the array variable being pointed to is decremented).
 
One time I wrote a working JASS interpreter late at night in 3 hours to prove to a friend that if I had a JASS interpreter, I could add the `code array` type with ease. Adding dynamically allocated and freed arrays would also be easy, but Blizzard probably does not want to do it. I think their focus is on other topics.
 
I'd like to request a option for 'Select as Patron' as at least I couldn't find it myself
Already exists, but sadly not ported to GUI as many cool features.
JASS:
native IssueNeutralTargetOrder takes player forWhichPlayer,unit neutralStructure, string unitToBuild, widget target returns boolean
unitToBuild = the stuff you want to happen. the string was "neutralinteract", mabye also "smart" works cause you can do that with rightclick.
 
Last edited:
Level 11
Joined
Jan 2, 2016
Messages
472
I assume these some of these things exist in the wishlist but here are some ideas of mine. :p
JASS:
// Pretty strightforward creates a trackable at the given coordinates with the given message.
native CreateTrackable takes real x, real y, string message returns trackable
// Destroy the trackable object.
native DestroyTrackable takes trackable t returns nothing
// Changes the X coordinate of the given trackable.
native SetTrackableX takes trackable t, real x returns nothing
// Changes the Y coordinate of the given trackable.
native SetTrackableY takes trackable t, real y returns nothing
// Gets the X coordinate of the given trackable.
native GetTrackableX takes trackable t, real x returns nothing
// Gets the Y coordinate of the given trackable.
native GetTrackableY takes trackable t, real y returns nothing
// Changes the message of the given trackable.
native SetTrackableMsg takes trackable t, string message returns nothing
// Tries to attach a given trackable to a widget as its parent.
native AttachTrackableToWidget takes trackable t, widget w returns boolean
// Show or hide the trackable.
native DisplayTrackable takes trackable t, boolean show returns nothing
// Something that emits when the mouse it over a given widget with a trackable.
constant playerevent EVENT_PLAYER_TRACKABLE_FOCUS
// or perhaps instead of trackable we have a widget focused event
constant widgetevent EVENT_WIDGET_FOCUSED
// and on top of that something like which in turn
// can return null if the widget doesn't have a trackable attached
// to itself.
native AcquireTrackable takes widget w returns trackable

Tell me what you think!
 
Level 8
Joined
Jan 23, 2015
Messages
121
Tell me what you think!

I didn't understand the thing about messages. Aren't trackables just plain effects that has a special event for hovering over?
Probably one would want to attach more than one trackable to a widget, so acquiring it as a native would be a problem. While it's done with some jass overhead pretty much easily. And with those events you want GetFocusedWidget() and GetFocusedTrackable(), even if they're the same as gettriggeringX thing.

I guess if trackables are effects with additional functionality, they should extend effects and thus use all the API provided for them, I mean what was added in last patches. Or, which is easier to do, c&p that API to use with trackables.
 
Last edited:
Level 11
Joined
Jan 2, 2016
Messages
472
Perhaps i'm not thinking about trackables ?

Basically some API so one can do this:
Screen2.jpg
 
Level 7
Joined
Jun 5, 2018
Messages
180
Suggestion:
Add missing natives for stock UI:
vJASS:
// Get the id of an item in stock by coordinates.
native GetItemInStock takes unit whichstock, integer x, integer y returns integer
// Get the x coordinate of an item in stock by id.
native GetItemXInStock takes unit whichstock, integer itemid returns integer
// Get the y coordinate of an item in stock by id.
native GetItemYInStock takes unit whichstock, integer itemid returns integer
// Change the item at the specific coordinate of stock.
native SetItemInStock takes unit whichstock, integer itemid, integer x, integer y returns nothing
// Swap the postions of items in stock.
native SwapItemInStock unit whichstock, integer x1, integer y1, integer x2, integer y2 returns nothing
// Get the icon path of an item in stock using native GetWidgetIcon.
function GetItemIconInStockBJ unit whichstock, integer x, integer y returns string
// Change the icon of an item in stock and returns the old icon using native SetWidgetIcon.
function SetItemIconInStockBJ unit whichstock, integer x, integer y, string blpname returns string
 
Last edited:
Level 4
Joined
Aug 2, 2015
Messages
63
sorry, i may ask stupid question but where to find this native?
Code:
// > DAMAGE EVENT EXTENSION

    constant playerunitevent EVENT_PLAYER_UNIT_DAMAGED           //Same as EVENT_UNIT_DAMAGED except as a player unit event.

    function GetEventDamageAttackType takes nothing returns attacktype                  
        //In response to a damage event returns the attacktype (Spell, Hero, Chaos, etc) of the damage.
    function GetEventDamageDamageType takes nothing returns damagetype
        //In response to a damage event returns the damagetype (unkown, magic, normal, enhanced, etc) of the damage.
    function GetEventDamageAbilityId takes nothing returns integer                      
       //In response to a damage event returns the ability ID that caused the damage. This ability can be a damage spell (Flame Strike, Storm Bolt, etc) or an attack modifier ability (Cold Arrow, orb of fire, etc). Normal attack damage returns some safe default value such as 0.
    function GetEventDamageUnmodified takes nothing returns real                        
       //In response to a damage event returns the damage dealt to the unit before any modifications (armor, attacktype reduction, etc) were applied.
    function GetEventDamageMana takes nothing returns real                              
        //In response to a damage event returns the mana lost due to an active mana shield.
and i found this natives in Producer Update: Natives List - WC3 Modding Information Center
Code:
function GetUnitAttackTime takes unit u, integer index returns real                          //Returns the cooldown time of a particular attack index (0 or 1) of a unit, with attack speed modifiers (eg: Glove of Haste, Cripple) factored in.
function SetUnitAttackTime takes unit u, integer index, real amount returns nothing          //Set the base cooldown time of a particular attack index of a unit, reapplying all attack speed modifiers as appropiate.
function ModifyUnitAttackTime takes unit u, integer index, real fraction returns nothing     //Applies fraction attack speed modifier to a particular attack index of a unit, being treated the same as other attack speed modifiers including limits.
function GetUnitAttackDamageMin takes unit u, integer index returns integer                  //Returns the minimum attack damage of a particular attack index of a unit, with damage modifiers (eg: Command Aura, Claws of Attack +16) factored in.
function GetUnitAttackDamageMax takes unit u, integer index returns integer                  //Returns the maximum attack damage of a particular attack index of a unit, with damage modifiers factored in.
function SetUnitAttackDamageMin takes unit u, integer index, integer min returns nothing     //Changes the base minimum attack damage of a particular attack index of a unit to an exact value, reapplying all damage modifiers as appropiate. Will override bonuses from upgrades.
function SetUnitAttackDamageMax takes unit u, integer index, integer max returns nothing     //Changes the base maximum attack damage of a particular attack index of a unit to an exact value, reapplying all damage modifiers as appropiate. Will override bonuses from upgrades.
function ModifyUnitAttackDamage takes unit u, integer index, integer amount returns nothing  //Applies damage modifier to a particular attack index of a unit, being treated the same as other damage modifiers.
how to use all that natives ? and sorry for my bad english
 
you can't.

This list contains suggestions, wishes and possible new natives in the future, as the sentence above says "JASS improvements for the upcoming versions of Warcraft III" from your link.

Added to warcraft 3
JASS:
// Automation Test
native AutomationSetTestType                    takes string testType returns nothing
native AutomationTestStart                      takes string testName returns nothing
native AutomationTestEnd                        takes nothing returns nothing
native AutomationTestingFinished                takes nothing returns nothing

// JAPI Functions
native BlzGetTriggerPlayerMouseX                   takes nothing returns real
native BlzGetTriggerPlayerMouseY                   takes nothing returns real
native BlzGetTriggerPlayerMousePosition            takes nothing returns location
native BlzGetTriggerPlayerMouseButton              takes nothing returns mousebuttontype
native BlzSetAbilityTooltip                        takes integer abilCode, string tooltip, integer level returns nothing
native BlzSetAbilityActivatedTooltip               takes integer abilCode, string tooltip, integer level returns nothing
native BlzSetAbilityExtendedTooltip                takes integer abilCode, string extendedTooltip, integer level returns nothing
native BlzSetAbilityActivatedExtendedTooltip       takes integer abilCode, string extendedTooltip, integer level returns nothing
native BlzSetAbilityResearchTooltip                takes integer abilCode, string researchTooltip, integer level returns nothing
native BlzSetAbilityResearchExtendedTooltip        takes integer abilCode, string researchExtendedTooltip, integer level returns nothing
native BlzGetAbilityTooltip                        takes integer abilCode, integer level returns string
native BlzGetAbilityActivatedTooltip               takes integer abilCode, integer level returns string
native BlzGetAbilityExtendedTooltip                takes integer abilCode, integer level returns string
native BlzGetAbilityActivatedExtendedTooltip       takes integer abilCode, integer level returns string
native BlzGetAbilityResearchTooltip                takes integer abilCode, integer level returns string
native BlzGetAbilityResearchExtendedTooltip        takes integer abilCode, integer level returns string
native BlzSetAbilityIcon                           takes integer abilCode, string iconPath returns nothing
native BlzGetAbilityIcon                           takes integer abilCode returns string
native BlzSetAbilityActivatedIcon                  takes integer abilCode, string iconPath returns nothing
native BlzGetAbilityActivatedIcon                  takes integer abilCode returns string
native BlzGetAbilityPosX                           takes integer abilCode returns integer
native BlzGetAbilityPosY                           takes integer abilCode returns integer
native BlzSetAbilityPosX                           takes integer abilCode, integer x returns nothing
native BlzSetAbilityPosY                           takes integer abilCode, integer y returns nothing
native BlzGetAbilityActivatedPosX                  takes integer abilCode returns integer
native BlzGetAbilityActivatedPosY                  takes integer abilCode returns integer
native BlzSetAbilityActivatedPosX                  takes integer abilCode, integer x returns nothing
native BlzSetAbilityActivatedPosY                  takes integer abilCode, integer y returns nothing
native BlzGetUnitMaxHP                             takes unit whichUnit returns integer
native BlzSetUnitMaxHP                             takes unit whichUnit, integer hp returns nothing
native BlzGetUnitMaxMana                           takes unit whichUnit returns integer
native BlzSetUnitMaxMana                           takes unit whichUnit, integer mana returns nothing
native BlzSetItemName                              takes item whichItem, string name returns nothing
native BlzSetItemDescription                       takes item whichItem, string description returns nothing
native BlzGetItemDescription                       takes item whichItem returns string
native BlzSetItemTooltip                           takes item whichItem, string tooltip returns nothing
native BlzGetItemTooltip                           takes item whichItem returns string
native BlzSetItemExtendedTooltip                   takes item whichItem, string extendedTooltip returns nothing
native BlzGetItemExtendedTooltip                   takes item whichItem returns string
native BlzSetItemIconPath                          takes item whichItem, string iconPath returns nothing
native BlzGetItemIconPath                          takes item whichItem returns string
native BlzSetUnitName                              takes unit whichUnit, string name returns nothing
native BlzSetHeroProperName                        takes unit whichUnit, string heroProperName returns nothing
native BlzGetUnitBaseDamage                        takes unit whichUnit, integer weaponIndex returns integer
native BlzSetUnitBaseDamage                        takes unit whichUnit, integer baseDamage, integer weaponIndex returns nothing
native BlzGetUnitDiceNumber                        takes unit whichUnit, integer weaponIndex returns integer
native BlzSetUnitDiceNumber                        takes unit whichUnit, integer diceNumber, integer weaponIndex returns nothing
native BlzGetUnitDiceSides                         takes unit whichUnit, integer weaponIndex returns integer
native BlzSetUnitDiceSides                         takes unit whichUnit, integer diceSides, integer weaponIndex returns nothing
native BlzGetUnitAttackCooldown                    takes unit whichUnit, integer weaponIndex returns real
native BlzSetUnitAttackCooldown                    takes unit whichUnit, real cooldown, integer weaponIndex returns nothing
native BlzSetSpecialEffectColorByPlayer            takes effect whichEffect, player whichPlayer returns nothing
native BlzSetSpecialEffectColor                    takes effect whichEffect, integer r, integer g, integer b returns nothing
native BlzSetSpecialEffectAlpha                    takes effect whichEffect, integer alpha returns nothing
native BlzSetSpecialEffectScale                    takes effect whichEffect, real scale returns nothing
native BlzSetSpecialEffectPosition                 takes effect whichEffect, real x, real y, real z returns nothing
native BlzSetSpecialEffectHeight                   takes effect whichEffect, real height returns nothing
native BlzSetSpecialEffectTimeScale                takes effect whichEffect, real timeScale returns nothing
native BlzSetSpecialEffectTime                     takes effect whichEffect, real time returns nothing
native BlzSetSpecialEffectOrientation              takes effect whichEffect, real yaw, real pitch, real roll returns nothing
native BlzSetSpecialEffectYaw                      takes effect whichEffect, real yaw returns nothing
native BlzSetSpecialEffectPitch                    takes effect whichEffect, real pitch returns nothing
native BlzSetSpecialEffectRoll                     takes effect whichEffect, real roll returns nothing
native BlzSetSpecialEffectX                        takes effect whichEffect, real x returns nothing
native BlzSetSpecialEffectY                        takes effect whichEffect, real y returns nothing
native BlzSetSpecialEffectZ                        takes effect whichEffect, real z returns nothing
native BlzSetSpecialEffectPositionLoc              takes effect whichEffect, location loc returns nothing
native BlzGetLocalSpecialEffectX                   takes effect whichEffect returns real
native BlzGetLocalSpecialEffectY                   takes effect whichEffect returns real
native BlzGetLocalSpecialEffectZ                   takes effect whichEffect returns real
native BlzSpecialEffectClearSubAnimations          takes effect whichEffect returns nothing
native BlzSpecialEffectRemoveSubAnimation          takes effect whichEffect, subanimtype whichSubAnim returns nothing
native BlzSpecialEffectAddSubAnimation             takes effect whichEffect, subanimtype whichSubAnim returns nothing
native BlzPlaySpecialEffect                        takes effect whichEffect, animtype whichAnim returns nothing
native BlzPlaySpecialEffectWithTimeScale           takes effect whichEffect, animtype whichAnim, real timeScale returns nothing
native BlzGetAnimName                              takes animtype whichAnim returns string
native BlzGetUnitArmor                             takes unit whichUnit returns real
native BlzSetUnitArmor                             takes unit whichUnit, real armorAmount returns nothing
native BlzUnitHideAbility                          takes unit whichUnit, integer abilId, boolean flag returns nothing
native BlzUnitDisableAbility                       takes unit whichUnit, integer abilId, boolean flag, boolean hideUI returns nothing
native BlzUnitCancelTimedLife                      takes unit whichUnit returns nothing
native BlzIsUnitSelectable                         takes unit whichUnit returns boolean
native BlzIsUnitInvulnerable                       takes unit whichUnit returns boolean
native BlzUnitInterruptAttack                      takes unit whichUnit returns nothing
native BlzGetUnitCollisionSize                     takes unit whichUnit returns real
native BlzGetAbilityManaCost                       takes integer abilId, integer level returns integer
native BlzGetAbilityCooldown                       takes integer abilId, integer level returns real
native BlzSetUnitAbilityCooldown                   takes unit whichUnit, integer abilId, integer level, real cooldown returns nothing
native BlzGetUnitAbilityCooldown                   takes unit whichUnit, integer abilId, integer level returns real
native BlzGetUnitAbilityCooldownRemaining          takes unit whichUnit, integer abilId returns real
native BlzEndUnitAbilityCooldown                   takes unit whichUnit, integer abilCode returns nothing
native BlzGetUnitAbilityManaCost                   takes unit whichUnit, integer abilId, integer level returns integer
native BlzSetUnitAbilityManaCost                   takes unit whichUnit, integer abilId, integer level, integer manaCost returns nothing
native BlzGetLocalUnitZ                            takes unit whichUnit returns real
native BlzDecPlayerTechResearched                  takes player whichPlayer, integer techid, integer levels returns nothing
native BlzSetEventDamage                           takes real damage returns nothing
native RequestExtraIntegerData                     takes integer dataType, player whichPlayer, string param1, string param2, boolean param3, integer param4, integer param5, integer param6 returns integer
native RequestExtraBooleanData                     takes integer dataType, player whichPlayer, string param1, string param2, boolean param3, integer param4, integer param5, integer param6 returns boolean
native RequestExtraStringData                      takes integer dataType, player whichPlayer, string param1, string param2, boolean param3, integer param4, integer param5, integer param6 returns string
native RequestExtraRealData                        takes integer dataType, player whichPlayer, string param1, string param2, boolean param3, integer param4, integer param5, integer param6 returns real
// Add this function to follow the style of GetUnitX and GetUnitY, it has the same result as BlzGetLocalUnitZ
native BlzGetUnitZ                                 takes unit whichUnit returns real
one can get this list by opening "documents/warcraft III/jasshelper/common.j" and look at the end of the files content.
 
Level 7
Joined
Jun 5, 2018
Messages
180
Another missing natives list:
vJASS:
// To accomplish the getcost natives
native GetItemGoldCost takes integer itemId returns integer
native GetItemWoodCost takes integer itemId returns integer
// As supplements for the getcost natives
native SetItemGoldCost takes integer itemId, integer value returns nothing
native SetItemWoodCost takes integer itemId, integer value returns nothing
native SetUnitGoldCost takes integer unitId, integer value returns nothing
native SetUnitWoodCost takes integer unitId, integer value returns nothing
native SetUpgradeGoldCost takes integer id, integer value returns nothing
native SetUpgradeWoodCost takes integer id, integer value returns nothing

// Widget UI including unit, item, and destructable.
native GetWidgetIcon takes integer widgetId returns string
native SetWidgetIcon takes integer widgetId, string iconpath returns nothing

native GetWidgetModel takes integer widgetId returns string
native SetWidgetModel takes integer widgetId, string modelpath returns nothing

// Extended Item Abilities; Thanks @Avahor for the list
function ItemAddAbility takes item whichItem, integer abilCode returns nothing
function ItemRemoveAbility takes item whichItem, integer abilCode returns nothing
function ItemCountAbilities takes item whichItem returns integer
function ItemGetAbility takes item whichItem, integer index returns integer
  // Get the Id of the ability from an item by the index as a supplement of function ItemGetAbilityIndex.
function ItemSetAbility takes item whichItem, integer index, integer abilCode returns boolean
  // Modify the Id of the ability of an item by index, and return true if successful.
function ItemGetAbilityIndex takes item whichItem, integer abilCode returns integer
function ItemSetAbilityIndex takes item whichItem, integer abilCode, integer index returns nothing
  // Modify the index of an ability of the specified item.
function ItemGetAbilityLevel takes item whichItem, integer abilCode returns integer
function ItemSetAbilityLevel takes item whichItem, integer abilCode, integer Level returns nothing
 
Last edited:
JASS:
native SetUnitAbilityCastRange takes unit whichUnit, integer abilId, integer level, real range returns nothing
native GetUnitAbilityCastRange takes unit whichUnit, integer abilId, integer level returns real

// Has a value on channel, effect, finish, and endcast
native GetSpellAbilityAreaEffect takes nothing returns real
 
Level 4
Joined
Jan 7, 2014
Messages
69
fix the problem with resume periodic timers. As we know, after resuming, timer works only one time. function is:
Code:
native ResumeTimer takes timer whichTimer returns nothing
need to make an array support for
Code:
type code
or function for convert "code" in integer or string and back, something like:
Code:
native C2I takes code codefunc returns integer
native C2S takes code codefunc returns string
native S2C takes string codefunc returns code
native I2C takes  integer codeid returns code
 
Last edited:
Level 4
Joined
Jan 7, 2014
Messages
69
These were removed for security reasons.
then need smth for save code functions in hashtable for example like
Code:
native SaveCode takes hashtable hash, integer parentInt, integer childInt, code codename returns nothing
and
Code:
 native LoadCode takes hashtable hash, integer parentInt, integer childInt returns code
 
Level 4
Joined
Jan 7, 2014
Messages
69
From what I understand code is a low level type. Hence it is not meant to or at least safe to be heavily manipulated. If you want to execute code dynamically then wrap it in boolexprs or triggers.
i think youre right. but, if you can use code as variable, then why not supported arrays on this? its strange. You cannot use boolexpr in timers expired functions for example, qoz this functions should return nothing as you know ofc...how to be here then? If there is a bug with resuming periodic timers after pause.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,178
then why not supported arrays on this? its strange.
Not that strage. Code arrays were used for arbitrary code execution exploit so were removed.
You cannot use boolexpr in timers expired functions for example, qoz this functions should return nothing as you know ofc...how to be here then?
One can create a system which runs a dynamic boolexpr in response to a timer expiring. Not the nicest code wise but I think that is what most timer systems do.
 
Level 5
Joined
May 10, 2018
Messages
129
Please add a native:
vJASS:
function IsTriggerSleeping takes trigger t returns boolean
to prevent stack corruption if a trigger is destroyed when sleeping!
 
Level 4
Joined
Jan 7, 2014
Messages
69
Please add a native:
vJASS:
function IsTriggerSleeping takes trigger t returns boolean
to prevent stack corruption if a trigger is destroyed when sleeping!
i think its useless qoz you can check with booleans this if i correct understood your idea...smth like:
Code:
boolean sleep
set sleep = true
call TriggerSleepAction(1.0)
set sleep = false
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
i think its useless qoz you can check with booleans this if i correct understood your idea...smth like:
Code:
boolean sleep
set sleep = true
call TriggerSleepAction(1.0)
set sleep = false
That doesn't stop the trigger from executing the rest of the code if the trigger is destroyed. Also use [code=jass][/code] not [code][/code], it makes it easier to read as it is more appropriate.
 
Level 4
Joined
Jan 7, 2014
Messages
69
btw, ive got an idea about trigger events.
IDK if there is a limit of events count in one trigger (i mean how many events in one trigger i can put without any problems?...as i see event is an integer type, so shoulnd be any limits with that....never checked this) , but if yes, then i think need to remove any limits of this..
 
Can both destructable and item creation event, and their corresponding remove event, be introduced?

I think this has been mentioned a lot of times already, but to rehash some possible natives, along with new ones:

JASS:
function IsUnitAbilitySilenced takes unit whichUnit, integer abilId returns boolean
    // Returns true if ability exists and is silenced and false otherwise
function MakeUnitSelectable takes unit whichUnit, boolean isSelectable returns nothing
    // A complement to IsUnitSelectable
function GetUnitAttackType takes unit whichUnit, integer index returns attacktype
    // Returns the attack type of the selected attack index

// These are unit-specific versions of the new natives introduced
function SetUnitAbilityTooltip takes unit whichUnit, integer abilId, integer level, string description returns boolean
    // Returns true if the tooltip was overwritten
function SetUnitAbilityExtendedTooltip takes unit whichUnit, integer abilId, integer level, string description returns boolean
    // Returns true if the extended tooltip was overwritten
function SetUnitAbilityResearchTooltip takes unit whichUnit, integer abilId, integer level, string description returns boolean
    // Returns true if the research tooltip was overwritten
function SetUnitAbilityResearchExtendedTooltip takes unit whichUnit, integer abilId, integer level, string description returns boolean
    // Returns true if the research tooltip was overwritten

// Auto-cast versions
function SetUnitActivatedAbilityTooltip takes unit whichUnit, integer abilId, integer level, string description returns boolean
    // Returns true if the tooltip was overwritten
function SetUnitActivatedAbilityExtendedTooltip takes unit whichUnit, integer abilId, integer level, string description returns boolean
    // Returns true if the extended tooltip was overwritten
function SetUnitActivatedAbilityResearchTooltip takes unit whichUnit, integer abilId, integer level, string description returns boolean
    // Returns true if the research tooltip was overwritten
function SetUnitActivatedAbilityResearchExtendedTooltip takes unit whichUnit, integer abilId, integer level, string description returns boolean
    // Returns true if the research tooltip was overwritten

// The abilities' getters (Replace Set with Get, remove parameter string description, and change return type to string)

function SetUnitAbilityCooldownRemaining takes unit whichUnit, integer abilId, real newRemaining returns boolean
    // Modifies the amount of time left before the ability can be activated again. Minimum value of 0 internally.
    // Internally does not affect abilities which are no longer in cooldown.
function SetUnitAbilityCooldownRemainingEx takes unit whichUnit, integer abilId, real newRemaining returns boolean
    // Does the same thing as SetUnitAbilityCooldownRemaining, but refreshes the cooldown model of the icon.
function ApplyUnitAbilityCooldown takes unit whichUnit, integer abilId, real duration returns boolean
    // Applies the cooldown of an ability which is not in cooldown. Ignores the internal cooldown of the ability.
    // Returns true if procedure above is successful.
 
Level 4
Joined
May 14, 2007
Messages
35
Not sure if this has already been suggested but I could see a lot of usage. Not to mention it should be easy to implement since you could already see the level of the buff when you hover over the buff.

JASS:
native GetUnitBuffLevel takes unit whichUnit, integer abilcode returns integer

Or fix GetUnitAbilityLevel to actually return the correct level of the buff instead of always returning 1. But I guess it could break some maps this way.
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
Not sure if this has already been suggested but I could see a lot of usage. Not to mention it should be easy to implement since you could already see the level of the buff when you hover over the buff.

JASS:
native GetUnitBuffLevel takes unit whichUnit, integer abilcode returns integer

Or fix GetUnitAbilityLevel to actually return the correct level of the buff instead of always returning 1. But I guess it could break some maps this way.
And let us to able to detect buffs on unit death, just right before the unit actually dies.
JASS:
native MakeUnitMissAttack takes unit whichUnit, integer weaponIndex returns nothing //Makes unit miss next attack
native MakeUnitMissAttackN takes unit whichUnit, integer weaponIndex, integer attackAmount returns nothing //Makes unit miss an amount of its next attacks
EVENT_PLAYER_UNIT_MISSED //WE NEED THIS EVENT!
EVENT_UNIT_MISSED //Does same
 
Last edited:
Level 4
Joined
Jan 7, 2014
Messages
69
JASS:
native BlzSetUnitAbilityPosX/Y takes unit u, integer abilCode, integer XPos returns nothing
//Same as BlzSetAbilityPosX/Y but for unit. Qoz change for every units wich got this ability. GetLocalPlayer snippet doesnt work there.

native BlzSetUnitAbilityPosX/Y takes unit u, integer abilCode returns integer
//Just return the same value as BlzGetAbilityPosX/Y but for unit.

native GetUnitRealDamage takes unit u, boolean before returns real
//Returns a real value of damage to unit with boolean before(thats mean without including  and resists armor) or with included armor and resists.

native CheckWalkable takes real x, real y, boolean checkDestructable, boolean checkUnits, integer walktype returns boolean
//wich means to check or not a standart walkable like in function IsTerrainWalkable...if 0 then no check, if >0 thats mean index of walkabilitypatch).
Also for avoid a tons of code in custom systems. Always better if natives :)

native Function2String takes code func, string name returns nothing
//thats means you can save the function code to string for save

native Sring2Function takes string funcName returns code
//Convert back the string to function code for fire. For avoid abuses there can be a return value 0 if function wasnt converted to string before. Thats means you can convert the string to function only if you used converting this function to string before.

Or

native GetIndexCode takes code func returns integer
//Only Get, not Set for avoid abuses.
Will be very usefull

and

native GetCode takes integer codeindex returns code


native TypeToString takes type wichType returns string
//Just takes the type variable  (handle, agent, eventid and etc) and converts to string

native IsVariableDefined takes string var, function code returns boolean
//Thats means function got an defined  variable or not.

EVENT_PLAYER_UNIT_MISSED //WE NEED THIS EVENT!

hm, with damage detect its impossible to detect, miss or not?)

native MakeUnitMissAttack takes unit whichUnit, integer weaponIndex returns nothing //Makes unit miss next attack
native MakeUnitMissAttackN takes unit whichUnit, integer weaponIndex, integer attackAmount returns nothing //Makes unit miss an amount of its next attacks
i think they should return boolean then, not nothing.
 
Last edited by a moderator:

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
hm, with damage detect its impossible to detect, miss or not?)
If it's damage detected, then it wasn't missed, plus, we don't want the hit sound to be triggered. That's why we need that event.

i think they should return boolean then, not nothing.
I don't know, it is indifferent. It's up to them to know if it should return something or not :)
 
Level 4
Joined
Jan 7, 2014
Messages
69
I don't know, it is indifferent. It's up to them to know if it should return something or not :)
if this will return nothing then you cant use this in conditions without your custom checks.
most of the function i think should return boolean wich now returns nothing.

If it's damage detected, then it wasn't missed, plus, we don't want the hit sound to be triggered. That's why we need that event.
no, if damage = 0, its anyway damage and will be detected. just make a condition smth like
if dmg > 0 then
some code...
else
your miss detect
endif
 
Status
Not open for further replies.
Top