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

Hero Buttons

Status
Not open for further replies.
Nah, just make the same unit-type for the player's allies and hide the unit:
  • Trigger0
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hash = (Last created hashtable)
    • For each (IntegerA) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Player((Integer A))) controller) Equal to User
            • ((Player((Integer A))) slot status) Equal to Is playing
          • Then - Actions
            • Hashtable - Save 0 as (Key numberofheroes) of (Key (Player((Integer A)))) in Hash
          • Else - Actions
  • Trigger
  • Events
    • Unit - A unit finishes training a unit
  • Conditions
    • ((Trained unit) is a Hero) Equal to True
  • Actions
    • For each (IntegerA) from 1 to 12, do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Player(IntegerA) is an ally of (Owner of (Triggering unit)) Equal to True
            • (Player(IntegerA)) Not Equal to (Owner of (Triggering unit))
          • Then - Actions
            • Set LoadInteger = (Load Key(numberofheroes) of (Key(Player(IntegerA))) from Hash
            • Hashtable - Save (LoadInteger + 1) as (Key numberofheroes) of (Key (Player((Integer A)))) in Hash
            • Custom script: set udg_Hero = CreateUnit (Player(GetForLoopIndexA()), GetUnitTypeId(GetTrainedUnit()), 0, 0, 0)
            • Unit - Hide Hero
            • Hashtable - Save Handle of Hero as (Key(heroes + (String(LoadInteger)))) of (Key(Player(IntegerA))) in Hash
 
Serbianbeast said:
Can I make heroes' buttons on the top left corner of the screen visible to other players?
Serbianbeast said:
I actually need them to represent the unit itself and redirect spells to them. I know how to do that what u suggested...

And I know that you must be more comprehensive, when phrasing out your issue.

Anyway, it's possible, I think Gaia's Retaliation does have a feature like this, but I feel very sleepy now to post such a code; it of course involves hashtables, which save the sold hero to the dummy hero (that is visible to your allies); you will then need a small "system", which will create a dummy unit and order it to embrace the order of your hero to the saved hero of the target unit of ability being cast. I had made some "Spell reflect" spell, which will show you the way to do the latter part I am telling you about. Notice though, it will only work for instant spells, e.g. Frost Nova/Chain Lightning/Slow/etc.

The map's here: http://www.hiveworkshop.com/forums/world-editor-help-zone-98/spell-reflection-169644/#post1611264
 
Status
Not open for further replies.
Top