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. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. 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. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    Most maps can achieve the player control thing by just using an allied computer player, but yes, maps with more than 6 human players would certainly benefit.
     
  2. Avahor

    Avahor

    Joined:
    Sep 29, 2008
    Messages:
    282
    Resources:
    7
    Skins:
    4
    Maps:
    3
    Resources:
    7
    Nice list @Kam,
    I'm very hyped with all those natives.
    Anyway I woud like to add two more suggestions

    1- As I wrote in older posts, As a mapper I've missed several times more widget's related natives.
    Basically these two:
    Code (vJASS):

    native TriggerRegisterWidgetInRange takes trigger whichTrigger, widget whichWidget, real range, boolexpr filter returns event
    native GroupEnumWidgetsInRange takes group whichGroup, real x, real y, real radius, boolexpr filter returns nothing //this one is a bit harder to describe cuz group is currently defined for units.
     


    I just found only one directly related widget event in native functions list:

    Code (vJASS):
    constant widgetevent EVENT_WIDGET_DEATH = ConvertWidgetEvent(89)


    Item deteccion, custom lumber, scene modifications always were a hard task to solve, with no solution without use of inefficient workaround functions.
    As jass manual reads widget type is child of handle. units, items and destructables are childs of widget type. Since there are "Enum" natives for all widget childs, both suggested natives makes easier links between different object type interaccions like units and items, or items and destructables.


    2- Model tall attribute read would be great too, basically for Z coords calculations, jumps and 3d movements. Something like GetUnitTall() or GetModelTall(widget)
     
  3. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,953
    Resources:
    16
    Icons:
    1
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    16
    All good stuff! These made me think of several things:

    1. When using FirstOfGroup, if a unit was removed from the game but was still in the group you're sifting through the thread would crash. This was circumvented by using ForGroup and refreshing the group, but it would still be good to have that fixed if it hasn't been already.
    2. GetClosestWidget() as a native with units/destructibles/items/etc version for speed. It should also take a movement type to see which widget will be reached fastest depending on what movement plane you're trying to track. This would be similar to a Peon automatically acquiring the nearest tree for harvesting after having felled the previous one.
    3. Groups for destructibles perhaps?
     
    Last edited: Dec 29, 2017
  4. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,358
    Resources:
    17
    Tools:
    2
    Maps:
    2
    Spells:
    8
    Tutorials:
    4
    JASS:
    1
    Resources:
    17
    Some natives I think would be cool to have, but are not mentioned yet.
    Code (vJASS):

       native TimerSetRemaining takes timer t, real newTime returns nothing
           //Set Remaining time would allow to enlarge/shorten a timer's duration.
           //Or evoke its execution instantly
           //without changing execution code nor repeat mode.
         
       native TimerSetRepeat takes timer t, real repeatTime returns nothing
           //change the repeatTime of an timer.
           //will en/disable repeat mode, if needed.
         
       native IsRequirementProvided takes player p, integer objectId returns boolean
           //A player provides the requirements of an ability/item/unit/tech(Research) ?
     
       native IsUnitAbilityAllowed takes unit u, integer abilityId returns boolean
           //Can this specific unit use/cast this ability?
           //has the ability, disabled, etherial (bodyical abilities), silenced (magical abilities), requirements, shown, mana, cooldown?
     
       native UnitDisableTechBoni takes unit u, boolean flag returns nothing
           //Allows/Disallows a unit benefiting from techs researched.
     
       native FirstOfForce takes force f returns player
           //same as FirstOfGroup, for player-groups.  
     
       native UnitDisablePassiveAbilities takes unit u, boolean flag returns nothing
           //Disables/Enables all passive abilities a unit has. (bash, crit, poison attack, feedback, hardskin, spell Immunity, evasion, auras, orbs ...)
           //This won't hide the abilities, it simply is "Silence" for passives.
           //Should not affect simple stat boosts (aka +armor; +atk, speed ...).
     

    Following together with disable unit ability would allow the mapper doing "UnitDisablePassiveAbilities" himself.
    But the automatic native or a spell doing that would be better.

    Code (vJASS):
     
         native GetObjectBase takes integer typeId returns integer
           //With World Editor yon can only create clones of abilities/units/buffs/Destructables this native would
           //return the Id of the base of a given clone (default objects will return their own Id).
     
       native GetUnitAbility takes unit u, integer index returns integer  
           //Returns the abillityId at index of the unit's ability stack/List
           //might be useful to disable/remove all abilities a unit has.
         
       native GetUnitAbilityCount takes unit u returns integer
           //Returns the amount of abilities an unit has.
     
     
  5. puffdragon

    puffdragon

    Joined:
    Jul 10, 2008
    Messages:
    348
    Resources:
    0
    Resources:
    0
    DestroyEffectTimed()
     
  6. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,612
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    And what is it meant to do? Destroy all currently active effects in 1 second?
     
  7. Kaijyuu

    Kaijyuu

    Joined:
    Jun 2, 2004
    Messages:
    848
    Resources:
    0
    Resources:
    0
    My first guess would be destroying a given effect after a given amount of time. Which is a function one could make in about 3 minutes with some basic knowledge of jass and timers.

    Convenience funcs are nice and all but there are much bigger fish to fry.
     
  8. DracoL1ch

    DracoL1ch

    Joined:
    Dec 12, 2010
    Messages:
    1,759
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    Meh. They didn't even bothered with DoesUnitHaveItem, instead you have to loop through items everytime. Sure it doesn't really matter in most cases yet for some TD with tons of units it's impressive overheat for nothing. That's whats called Quality of life changes and thats what never was there since 2009.
     
  9. puffdragon

    puffdragon

    Joined:
    Jul 10, 2008
    Messages:
    348
    Resources:
    0
    Resources:
    0
    Why 3mins, probly you need like 20sec to type 3variables, but i assume it would be faster if its done as native, same as UnitApplyTimedLife.

    @Kam can you please remove the internal memory leak from GetIssuedOrderId() ?
    Actually, can we just remove all internal memory leaks of many natives... (or as much as possible...)
     
    Last edited: Dec 30, 2017
  10. Flux

    Flux

    Joined:
    Feb 6, 2014
    Messages:
    2,333
    Resources:
    28
    Maps:
    1
    Spells:
    19
    Tutorials:
    2
    JASS:
    6
    Resources:
    28
    To add on your idea, perhaps a very customizable Buff Object (like Channel for Abilities). The downside of using a buff system (Slow aura) is when the duration is almost over, it is not blinking.

    For new structs/class feature, will this be a truly dynamic memory allocation (heap) and not like the vJASS structs that just uses array with unique indices or am I asking too much?
     
  11. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,612
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Except UnitApplyTimedLife has a variety of different function parameters. The one your requesting has none? I do not see how it is meant to work, especially without a description.
    The list is a list of suggestions which the maintenance team will look at. Just because it is on the list does not mean we may ever get it.
     
  12. puffdragon

    puffdragon

    Joined:
    Jul 10, 2008
    Messages:
    348
    Resources:
    0
    Resources:
    0
    It only has 'BTLF' parameter, if you put anything else in wont work, so actually only has 1 function


    DestroyTimedEffect(effect whichEffect, real time), in extension tho costumizeable effects would be perfect but is not of the highest priority I suppose. Would make my life a bunch easier tho.

    Right now we assign assign model on unit and then treat it as a unit which kill with timedlife. If we could set color and size on effect else well as timed"life" in 1 wrapper would be ideal. Bunch of work that could be avoided and bunch of overhead too.

    DestroyTimedEffect(effect whichEffect, real time)
    SetEffectColor(r, g, b, a)
    SetEffectSize(x, y, z)
     
    Last edited: Dec 30, 2017
  13. karlek

    karlek

    Joined:
    Dec 31, 2017
    Messages:
    8
    Resources:
    0
    Resources:
    0
    I've heard that there exists a pathing cost function in the Starcraft 2 editor. It would be a very useful addition.

    Code (vJASS):

    // GetPathing returns the pathing cost between two points and returns -1 if it's unreachable.
    function GetPathingCost takes real x1 real y1 real x2 real y2 returns int
     
     
  14. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,181
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Why weren't some points not added from my suggestions? Additionaly, they also could think about hashtable limit 256.
    But so? I didn't even recommend to remove the limit, but to reconsider it, potentially increasing. If developers face the task, they will decide if it can/should be increased or not, but that's nothing you can easily decide for not to even check it.
     
    Last edited: Jan 4, 2018
  15. fenix140

    fenix140

    Joined:
    Sep 6, 2010
    Messages:
    46
    Resources:
    0
    Resources:
    0
    Thanks for the theme, Kam. Although it is repetitive what I am going to post, maybe these functions could be inside the natives:

    Code (vJASS):
    //Change the effect (birth,attack,walk,etc) of launch SFX model how a normal model.
    native SetSpecialEffectAnimation takes effect fx, string whichAnimation returns nothing
    native QueueSpecialEffectAnimation takes effect fx, string whichAnimation returns nothing
    ....//Include, ByIndex

    //Update of lightning size effects and triggers.
    native SetLightningScale takes lightning whichBolt, real scale returns nothing

    //Native Show Unit with GetLocalPlayer()  work to hide a unit for a single player.
    native ShowUnitLocalPlayer takes unit whichUnit, player pUnit, boolean show returns nothing

    //Add more functions in multiboard as (SetMultiboardX / SetMultiboardY) also add more than one multiboard and leaderboard in the game.
    native SetMultiboardXY takes multiboard mb, real Xmb, real Ymb returns nothing
    native SetLeaderboardXY takes leaderboard lb, real Xlb, real Ylb returns nothing
    ...//Include more functions

    //New functions to change in jass "angX, angY, height", "scale", "color, sound", etc to "WeatherEffect" and no longer create climates with the same effect with different angles or different sizes with different colors, etc in the main Exel.
    native SetHeightWeatherEffect takes weathereffect whichEffect, real height returns nothing
    native SetAngXWeatherEffect takes weathereffect whichEffect, real angleX returns nothing
    native SetAngYWeatherEffect takes weathereffect whichEffect, real angleY returns nothing
    native etc...

    //Functionality full of the function native: SetUnitScale(unit, X, Y, Z) -> Enable Y and Z. or derivatives.
    native SetUnitScaleY takes unit whichUnit, real scaleY returns nothing
    native SetUnitScaleZ takes unit whichUnit, real scaleZ returns nothing

    //Add to Vertex coloring the white hues for models.
    native SetUnitVertexAlphaColor takes unit whichUnit, integer red, integer green, integer blue, integer alpha returns nothing

    //Increase rendering angle if possible, so that the models do not desaparescan with small camera angles.
    //http://www.hiveworkshop.com/forums/world-editor-help-zone-98/disappearing-doodad-help-195504/
    native SetRenderingModelRect takes player p, real renderX1, real renderY1, real renderX2, real renderY2 returns nothing
     
    Maybe there are functions that can not be performed, but it would be good to be taken into account. Regards...
     
    Last edited: Jan 26, 2018
  16. puffdragon

    puffdragon

    Joined:
    Jul 10, 2008
    Messages:
    348
    Resources:
    0
    Resources:
    0
    Honestly, before you add anything new... fix many natives memory leaks... I suspect their coding its just like in blizzard.j cause many of them leak. The difference is, we can just bypass blizzard.j or even remake them and fix them, but we can't do same with the existing natives. If we had access to them, I would do it myself. Anw, please fix those memory leaks.

    This should be priority 1, and then add anything new.
     
  17. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,324
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    ^^ In light of that, the terraineffect variable type or something like that cannot be used effectively since it leaks and it has no way of being cleaned up, either by functions or natives.

    @Kam

    I feel like those natives will come out in either the 1.28.6 patch or 1.29.0 patch.
     
  18. Kam

    Kam

    Joined:
    Aug 3, 2004
    Messages:
    2,630
    Resources:
    23
    Models:
    8
    Icons:
    2
    Maps:
    13
    Resources:
    23
    Clarification on these please:

    SetUnitMaxSpeed and minspeed
    What exactly are they referring to?

    function GetLocalTargetAttachmentX takes widget who, string attachmentname returns real //Get the map relative x coordinate of the specified attachment site. Not net safe.
    What is LocalTargetAttachment?

    GetUnitAbilityCooldownTimeout, is it GetUnitAbilityCooldown?
    Is it the cooldown of the ability?
     
  19. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,612
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    I have no idea sorry. They were on the original list and undocumented. I think it is meant to be a native that sets the maximum movement speed on a per unit basis.
    When attaching a model to a unit at an attachment site the attached model is offset in the game world to be at the attachment site. It follows this attachment site around. This returns the immediate global position of an attachment site for a widget. Since this depends on animation state it is local, meaning the result is different between clients like the GetLocalPlayer native.

    I am not sure what people would use this for, but this was a better defined version of something on the old list.
    There are twoparts to cooldown. The current cooldown remaining and the total cooldown that the current cooldown started from. These are both important because they define the UI cooldown state of an ability.

    GetUnitAbilityCooldownTimeout returns the total cooldown time for an ability, what current cooldown is set to when an ability is cast.
    GetUnitAbilityCooldownRemaining returns the current cooldown time for an ability, the amount of cooldown time remaining before it is ready to cast again.
     
  20. Kam

    Kam

    Joined:
    Aug 3, 2004
    Messages:
    2,630
    Resources:
    23
    Models:
    8
    Icons:
    2
    Maps:
    13
    Resources:
    23
    Thank you!

    GetUnitAbilityCooldown

    GetUnitAbilityCooldownTimer

    GetUnitAbilityCooldownRemaining

    GetAbilityCooldown

    Do these all need to be separate?