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. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,333
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    This is for Patch 1.30.

    Code (vJASS):

    native IsUnitAbilityDisabled takes unit u, integer abilId returns boolean
        // Returns a flag whether or not an ability is silenced. (Based on the counter mechanism for disabling and enabling abilities, exposed as a native)

    unitevent EVENT_UNIT_EVADE
        // A unitevent that fires on evasion.
     
     
  2. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,956
    Resources:
    16
    Icons:
    1
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    16
    Ah, an evade event would be really neat. What functions would be available on EVENT_UNIT_EVADE? GetTriggerUnit() for the evading unit and GetAttacker() for the attacker? Assuming they're not evading a splash damage.
     
  3. nedio95

    nedio95

    Joined:
    Mar 24, 2011
    Messages:
    1,055
    Resources:
    1
    Spells:
    1
    Resources:
    1
    I just got happy seeing this and remembered that this is only a "Please, do this" thread...

    Code (vJASS):
    native IsUnitAbilityDisabled takes unit u, integer abilId returns Boolean
    // Returns a flag whether or not an ability is silenced. (Based on the counter mechanism for disabling and enabling abilities, exposed as a native)
    Shouldn't that be named differently? There are quite a few ways to disable an ability different than silence. And by "Quite a few" I mean 1 (maybe 2) other ways :|

    Edit// Can you even evade splash damage? Is splash damage evade-able ?

    regards
    -Ned
     
  4. Spellbound

    Spellbound

    Joined:
    Jan 9, 2005
    Messages:
    1,956
    Resources:
    16
    Icons:
    1
    Skins:
    5
    Spells:
    9
    JASS:
    1
    Resources:
    16
    Unsure, I just put it there in case you can evade splash damage :p
     
  5. Death Adder

    Death Adder

    Joined:
    Nov 3, 2013
    Messages:
    886
    Resources:
    0
    Resources:
    0
    There's this field called "Missed Attacks Damage Factor" in game constants for splash damage attacks. Tbh I'm not completely sure how it works, but either way, since it does say damage factor, even if they miss, they still deal damage. So I'm not sure if you can still call it being evaded...

    But presumably it has to do with splash attack being homing, but you get out of the range or something, so that 25% miss chance from high ground or moving out of range happens or something... Just my guesses
     
  6. Wrda

    Wrda

    Joined:
    Nov 18, 2012
    Messages:
    1,216
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    Missile (splash), the splash damage is not evadable in anyway, only if you are out of its damage area.
    Now that we're talking about evasion stuff...
    Would be cool to do this:
    Code (vJASS):

    native MakeUnitMissAtk takes unit u returns nothing
    //Makes unit miss its next attack.
     

    Wasn't
    unitevent EVENT_UNIT_EVADE
    already asked here?
     
  7. disruptive_

    disruptive_

    Joined:
    Mar 19, 2017
    Messages:
    160
    Resources:
    0
    Resources:
    0
    Missile (splash) always damage it's intended target. If the missile is set to Homing > False, it still applies the small area damage factor to units that tread to far. Giving this last fact, is recommended to set the homing field to true, as it will look very weird how units take damage from a missile that exploded very far or that you can't see at all.

    But you can potentially use Missile (splash) units to feature a pseudo-evade system. Not really the vanilla WC3 evasion for missiles (i think the only effect is that the missile is directed to the ground instead of the unit impact Z).

    If you set the small area damage factor to 0.01 for a unit with Missile (splash), units that are inside the small area damage will take almost no (in fact dmg*factor, but you get the idea) damage.
    You could say that units with high damage will deal damage regardless, but this is counterable by using a damage event trigger (or your handy DDS) and the new attack damage functions. If you detect physical/attack damage type (most DDS allows this feature) and it happens that the damage event amount is less than the attack (here comes the new attack get functions) multiplied by the small area damage factor, then you got a missed attack. Then you apply the events.
    This is no theorycraft at all, and allows for manual evasion of attack missiles. The distance of evasion will be basically the medium damage area of the unit that attacks.

    The sad part of Missile (splash) is that some abilitis will not work, ie. Barrage, Flaming Arrows, Cold Arrows, etc.
    Orb of Annihilation (don't remember the exact name) works with units with Missile (splash) and allows to potentially increase area of effect dinamically (multiple levels).
     
  8. Death Adder

    Death Adder

    Joined:
    Nov 3, 2013
    Messages:
    886
    Resources:
    0
    Resources:
    0
    Oh right, I thought of something, and I can't see it listed under the Unit section. Though I did notice there's already this:

    Code (vJASS):
    function SetUnitMovementType takes unit u, movementtype movementType returns nothing
            //Changes the movement type of a unit to the specified movement type.


    But it would be nice to also have the ability to change unit targeting tags and classifications. Stuff like: Ground, Air, Organic, Mechanical, Ward, Tauren, Undead, Giant, etc.

    For instance, if I changed the unit's movement type to flying, I might also want to change it from being targeted as a ground unit to a flying unit.

    Otherwise it would be kind of stupid if melee units could attack my flying unit.
     
  9. deepstrasz

    deepstrasz

    Map Reviewer

    Joined:
    Jun 4, 2009
    Messages:
    12,139
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Now that we're at it, I'd love some sort of unit classification designated through strings and variables. That would open so much possibilities like making units immune to certain types of attacks etc.
     
  10. DracoL1ch

    DracoL1ch

    Joined:
    Dec 12, 2010
    Messages:
    1,762
    Resources:
    2
    Tutorials:
    2
    Resources:
    2
    movement types are different: there are one for "others" and one for "self". A-la units with Agho doesn't go throw other units but other can walk trhou them. So it has to be 2-values.
     
  11. MyPad

    MyPad

    Spell Reviewer

    Joined:
    May 9, 2014
    Messages:
    1,333
    Resources:
    7
    Models:
    1
    Icons:
    2
    Spells:
    3
    JASS:
    1
    Resources:
    7
    It's a follow up request.

     
  12. Retera

    Retera

    Tool Reviewer

    Joined:
    Apr 19, 2008
    Messages:
    853
    Resources:
    25
    Models:
    17
    Tools:
    2
    Maps:
    6
    Resources:
    25
    Classifications are already available and have been for 15 years via the native UnitAddType (and IsUnitType for checking them)

    I don't recall how it affects target types. But I wanted to point this out before Blizzard spends their time coding an API that they already gave us 15 years ago. The potential upgrade we might wish to ask for would be for target types. I recall using UnitAddType to make units mechanical many, many years ago, because I changed the gameplay interface to show level of hunger in a survival map by replacing the Mechanical text. There was another classification, might have been Undead, that also showed in game after being changed by the UnitAddType native, because I had at least 2 hunger states that could be added by JASS in my map all those years ago.

    For example, checking if a destructible was Targeted As "Tree" in JASS was many, many lines of code. Likewise, for a mod I made, I wanted an aura that only benefits wards. That code for that determination is very long, because you must exploit the return value of IssueTargetOrder with a dummy unit and observe whether it returns true. You can verify any kind of target type in the existing JASS system with a dummy unit and IssueTargetOrder's return value, but it is inefficient code. And there are probably some Targeted As types that you can't add with UnitAddType.
     
    Last edited: Jul 14, 2018
  13. Volchachka

    Volchachka

    Joined:
    Sep 26, 2012
    Messages:
    16
    Resources:
    0
    Resources:
    0
    May be this variant is better than I early suggested? For dialogue is necessary, probably. I've solved that rpgdialog not need. simply add these features for dialog. Though it's late. This my last suggestion for jass.

    Code (vJASS):

    type dialog         extends agent
    type dialogelement     extends dialog
    type dialogoption     extends dialog
    type button         extends dialogelement
    type portrait         extends dialogelement
    type checkbox         extends dialogelement
    type radio             extends dialogelement
    type textfiled         extends dialogelement
    type textarea         extends dialogelement
    type icon             extends dialogelement
    type label             extends dialogelement
    type droplist        extends dialogelement

    native ConvertDialogOptionType takes integer i returns dialogoption

    constant dialogoption STYLE_READONLY         = ConvertDialogOptionType(0)
    constant dialogoption STYLE_SCROLL             = ConvertDialogOptionType(1)
    constant dialogoption STYLE_CHECKED         = ConvertDialogOptionType(2)
    constant dialogoption CHANGE_TEXT             = ConvertDialogOptionType(3)
    constant dialogoption CHANGE_ALPHA          = ConvertDialogOptionType(4)
    constant dialogoption CHANGE_POS_X             = ConvertDialogOptionType(5)
    constant dialogoption CHANGE_POS_Y          = ConvertDialogOptionType(6)
    constant dialogoption CHANGE_WiDTH             = ConvertDialogOptionType(7)
    constant dialogoption CHANGE_HEIGHT          = ConvertDialogOptionType(8)
    constant dialogoption STYPE_DISPLAY          = ConvertDialogOptionType(9)
    constant dialogoption CHANGE_FILE_PATH        = ConvertDialogOptionType(10)
    constant dialogoption CHANGE_RED              = ConvertDialogOptionType(11)
    constant dialogoption CHANGE_GEEN              = ConvertDialogOptionType(12)
    constant dialogoption CHANGE_BLUE              = ConvertDialogOptionType(13)

    constant dialogevent EVENT_DIALOG_CHECKBOX_CLICK
    constant dialogevent EVENT_DIALOG_DROPLIST_ITEM_SELECTED
    constant dialogevent EVENT_DIALOG_RADIO_CLICK
    constant dialogevent EVENT_DIALOG_CHECKBOX_CLICK


    native DialogSetElement takes dialogelement dlgElement, dialogoption dlgOpt, boolean dlgParram returns boolean
    native DialogSetElementText takes dialogelement dlgElement, dialogoption dlgOpt, string dlgParram returns boolean
    native DialogSetElementInt takes dialogelement dlgElement, dialogoption dlgOpt, integer dlgParram returns boolean

    native DialogSetElementTextColor takes dialogelement dlgElement, integer r, integer g, integer b, integer a returns boolean

    native DialogAddPortrait takes integer x, integer y, integer width, integer height, string mdlPath returns portrait
    native DialogAddTextField takes integer x, integer y, integer width, integer height, string strText returns textfiled
    native DialogAddCheckBox takes integer x, integer y, integer width, integer height, string Caption, boolean wLogic returns checkbox

    native DialogAddRadio takes integer x, integer y, integer width, integer height, string Caption, boolean wLogic returns radio
    native DialogAddTextArea takes integer x, integer y, integer width, integer height, string strText returns textarea
    native DialogAddIcon takes integer x, integer y, integer width, integer height, string icoPath returns icon
    native DialogAddLabel takes integer x, integer y, integer width, integer height, string icoPath returns label
    native DialogAddDropList takes integer x, integer y, integer width, integer height, string icoPath returns droplist

    native DialogGetElementText takes dialogelement dlgElement, dialogoption dlgOpt returns string
    native DialogGetElementBoolean takes dialogelement dlgElement, dialogoption dlgOpt returns boolean
    native DialogGetElementInt takes dialogelement dlgElement, dialogoption dlgOpt returns integer

    native DialogDropListAddItem takes droplist wDropList, string strText returns integer
    native DialogDropListGetCountItem  takes droplist wDropList returns integer
    native DialogDropListGetItem  takes droplist wDropList, integer wIndex returns integer

    native GetClickedCheckBox takes nothing  returns checkbox
    native GetClickedRadio takes nothing  returns radio
    native GetCurrentDropList takes nothing  returns droplist
    native GetItemOfDropList takes nothing  returns string
    native GetIndexOfItemOfDropList takes nothing  returns integer

    native TriggerRegisterDialogCheckBoxEvent takes trigger whichTrigger, checkbox whichCheckBox returns event
    native TriggerRegisterDialogRadioEvent takes trigger whichTrigger, radio whichRadio returns event
    native TriggerRegisterDialogDropListEvent takes trigger whichTrigger, droplist whichDropList returns event

    native DialogDestroyElement takes dialogelement dlgElement returns boolean
     
     
  14. The_Silent

    The_Silent

    Joined:
    Feb 4, 2008
    Messages:
    2,902
    Resources:
    159
    Models:
    49
    Icons:
    89
    Packs:
    8
    Skins:
    12
    Maps:
    1
    Resources:
    159
    It would be mighty handy to be able to detect the scroll wheel, and which way it is being rolled.

    I mean, would work wonders for camera systems, not having to rely on commands for zooming in and out.

    Also, the ability to detect mouse x/y when not using a mouse event. For smart casting spells, ect.
     
  15. TriggerHappy

    TriggerHappy

    Code Moderator

    Joined:
    Jun 23, 2007
    Messages:
    3,685
    Resources:
    22
    Spells:
    11
    Tutorials:
    2
    JASS:
    9
    Resources:
    22
    @Volchachka Instead of spending time to expand the dialog system they should give us full control over UI elements as well as the ability to dynamically create new ones. It's already been proved feasible over in China (Netease).

    @The_Silent Yes we need async mouse natives which give coordinates relative to the screen not an in-game location. They need to be async in order for us to create a smooth working camera system, or for us to be able to handle user input for custom UIs smoothly.

    I have a feeling Blizzard will eventually follow Netease and give us these features.
     
  16. Volchachka

    Volchachka

    Joined:
    Sep 26, 2012
    Messages:
    16
    Resources:
    0
    Resources:
    0
    @TriggerHappy I know about it. Spoken to me a one man on that cause. I'm think that to the Blizzards not it. They'll make the similar natives a most likely. And scarcely they will give access to interface because of reason of the safety. So just not was being nothing.
     
  17. Death Adder

    Death Adder

    Joined:
    Nov 3, 2013
    Messages:
    886
    Resources:
    0
    Resources:
    0
    I had checked before with "Able to attack flying/ground units" before, and just checked again since you mentioned it, and it doesn't work. (The unit can neither target ground/air and IsUnitType doesn't change either.)

    I don't think the melee/ranged worked either, but can't remember if I tested it or not.


    That said, I might have completely written it off without testing it more in the past, if the other classifications like tauren, mechanical & undead work... My bad.
     
  18. apsyll

    apsyll

    Joined:
    Aug 28, 2015
    Messages:
    207
    Resources:
    1
    Maps:
    1
    Resources:
    1
    What about:
    ShareUnitWithPlayer takes unit, player returns nothing
     
  19. Raised

    Raised

    Joined:
    May 8, 2016
    Messages:
    56
    Resources:
    0
    Resources:
    0
    Following functions supposed to return corresponding coordinates of the intersection of the vector defined by input values and the terrain or widget.
    Code (vJASS):
    native WidgetToggleRaycast takes widget w, boolean flag returns nothing
    //This should make the widget collidable, so the coordinates of interception can be calculated. By default this should be sisabled.

    native GetRaycastClippingX takes real xFrom, real yFrom, real zFrom, real xTo, real yTo, real zTo returns real
    native GetRaycastClippingY takes real xFrom, real yFrom, real zFrom, real xTo, real yTo, real zTo returns real
    native GetRaycastClippingZ takes real xFrom, real yFrom, real zFrom, real xTo, real yTo, real zTo returns real
    Why do we need this? Because this should replace massive and slow systems and gives a lot more flexibility.
     
  20. Death Adder

    Death Adder

    Joined:
    Nov 3, 2013
    Messages:
    886
    Resources:
    0
    Resources:
    0
    There doesn't seem to be a way to change minimap color. i.e. even if you use the teamcolor of a player's units, they'll still have their original color on the minimap.



    Edit: Thought of another thing, so I'm adding it here to not double post.


    It would be nice to have an event that happens before a unit tries to pick up an item & another when you try to buy items from shops.

    Reason, you currently can't check the inventory of the unit before they buy/pick up item, so you have to do some workarounds to be able to upgrade/combine items if you have a full inventory. (e.g. having a dummy unit for every item you can buy.)


    Maybe a way to get/set item cost as well, like the ones added for units. (
    function GetItemGoldCost takes integer itemId returns integer
    )
     
    Last edited: Jul 22, 2018