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

Unit Classifications

Status
Not open for further replies.
Level 14
Joined
Mar 30, 2009
Messages
971
i wanted to request some information/help with unit classifications.

please tell me as much as you know or direct me to some tutorials (if there are any that i didnt find).
are there any special limitaions to unit classifications? e.g it seems that a unit classified as a "tauren" doesnt make ANY other difference than the little word "tauren" under unit name, and that ancestral spirit can only be cast on Tauren corpses.

it seems that "mechanical" is the most resourceful when it comes to error messages (must target organic unit, must target non-mechanical unit, unable to target mechanical unit and so on).

!!
are there any way to launch error messages with script (jass?)?? i can use GUI so it wont be that hard to start a row of jass there.


i want to use classifications in my project:
"Humanoid" - most important. several abilities need humanoid as a target
"Beast" - just some abilities that need beast classification
"Elemental" - just a class that isnt beast nor humanoid
"Undead" - very few of them in game. actually same as humanoid except tooltip/name

2 first classifications are most important. can someone help me and/or tell more about classifications and their connecction to abilities.


thank you very much
 
Level 4
Joined
Jan 9, 2010
Messages
89
I don't think you can launch the error messages per se, but you can just display the same.

As for making your own classifications, as you stated the only thing you need to change is the little text under the name and the error messages.

Both of these can be changed in the Game interface menu. The little texts are at the very bottom ( At least I believe that's them) and there are (fitting enough) four of them.
 
Didn't try it, but I guess this would be a proper solution:
  • Trig
  • Events
    • Unit - A unit begins casting an ability //so that it doesn't count after the mana has been spent
  • Conditions
    • (Ability being cast) Equal to X
  • Actions
    • If (All conditions are true) then do (Actions) else do
      • If - Conditions
        • (Load Key(humanoid) of Key(Target unit of ability being cast) in Hashtable) Equal to False
      • Then - Actions
        • Game - Display to (Player Group(Owner of (Triggering unit))) the message: "You must target a humanoid."
        • Unit - Order (Casting unit) to Stop // I didn't use Triggering unit, because the "Casting" one is slower and helps us here to prevent further castings.
        • Custom script: if GetLocalPlayer() == (Owner of (Triggering unit)) then
        • Sound - Play Error <gen>
        • Custom script: endif
You can also make a list of what unit-types are humanoid, e.g.
  • Trig1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hastable)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units of type Shaman) and do (Actions)
      • Loop - Actions
        • Hashtable - Save True as Key(humanoid) of (Key(Picked unit)) in Hashtable
 
Status
Not open for further replies.
Top