• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Set unit weapon natives issue

Status
Not open for further replies.
I played around trying to make a equipment system, using the new natives instead of custom units to change attack and armor of the unit. But it does not seem to work.

This is the trigger I tested with. Tested it on a rifleman. Nothing happened. Tried with different attack index. Hide and Unhide is only used because I remember some issues in the far past, where that method would work. It does not.

  • TestEquip
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Equip Handgun
    • Actions
      • Custom script: call DisplayTextToPlayer(Player(0), 0, 0, "Equip Handgun registered")
      • Unit - Set Unit: (Triggering unit)'s Weapon Integer Field: Attack Attack Type ('ua1t')at Index:0 to Value: 1
      • Unit - Set Unit: (Triggering unit)'s Weapon Integer Field: Attack Damage Base ('ua1b')at Index:0 to Value: 3
      • Unit - Set Unit: (Triggering unit)'s Weapon Integer Field: Attack Damage Sides Per Die ('ua1s')at Index:0 to Value: 17
      • Unit - Set Unit: (Triggering unit)'s Weapon Integer Field: Attack Damage Number Of Dice ('ua1d')at Index:0 to Value: 1
      • Unit - Set Unit: (Triggering unit)'s Weapon Real Field: Attack Range ('ua1m')at Index:0 to Value: 500.00
      • Unit - Set Unit: (Triggering unit)'s Weapon Real Field: Attack Base Cooldown ('ua1c')at Index:0 to Value: 0.33
      • Unit - Hide (Triggering unit)
      • Unit - Unhide (Triggering unit)
Am I doing something wrong, or do these just not work yet?
 
weapon fields do not work, yet.

That is too bad. Will wait till they are fixed to create my equipment system I guess. No reason to use the old clunky method, when a new method is so close. Especially because armor will work independently of attack too, which replacing units does not really support.

Do you know if changing armor types work?

Edit:
It does not seem to
 
Last edited:
if you want to change large armor to hero armor that is not armor type, that is defense type. Armor type is used for combat sounds, metal slash on stone sounds different than wood slash on flesh.
JASS:
    // defense type
    constant defensetype    DEFENSE_TYPE_LIGHT              = ConvertDefenseType(0)
    constant defensetype    DEFENSE_TYPE_MEDIUM             = ConvertDefenseType(1)
    constant defensetype    DEFENSE_TYPE_LARGE              = ConvertDefenseType(2)
    constant defensetype    DEFENSE_TYPE_FORT               = ConvertDefenseType(3)
    constant defensetype    DEFENSE_TYPE_NORMAL             = ConvertDefenseType(4)
    constant defensetype    DEFENSE_TYPE_HERO               = ConvertDefenseType(5)
    constant defensetype    DEFENSE_TYPE_DIVINE             = ConvertDefenseType(6)
    constant defensetype    DEFENSE_TYPE_NONE               = ConvertDefenseType(7)

 // Armor Type
    constant armortype      ARMOR_TYPE_WHOKNOWS             = ConvertArmorType(0)
    constant armortype      ARMOR_TYPE_FLESH                = ConvertArmorType(1)
    constant armortype      ARMOR_TYPE_METAL                = ConvertArmorType(2)
    constant armortype      ARMOR_TYPE_WOOD                 = ConvertArmorType(3)
    constant armortype      ARMOR_TYPE_ETHREAL              = ConvertArmorType(4)
    constant armortype      ARMOR_TYPE_STONE                = ConvertArmorType(5)
 
Status
Not open for further replies.
Top