1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  4. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  5. The results are out! Check them out.
    Dismiss Notice
  6. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  7. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Producer Update: Natives List

Discussion in 'Patch & Reforged Discussion' started by Kam, Dec 7, 2017.

  1. The_Silent

    The_Silent

    Joined:
    Feb 4, 2008
    Messages:
    2,875
    Resources:
    159
    Models:
    49
    Icons:
    89
    Packs:
    8
    Skins:
    12
    Maps:
    1
    Resources:
    159
    Isn't misses still 50% damage dealt. Or was that removed?
     
  2. Wrda

    Wrda

    Joined:
    Nov 18, 2012
    Messages:
    1,095
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    No idea what you're talking about, if a unit miss the target, he misses, doesn't deal damage. If a unit has splash damage and missile type, it will never miss.
     
  3. pusha1999

    pusha1999

    Joined:
    Jan 7, 2014
    Messages:
    67
    Resources:
    0
    Resources:
    0
    no :)
     
  4. The_Silent

    The_Silent

    Joined:
    Feb 4, 2008
    Messages:
    2,875
    Resources:
    159
    Models:
    49
    Icons:
    89
    Packs:
    8
    Skins:
    12
    Maps:
    1
    Resources:
    159

    upload_2019-6-16_18-33-53.png


    No idea, does that mean this gameplay constant does nothing then?
     
  5. Wrda

    Wrda

    Joined:
    Nov 18, 2012
    Messages:
    1,095
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Now that you mention it, it probably has something to do with what I said, with splash damage. Still, need to test what that thing does exactly.
     
  6. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,298
    Resources:
    16
    Tools:
    2
    Maps:
    2
    Spells:
    7
    Tutorials:
    4
    JASS:
    1
    Resources:
    16
    I think that constants changes the miss change by cliff levels.
     
    Last edited: Jun 17, 2019
  7. pusha1999

    pusha1999

    Joined:
    Jan 7, 2014
    Messages:
    67
    Resources:
    0
    Resources:
    0
    Code (vJASS):

    native IsAbilityPassive takes integer abilityId returns boolean
    //Detect ability is passive or not

    native PlayerShareUnitVisionEx takes player whoShare, player toShare, boolean share returns boolean
    //Share vision of units inventory cd, Abilities and also abilities cd, without control to player
    //or just new ALLIANCE_TYPE variable

    native PlayerShareUnitVision takes unit wichUnit, player toWichPlayer, boolean share returns boolean
    //Same as previous, but only for selected unit shared vision of cd, inventory and etc. Without control
    //or just new ALLIANCE_TYPE variable

    native GetConvertedType takes type wichType returns integer
    //Thats means you can take every primitive type wich converted with function Convert....(int) and get index(integer) of this
    //For example UNIT_TYPE_PEON = ConvertUnitType(16), so you can:
    //local integer utype = GetConvertedType(UNIT_TYPE_PEON) thats means utype = 16

    native GetFilterInteger takes integer wichFilter returns boolean
    //Uses previous function GetConvertedType in filter functions, thats means will be worked more faster than filtering unittypes, itemtypes and etc, and will be universally for every filters

    native RealWithInt takes integer beforeDotl, integer AfterDot returns real
    //thats means you can make any real with integer arguments, for example:
    //local integer i = 123
    //local integer a = 5
    //local real b = realRealWithInt(a,i) thats will be looks like a.i or 5.123, or:
    //====================
    //local integer i = 143
    //local real a = RealWithInt(5,i) and will looks like a = 5.143

    native GetIntFromReal takes real arg1, boolean afterDot returns integer
    //returns an value integer of real after dot
    //For example
    //local real a = 3.14
    //local integer i = GetIntFromReal(a,true) wich returns 14, or GetIntFromReal(a,false) wich returns 3

    native RootReal takes real arg, real rootArg returns real
    //returns a root of real from pow rootArg
    //For example local real a = 156
    // local real b = RootReal(a, 5) thats means some value x^5 = a, so this function will return x

    type matrix extends smth... or not extends
    //new type wich will an alternative of hashtables with every size as you want for example wich also emulate an 2D and 3D massives and works more faster and universally, and you can save every type with same values of matrix.
    for example:
    you can save in matrix with X=1 coordinate, Y=1 coordinate, Z=1 coordinate a unit and also an integer,
    when you save a different types in same coordinates, VM will create a different adresses in memory.
    Its more comfortable and more faster for use than a big hashtables. As you know, for save in hash a different values you should do smth like this:
    // call SaveUnitHandle(h,GetHandleId(smth),0,unit)
    and you cant save the different value in childhash and you should for save other different value make another point in childhash...call SaveInteger((h,GetHandleId(smth),1,integer) and etc...
    but with matrix you can save this in same coordinates. Sorry for my engl. its hard to explain.:)
    Who understand what is matrix, should to know)

    native CreateMatrix takes nothing returns matrix
    //Creates a matrix of integers,reals... and natives for work with it...

    native SetMatrixSizeX takes matrix ma, integer sizeX returns nothing
    //Set a value of matix size X

    native SetMatrixSizeY takes matrix ma, integer sizeY returns nothing
    //Set a value of matix size Y

    native SetMatrixSizeZ takes matrix ma, integer sizeZ returns nothing
    //Set a value of matix size Z (if no setup this value, will be a defaul 2D matrix)

    native GetMatrixSizeX/Y/Z takes matrix ma returns integer
    //Get size of matrix of XYZ

    native SaveMatrixValueX/Y/Z takes integer x/y/zCoordinate, type value returns nothing
    //Set a value (any type) of matrix in xyz coordinate

    native GetMatrixValue takes integer x, integer y, integer z return type
    //returns a type wich saved in coordinates xyz, so if there is a unit, then matrix will return unit, if there //is an integer, then will return integer F.E:
    local unit a = GetMatrixValue(1,4,2) so its should return (unit for example). If there is //no unit, then return null.
    also in same time:
    local real b = GetMatrixValue(1,4,2)

    native SetEventPriority takes trigger trig, type eventype, integer priority returns nothing
    //set a value of priority of fire events with same eventid, value > means more priority
    //to avoid a big systems with that

    native SetEventPriorityEx takes type eventype, type eventtype2, integer priority returns nothing
    //set a value of a events fire priority, thats means priority between different events wich fire for unit use an item and event cast ability for example, you can setup a priority wich event will fire first for all map...wich event will fire first
     
    Last edited: Jun 17, 2019
  8. Wrda

    Wrda

    Joined:
    Nov 18, 2012
    Messages:
    1,095
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    No, that's another field.

    Sem Título.png
     
  9. pusha1999

    pusha1999

    Joined:
    Jan 7, 2014
    Messages:
    67
    Resources:
    0
    Resources:
    0
    Code (vJASS):

    native GetUnitAnimationByIndex takes unit u returns integer
    //returns an index of unit's current animation

    native GetUnitAnimation takes unit u returns string
    //also returns string name of unit's current animation

    constant event UNIT_REGISTER_GOT_ABILITY(aslo buff)
    constant event PLAYER_UNIT_REGISTER_GOT_ABILITY(aslo buff)
    thats events means not learn skill, but when ability or buff added to unit and also lost ability or buff
    also
    native GetTriggerAbility takes nothing returns ability
    native GetTriggerAbilityId takes nothing returns integer
    //this natives responds on new events


    native TriggerRemoveEvent takes trigger t, event e returns boolean
    //removes an event from the trigger

    native TriggerDisableEvent takes trigger t, event e returns boolean
    //disable an event of trigger, very usefull if trigger for example got more than 1 different events

    native SetTriggerEventIndex takes trigger t, event e, integer onWichIndex returns nothing
    //thats means you can set integer index on event in trigger (like SetUnitUserData function for example)

    native GetTriggerEventIndex takes trigger t, event e returns integer
    //thats means you can get a number of event in trigger

    native TimerStart takes timer t, real period, boolean periodic, code callBack returns nothing
    //so timer will save the code or new native
    native SaveTimerCode takes timer t, code callBack returns nothing

    native GetTimerCode takes timer t returns code
    //thats means timer will return code of his callBack or null if there is no

    native GetTriggerCondition takes trigger t returns conditionfunc

    native GetTriggerAction takes trigger t returns triggeraction

    native GetTriggerEvent takes trigger t returns event
    //if trigger got more than 1 events, then returns null

    native GetTriggerEventEx takes trigger t, integer eventIndex returns event
    //returns an event of trigger if he got indexed, if not - return also null

    native SetTriggerEventValue takes trigger t, event e, real NewValue returns nothing
    //if trigger event has no index, then you can change the value of some events like Life of unit more than <value>,
    //if trigger has events where is no values, then just no actions.

    native SetTriggerEventValueEx takes trigger t, event wichEvent, integer eventIndex, real newValue returns nothing
    //if trigger has indexed events and they can takes a value, then you can change them, if not, then no actions

    native SetTriggerEventValue takes trigger t, event e returns real
    // just returns a value of event if no indexed

    native SetTriggerEventValueEx takes trigger t, event e, integer index returns real
    //returns an indexed event of trigger value, if event has no value, then no actions

    native GetUnitTimedBuffTime takes unit u, integer buffid returns real
    //returns a time of timed effect of unit/hero, like morphed buff for example

    native GetUnitTimedBuffTimeRemaining takes unit u, integer buffid returns real
    //returns a remaining time of timed effect of unit/hero, like morphed buff for example

    native SetUnitTimedBuffTime takes unit u, integer buffid, real newValue returns nothing
    //same as Get function, but with set new time

    native UnitPauseTimedEffect takes unit u, integer buffid, boolean pause returns boolean
    //pause or unpause the timed effect of unit's buff like morphing for example. Also returns boolean //paused or not for using in conditions calls

    native UnitAddStun takes unit u, boolean add returns boolean
    //that means you can add/remove to unit a stun buff, doesnt matter immuned he or not.
    //also returns boolean for using in condition checks.

    native UnitAddBuff takes unit u, integer buffId, boolean add returns boolean
    //just add a buff to unit with icon without real effects and also returns a boolean

    native GetMaximumInt takes integer ArrayInt, integer arrayMin, integer arrayMax returns integer
    //returns a maximumal integer wich has been defined in array
    //here is a problem to define as argument array type so need a new native to save a variable name in //string and convert it back like smth
    (native Var2String takes type wichType returns string)
    //and also
    (native String2Var takes string wichString returns type)
    //have no idea how to realize this but i guess its possible, in example mb this will looks like
    local integer array A
    local string name = Var2String(A)
    local integer maxInt
    //some code with define a integers values
    set maxInt = GetMaximumInt(String2Var(name),2(min array index from where to start),15(max array index when to stop))

    native GetMaximumReal takes real ArrayReal, integer arrayMin, integer arrayMax returns real
    //same as GetMaximumInt algorithm...
    //ALSO IF TYPE IS NOT ARRAY, then just return 0

    Also same natives with GetMinimalInt/Real...
     
     
    Last edited: Jun 21, 2019
  10. Wrda

    Wrda

    Joined:
    Nov 18, 2012
    Messages:
    1,095
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    The hell? Why would you want an event for detecting when an ability was added when you can simply do "UnitAddAbility(etc)" whenever you want and with that you already know it was added? How would this even respond to morphing units?

    Not sure where this would be useful for. Where would you use this?

    A disabler but no enabler? More like this
    Code (vJASS):
    native TriggerDisableEvent takes trigger t, event e, boolean flag returns nothing
    //disable an event of trigger, very usefull if trigger for example got more than 1 different events


    Do these even have any practical use?

    What does that even mean to save code? If a timer has a code callback then it already is saved, or retained? Unless it also uses other codes. Probably also gets in conflit.

    What happens if an idiot gets more than 1 triggercondition/triggeraction?
    Why make GetTriggerEvent return null when more than 1 event while you could make it get the triggering event (the event which fired the trigger) instead?

    None of these seem to have any use besides not making sense at all, and duplicated native names, a setter doesn't make sense to return something here honestly.

    Not needed, in 1.31.1 we can access object fields, however some of them don't work yet.

    Irrelevant if no timeout specified, and stacking would be good. Makes no sense to take a boolean "add" if the native itself is called UnitAddStun, why would anyone use false? You Can simply remove the buff with the already existing native. Has no purpose being able to use in if statements. Has no source.
    Code (vJASS):
    native UnitApplyUnitStun takes unit source, unit target, real timeout, boolean stack returns boolean
    //that means you can stun buff to a unit, doesn't matter if immune.


    Irrelevant with same points as last one, also, no point to have a buff if there isn't effect.

    No, just no. One could simply define the start point and end point of an array and do their job without any effort, no need for this overcomplicated scenarios.
     
    Last edited: Jun 23, 2019
  11. pusha1999

    pusha1999

    Joined:
    Jan 7, 2014
    Messages:
    67
    Resources:
    0
    Resources:
    0
     
  12. Volchachka

    Volchachka

    Joined:
    Sep 26, 2012
    Messages:
    16
    Resources:
    0
    Resources:
    0
    Maybe someone asking themselves about resource gathering events. Just among my friends came a question: "How detect resource gathering at worker?" Because I've thought about this suggestion:
    Code (vJASS):
    native   ConvertResourceGatheredType             takes integer i returns resourcegatheredtype

    constant resourcegatheredtype    GOLD_GATHERED                            = ConvertResourceGatheredType(0)
    constant resourcegatheredtype    LUMBER_GATHERED                            = ConvertResourceGatheredType(1)
    constant unitevent                 EVENT_UNIT_RESOURCE_GATHERED            = ConvertUnitEvent(n)
    constant unitevent                 EVENT_UNIT_RESOURCE_GATHERING            = ConvertUnitEvent(n) // for wood only
    constant unitevent                 EVENT_UNIT_RESOURCE_GATHERED_DELIVERED    = ConvertUnitEvent(n)
    constant unitevent                 EVENT_UNIT_RESOURCE_GATHERED_DELIVERING    = ConvertUnitEvent(n)
    constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_GATHERED        = ConvertUnitEvent(n)
    constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_GATHERING    = ConvertUnitEvent(n) // for wood only
    constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_DELIVERED    = ConvertUnitEvent(n)
    constant playerunitevent         PLAYER_EVENT_UNIT_RESOURCE_DELIVERING    = ConvertUnitEvent(n)

    native BlzWorkerHasResourceGathered             takes unit worker returns boolean
    native BlzWorkerIsResourceGathering             takes unit worker returns boolean
    native BlzWorkerGetResourceGatheredType         takes unit worker returns resourcegatheredtype
    native BlzWorkerSetResourceGatheredType         takes unit worker, resourcegatheredtype rgtype returns nothing
    native BlzWorkerGetResourceGathered             takes unit worker returns integer
    native BlzWorkerSetResourceGathered             takes unit worker, integer resourcegathered returns nothing
    native BlzWorkerGetEventResourceGathered          takes nothing returns integer
    native BlzWorkerSetEventResourceGathered         takes unit worker, integer resourcegathered returns nothing
    native BlzWorkerGetEventResourceGatheredType    takes nothing returns resourcegatheredtype
    native BlzWorkerSetEventResourceGatheredType     takes resourcegatheredtype rgtype returns nothing
    native BlzGetEventGatheringWorker                 takes nothing returns unit
    native BlzGetGatheringGoldmine                     takes nothing returns unit
    native BlzGetGatheringTree                         takes nothing returns destructable
    --- update --

    Code (vJASS):

    native BlzWorkerGetEventChoppedWood takes nothing returns integer // And work with wisp's harvesting
    native BlzWorkerSetEventChoppedWood takes integer setwoodchopped returns nothing  
     
     
    Last edited: Jun 24, 2019
  13. pusha1999

    pusha1999

    Joined:
    Jan 7, 2014
    Messages:
    67
    Resources:
    0
    Resources:
    0
    i think its can be detected from orders. mb not))
     
  14. Volchachka

    Volchachka

    Joined:
    Sep 26, 2012
    Messages:
    16
    Resources:
    0
    Resources:
    0
    And were you thinking about their accuracy?
    One orders aren't enough for a more trick things but some modders think wider. A therefore alone orders maybe an unusable. I hope that suchlike natives will be usable. Just as some maps can use the systems for resource's gathering which can be of any type. E.g.: minerals, oil, gold, gems, crystals and etc. And everything this interacts with the custom Game UI constructed by frame natives.
     
  15. pusha1999

    pusha1999

    Joined:
    Jan 7, 2014
    Messages:
    67
    Resources:
    0
    Resources:
    0
    idk, never had a this questions, but ive seen some hidden and also seen an orders about resource gathering.:) anyway, more natives - more good maps and more players. So ofc they should be :), also im for a less shaman's dances of users to find a descisions of their questions.
     
  16. Damage

    Damage

    Joined:
    Aug 31, 2009
    Messages:
    620
    Resources:
    5
    Maps:
    3
    Spells:
    2
    Resources:
    5
    Can someone clarify - the list of natives on the first post of this thread, are they already in the game (PTR or otherwise) or are they not added yet?
     
  17. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,611
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    Added long ago.
     
  18. chopinski

    chopinski

    Joined:
    May 16, 2012
    Messages:
    146
    Resources:
    0
    Resources:
    0
    Not all of them, there are some like "ModifyUnitAttackSpeedBonus" that do not exist.
     
  19. Serenity09

    Serenity09

    Joined:
    Mar 7, 2011
    Messages:
    39
    Resources:
    0
    Resources:
    0
    Not all of them have been added, and some of what isn't there won't be there at all in the near future. Unfortunately, there is no single full / current documentation of the JASS API...

    I'd recommend using JASS Manual for all natives before 1.24, and then the individual patch notes for new natives since 1.24. I would guess that there won't be a up-to-date single source of documentation until the API settles down, optimistically, around Reforged's release
     
  20. Pyrogasm

    Pyrogasm

    Joined:
    Feb 27, 2007
    Messages:
    2,899
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Everything they have added starts with Blz and can be found here: common.j -- patch 1.31.1 | HIVE