• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Possible To Change Movement Type and Range Type?

Level 7
Joined
Nov 6, 2019
Messages
186
i have never done this before hence i dont know if it possible or how if it is

but is it possible

to when hero has a Ranged weapon Equipped in Equipment System they become range units with a missile depending on the item

and if they dont got range equipped got a melee, they become a melee class with no projectile

next if they have wings item for example, they are able to fly, but if they unequip the wings they cant fly anymore

if it possible any idea how
 
Level 24
Joined
Jun 26, 2020
Messages
1,853
If you are in the latest versions, you can change the values of the unit attack with this functions (all of them are also in GUI):
JASS:
native BlzGetUnitWeaponBooleanField                takes unit whichUnit, unitweaponbooleanfield whichField, integer index returns boolean
native BlzGetUnitWeaponIntegerField                takes unit whichUnit, unitweaponintegerfield whichField, integer index returns integer
native BlzGetUnitWeaponRealField                   takes unit whichUnit, unitweaponrealfield whichField, integer index returns real
native BlzGetUnitWeaponStringField                 takes unit whichUnit, unitweaponstringfield whichField, integer index returns string
native BlzSetUnitWeaponBooleanField                takes unit whichUnit, unitweaponbooleanfield whichField, integer index, boolean value returns boolean
native BlzSetUnitWeaponIntegerField                takes unit whichUnit, unitweaponintegerfield whichField, integer index, integer value returns boolean
native BlzSetUnitWeaponRealField                   takes unit whichUnit, unitweaponrealfield whichField, integer index, real value returns boolean
native BlzSetUnitWeaponStringField                 takes unit whichUnit, unitweaponstringfield whichField, integer index, string value returns boolean

constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_DAMAGE_NUMBER_OF_DICE     = ConvertUnitWeaponIntegerField('ua1d')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_DAMAGE_BASE               = ConvertUnitWeaponIntegerField('ua1b')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_DAMAGE_SIDES_PER_DIE      = ConvertUnitWeaponIntegerField('ua1s')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_MAXIMUM_NUMBER_OF_TARGETS = ConvertUnitWeaponIntegerField('utc1')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE               = ConvertUnitWeaponIntegerField('ua1t')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_WEAPON_SOUND              = ConvertUnitWeaponIntegerField('ucs1')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_AREA_OF_EFFECT_TARGETS    = ConvertUnitWeaponIntegerField('ua1p')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_TARGETS_ALLOWED           = ConvertUnitWeaponIntegerField('ua1g')

constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_BACKSWING_POINT              = ConvertUnitWeaponRealField('ubs1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_POINT                 = ConvertUnitWeaponRealField('udp1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN                = ConvertUnitWeaponRealField('ua1c')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_LOSS_FACTOR           = ConvertUnitWeaponRealField('udl1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_FACTOR_MEDIUM         = ConvertUnitWeaponRealField('uhd1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_FACTOR_SMALL          = ConvertUnitWeaponRealField('uqd1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_SPILL_DISTANCE        = ConvertUnitWeaponRealField('usd1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_SPILL_RADIUS          = ConvertUnitWeaponRealField('usr1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_PROJECTILE_SPEED             = ConvertUnitWeaponRealField('ua1z')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_PROJECTILE_ARC               = ConvertUnitWeaponRealField('uma1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_AREA_OF_EFFECT_FULL_DAMAGE   = ConvertUnitWeaponRealField('ua1f')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_AREA_OF_EFFECT_MEDIUM_DAMAGE = ConvertUnitWeaponRealField('ua1h')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_AREA_OF_EFFECT_SMALL_DAMAGE  = ConvertUnitWeaponRealField('ua1q')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_RANGE                        = ConvertUnitWeaponRealField('ua1r')

constant unitweaponbooleanfield UNIT_WEAPON_BF_ATTACK_SHOW_UI                   = ConvertUnitWeaponBooleanField('uwu1')
constant unitweaponbooleanfield UNIT_WEAPON_BF_ATTACKS_ENABLED                  = ConvertUnitWeaponBooleanField('uaen')
constant unitweaponbooleanfield UNIT_WEAPON_BF_ATTACK_PROJECTILE_HOMING_ENABLED = ConvertUnitWeaponBooleanField('umh1')

constant unitweaponstringfield UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART             = ConvertUnitWeaponStringField('ua1m')
And for movement there are these functions:
JASS:
native BlzGetUnitIntegerField                      takes unit whichUnit, unitintegerfield whichField returns integer
native BlzSetUnitIntegerField                      takes unit whichUnit, unitintegerfield whichField, integer value returns boolean

constant unitintegerfield UNIT_IF_MOVE_TYPE                             = ConvertUnitIntegerField('umvt')
If you wanna know what integer is for each move type, just go to the object editor in Units, look at Movement - Type, and see the order of those values starting from 0 (but maybe is messed up and they are not in order).
 
Last edited:
Level 7
Joined
Nov 6, 2019
Messages
186
Nice ty, i
If you are in the latest versions, you can change the values of the unit attack with this functions (all of them are also in GUI):
JASS:
native BlzGetUnitWeaponBooleanField                takes unit whichUnit, unitweaponbooleanfield whichField, integer index returns boolean
native BlzGetUnitWeaponIntegerField                takes unit whichUnit, unitweaponintegerfield whichField, integer index returns integer
native BlzGetUnitWeaponRealField                   takes unit whichUnit, unitweaponrealfield whichField, integer index returns real
native BlzGetUnitWeaponStringField                 takes unit whichUnit, unitweaponstringfield whichField, integer index returns string
native BlzSetUnitWeaponBooleanField                takes unit whichUnit, unitweaponbooleanfield whichField, integer index, boolean value returns boolean
native BlzSetUnitWeaponIntegerField                takes unit whichUnit, unitweaponintegerfield whichField, integer index, integer value returns boolean
native BlzSetUnitWeaponRealField                   takes unit whichUnit, unitweaponrealfield whichField, integer index, real value returns boolean
native BlzSetUnitWeaponStringField                 takes unit whichUnit, unitweaponstringfield whichField, integer index, string value returns boolean

constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_DAMAGE_NUMBER_OF_DICE     = ConvertUnitWeaponIntegerField('ua1d')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_DAMAGE_BASE               = ConvertUnitWeaponIntegerField('ua1b')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_DAMAGE_SIDES_PER_DIE      = ConvertUnitWeaponIntegerField('ua1s')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_MAXIMUM_NUMBER_OF_TARGETS = ConvertUnitWeaponIntegerField('utc1')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_ATTACK_TYPE               = ConvertUnitWeaponIntegerField('ua1t')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_WEAPON_SOUND              = ConvertUnitWeaponIntegerField('ucs1')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_AREA_OF_EFFECT_TARGETS    = ConvertUnitWeaponIntegerField('ua1p')
constant unitweaponintegerfield UNIT_WEAPON_IF_ATTACK_TARGETS_ALLOWED           = ConvertUnitWeaponIntegerField('ua1g')

constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_BACKSWING_POINT              = ConvertUnitWeaponRealField('ubs1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_POINT                 = ConvertUnitWeaponRealField('udp1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_BASE_COOLDOWN                = ConvertUnitWeaponRealField('ua1c')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_LOSS_FACTOR           = ConvertUnitWeaponRealField('udl1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_FACTOR_MEDIUM         = ConvertUnitWeaponRealField('uhd1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_FACTOR_SMALL          = ConvertUnitWeaponRealField('uqd1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_SPILL_DISTANCE        = ConvertUnitWeaponRealField('usd1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_DAMAGE_SPILL_RADIUS          = ConvertUnitWeaponRealField('usr1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_PROJECTILE_SPEED             = ConvertUnitWeaponRealField('ua1z')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_PROJECTILE_ARC               = ConvertUnitWeaponRealField('uma1')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_AREA_OF_EFFECT_FULL_DAMAGE   = ConvertUnitWeaponRealField('ua1f')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_AREA_OF_EFFECT_MEDIUM_DAMAGE = ConvertUnitWeaponRealField('ua1h')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_AREA_OF_EFFECT_SMALL_DAMAGE  = ConvertUnitWeaponRealField('ua1q')
constant unitweaponrealfield UNIT_WEAPON_RF_ATTACK_RANGE                        = ConvertUnitWeaponRealField('ua1r')

constant unitweaponbooleanfield UNIT_WEAPON_BF_ATTACK_SHOW_UI                   = ConvertUnitWeaponBooleanField('uwu1')
constant unitweaponbooleanfield UNIT_WEAPON_BF_ATTACKS_ENABLED                  = ConvertUnitWeaponBooleanField('uaen')
constant unitweaponbooleanfield UNIT_WEAPON_BF_ATTACK_PROJECTILE_HOMING_ENABLED = ConvertUnitWeaponBooleanField('umh1')

constant unitweaponstringfield UNIT_WEAPON_SF_ATTACK_PROJECTILE_ART             = ConvertUnitWeaponStringField('ua1m')
And for movement there are these functions:
JASS:
native BlzGetUnitIntegerField                      takes unit whichUnit, unitintegerfield whichField returns integer
native BlzSetUnitIntegerField                      takes unit whichUnit, unitintegerfield whichField, integer value returns boolean

constant unitintegerfield UNIT_IF_MOVE_TYPE                             = ConvertUnitIntegerField('umvt')
If you wanna know what integer is for each move type, just go to the object editor in Units, look at Movement - Type, and see the order of those values starting from 0 (but maybe is messed up and they are not in order).
will look into this tomorrow, however I do to say I actually looked in the GUI before post I did not find movement type or attack type in the setting, but I guess I need to look closer, I do wish there was a dark mode for editor

Now for jass I don’t know much of it so not sure what

so there isnt a weapon type options to change to missle

however this works but the damage for second attack doesnt show on UI but it set to show

  • WeaponType
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to [clickable item]
          • (Triggering unit) Equal to SurvUnitArray[(Player number of (Owner of (Triggering unit)))]
        • Then - Actions
          • Wait 1.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Ranged Weapon [Buff] for (Triggering unit)) Equal to 1
              • (Level of Melee Weapon [Buff] for (Triggering unit)) Equal to 0
            • Then - Actions
              • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:0 to Value: False
              • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:1 to Value: True
              • Unit - Set Unit: (Triggering unit)'s Weapon String Field: Attack Projectile Art ('ua1m')at Index:1 to Value: war3mapImported\Bloodstone Arrow.mdl
              • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attack Show UI ('uwu1')at Index:0 to Value: False
              • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attack Show UI ('uwu1')at Index:1 to Value: True
              • Game - Display to (All players) for 30.00 seconds the text: Weapon: Ranged
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Ranged Weapon [Buff] for (Triggering unit)) Equal to 0
                  • (Level of Melee Weapon [Buff] for (Triggering unit)) Equal to 1
                • Then - Actions
                  • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:1 to Value: False
                  • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attacks Enabled ('uaen')at Index:0 to Value: True
                  • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attack Show UI ('uwu1')at Index:1 to Value: False
                  • Unit - Set Unit: (Triggering unit)'s Weapon Boolean Field: Attack Show UI ('uwu1')at Index:0 to Value: True
                  • Game - Display to (All players) for 30.00 seconds the text: Weapon: Melee
                • Else - Actions
        • Else - Actions
 
Last edited:
Level 24
Joined
Jun 26, 2020
Messages
1,853
You're welcome.
will look into this tomorrow, however I do to say I actually looked in the GUI before post I did not find movement type or attack type in the setting, but I guess I need to look closer, I do wish there was a dark mode for editor
It seems that the unitintegerfield in GUI is "Type" because it has the same 4 char code and Blizzard didn't write it as "Move Type":
1690739749153.png


1690739835007.png


so there isnt a weapon type options to change to missle
Yeah, that is a shame.
however this works but the damage for second attack doesnt show on UI but it set to show
I think this is an issue of doing this with heros, because they aren't suppose to show the UI of their second attack, because I think is the attack when they get an orb (and the option you are setting is to show the button in the Command Window not in the unit stats).

After testing I found that the best solution to still showing the UI is not disabling the Attack 1, instead just set the targets allowed to "Dead" after you saved the previous targets allowed to set them again (you will need a unit indexer), because dead units can't be targeted and it will force the unit to use the Attack 2 instead, is an integer field and the value is: 33554432.
This is what I did (Remember that the hero should start with only the Attack 1 enabled):
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet TempInt = (Unit: Cazador de Demonios 0003<gen>'s Weapon Integer Field: Targets Allowed ('ua1g') at Index:0)
      • Game - Display to (All players) the text: (String(TempInt))
  • Test
    • Events
      • Player - Player 1 (Red) types a chat message containing test as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit: Cazador de Demonios 0003<gen>'s Weapon Boolean Field: Attacks Enabled ('uaen') at Index:1) Equal to True
        • Then - Actions
          • Unit - Set Unit: Cazador de Demonios 0003<gen>'s Weapon Integer Field: Targets Allowed ('ua1g') at Index:0 to Value: TempInt
          • Set VariableSet TempBool = False
        • Else - Actions
          • Unit - Set Unit: Cazador de Demonios 0003<gen>'s Weapon Integer Field: Targets Allowed ('ua1g') at Index:0 to Value: 33554432
          • Set VariableSet TempBool = True
      • Unit - Set Unit: Cazador de Demonios 0003<gen>'s Weapon Boolean Field: Attacks Enabled ('uaen') at Index:1 to Value: TempBool
Edit: These are the values of the move types:
None = 0
Foot = 1
Horse = 4
Fly = 2
Hover = 8
Float = 16
Amphibious = 32
i don't know why are powers of 2 and therefore having 0 as valid value, because the powers of 2 are used when you can set multiple values, but in this case you can only set 1 value, but oh well, things of Blizzard.
 
Last edited:
Level 24
Joined
Jun 26, 2020
Messages
1,853
You can fairly easily do all this with either of these options:
A.) Use a morph ability (Bear form, crow form) to make your unit into another unit
B.) Use ReplaceUnitBJ to replace your unit
That could be, but becomes more complex if you have to consider that he would need a unit for each missile and each hero-type because he is doing a weapon system, and that is unpractical.
 
Top