• 🏆 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!

Bugged Miscellaneous item category

Status
Not open for further replies.
I don't know if this is known to all of you; it's a weird bug with the Map editor that has recently cost me many many hours of hair-splitting and looking for a bug in my code that didn't even exist to begin with.

So, I wanted to bring this to your attention just to spread awareness of it, especially when going bug-hunting in the TriggerHelp section.



The item category "Miscellaneous" in the object editor does not return true for:
GetItemType(item) == ITEM_TYPE_MISCELLANEOUS

Instead, the OE category must be checked against this:
GetItemType(item) == ITEM_TYPE_UNKNOWN


ITEM_TYPE_MISCELLANEOUS seems to have no corresponding category in the object editor, so it's pretty much a dead constant.
 
Yeah they probably changed it somewhere in the production process of WC3.
It's by far not the only "useless" constant that exists in the game.

For example, there is also ITEM_TYPE_ANY which does nothing. Or the whole weapontype class that literally only has WEAPON_TYPE_WHOKNOWS as available constants.

Also, there is ITEM_TYPE_TOME, which seems to have been replaced by ITEM_TYPE_POWERUP when TFT was released or many many unused armor types.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
For attacks as set in the OE, yes, but not for the Damage function in Jass.

Damage function generates sound, at least some of them.First two combination here will not generate sound, whereas other four will do.

JASS:
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_CLAW_HEAVY_SLICE)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_METAL_LIGHT_CHOP)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_ROCK_HEAVY_BASH)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WOOD_HEAVY_BASH)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WOOD_LIGHT_BASH)
 
Damage function generates sound, at least some of them.First two combination here will not generate sound, whereas other four will do.

JASS:
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_CLAW_HEAVY_SLICE)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_METAL_LIGHT_CHOP)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_ROCK_HEAVY_BASH)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WOOD_HEAVY_BASH)
    
    call UnitDamageTarget(u, u, 10.0, true, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_WOOD_LIGHT_BASH)
Interesting... never knew that. Cool; that means I can actually use that to change sounds depending on the equipped weapon. Why the first two don't work is beyond me, though. Probably because they don't have the armor part in them (Metal, Rock, Wood, Flesh, Etheral).
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
I also found that this problem would be very annoying when you wanna do equipment systems where you wanna have certain number of items from an itemtype, since ITEM_TYPE_UNKNOWN is the same itemtype of null items, so it will count any empty item slot of the inventory like you have a miscellaneous item.
 
Status
Not open for further replies.
Top