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

[JASS] is CreateUnitByName bugged?

Status
Not open for further replies.
Level 37
Joined
Mar 6, 2006
Messages
9,240

  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set uht = (Last created hashtable)
      • -------- -------------------------------------------- --------
      • Set str = paladin
      • Set ut = Paladin
      • Custom script: call SaveInteger(udg_uht, StringHash(udg_str), 0, udg_ut)
      • -------- -------------------------------------------- --------
      • Set str = footman
      • Set ut = Footman
      • Custom script: call SaveInteger(udg_uht, StringHash(udg_str), 0, udg_ut)
      • -------- -------------------------------------------- --------
      • Set str = grunt
      • Set ut = Grunt
      • Custom script: call SaveInteger(udg_uht, StringHash(udg_str), 0, udg_ut)
  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing create as A substring
    • Conditions
    • Actions
      • Set str = (Substring((Entered chat string), 8, (Length of (Entered chat string))))
      • Custom script: if HaveSavedInteger(udg_uht, StringHash(udg_str), 0) then
      • Custom script: set udg_ut = LoadInteger(udg_uht, StringHash(udg_str), 0)
      • Unit - Create 1 ut for (Triggering player) at (Center of (Playable map area)) facing Default building facing degrees
      • Custom script: endif


create paladin
create grunt
create footman
etc.
 

Attachments

  • UnitCreateStringHash.w3x
    12.7 KB · Views: 53
Level 26
Joined
Aug 18, 2009
Messages
4,097
I have the german version and it reacts only on english names. Those are not necessarily the ones you see in object editor though. For example, Hall of the Dead is "necropolis1", Black Citadel "necropolis2".

The name of custom units is "custom_" + rawId, e.g. "custom_h000".
 
Status
Not open for further replies.
Top