1. Find your way through the deepest dungeon in the 18th Mini Mapping Contest Poll.
    Dismiss Notice
  2. A brave new world lies beyond the seven seas. Join the 34th Modeling Contest today!
    Dismiss Notice
  3. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
Hive 3 Remoosed BETA - NOW LIVE. Go check it out at BETA Hive Workshop! Post your feedback in this new forum BETA Feedback.
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Are these APIs can't work in 1.31?

Discussion in 'World Editor Help Zone' started by JsonDalao, Oct 11, 2019.

  1. JsonDalao

    JsonDalao

    Joined:
    Aug 6, 2019
    Messages:
    75
    Resources:
    0
    Resources:
    0
    I have tested the following code without any effect, is it a bug?

    code:
    BlzSetUnitWeaponRealFieldBJ( GetTriggerUnit(), UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN, 1, 300 )
    BlzSetUnitAttackCooldown( gg_unit_Hamg_0003, 0.50, 1 )
    BlzSetUnitWeaponRealFieldBJ( GetTriggerUnit(), UNIT_WEAPON_RF_ATTACK_RANGE, 1, 10000.00 )
     

    Attached Files:

  2. Nudl9

    Nudl9

    Joined:
    Nov 9, 2006
    Messages:
    2,370
    Resources:
    31
    Icons:
    11
    Skins:
    1
    Maps:
    18
    Tutorials:
    1
    Resources:
    31
    A bunch of these don't work as far as i know.
     
  3. Ricola3D

    Ricola3D

    Joined:
    Feb 27, 2019
    Messages:
    291
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    Carefull, most Blz functions are 0 indexed since 1.31. BlzSetUnitAttackCooldown is in this case for sure:
    BlzSetUnitAttackCooldown( ..., ..., 0 ): change attack speed of weapon 1
    BlzSetUnitAttackCooldown( ..., ..., 1 ): change attack speed of weapon 2

    About the BlzSetUnitWeaponXxxxField I think it's the lotery to know if they work or not.. All weapon integer fields that I tried did not work...
     
    Last edited: Oct 11, 2019
  4. JsonDalao

    JsonDalao

    Joined:
    Aug 6, 2019
    Messages:
    75
    Resources:
    0
    Resources:
    0
    1 or 0, he still doesn't work
     
  5. GetLocalPlayer

    GetLocalPlayer

    Joined:
    Apr 11, 2018
    Messages:
    20
    Resources:
    0
    Resources:
    0
  6. Ricola3D

    Ricola3D

    Joined:
    Feb 27, 2019
    Messages:
    291
    Resources:
    3
    Maps:
    1
    Spells:
    1
    Tutorials:
    1
    Resources:
    3
    I'm puzzled. With 1.31 I use BlzSetUnitAttackCooldown in 4-5 functions and they all work. Knowing that in 1.30 or lower, the function is 1-indexed, but in 1.31 and newer, it is 0-indexed

    For example, the code below increases attack by 15 x LocalTempInteger & attack speed by 2% x LocalTempInteger, and is compatible with both 1.30- and 1.31+.
    Code (vJASS):

    set udg_LocalTempIndex = 0
        loop
            exitwhen udg_LocalTempIndex > 2
            call BlzSetUnitBaseDamage( GetSummonedUnit(), ( BlzGetUnitBaseDamage(GetSummonedUnit(), udg_LocalTempIndex) + ( 15 * udg_LocalTempInteger ) ), udg_LocalTempIndex )
            call BlzSetUnitAttackCooldown( GetSummonedUnit(), ( BlzGetUnitAttackCooldown(GetSummonedUnit(), udg_LocalTempIndex) / ( 1 + ( I2R(udg_LocalTempInteger) * 0.02 ) ) ), udg_LocalTempIndex )
            set udg_LocalTempIndex = udg_LocalTempIndex + 1
        endloop