• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Are these APIs can't work in 1.31?

Status
Not open for further replies.
Level 3
Joined
Aug 6, 2019
Messages
74
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 )
 

Attachments

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 )

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:
1 or 0, he still doesn't work
Carefull, most Blz functions are 0 indexed. 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...
 
1 or 0, he still doesn't work

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+.
JASS:
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
 
Status
Not open for further replies.
Back
Top