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

Double Click hero selection

Status
Not open for further replies.
Level 9
Joined
Mar 31, 2011
Messages
496
When a player double clicks a unit :grin:

It will spawn the selected unit as a hero :smile:

>Things I know is, I must have a unit and a hero with the same name :xxd:

After the following unit is chosen, the one who is selected will be removed
from the selection.
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
So you want the hero choices to be standing in an area? Not at a tavern?

EDIT: Here you go!
EDIT 2: Fixed errors.

  • Choose Hero
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
    • Conditions
      • Hero[(Player number of (Triggering player))] Equal to No unit
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Paladin 0000 <gen>
          • (Triggering unit) Equal to Blood Mage 0003 <gen>
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Hero_Selected[(Player number of (Triggering player))] Equal to True
        • Then - Actions
          • Set Temp_Point = [your point]
          • Unit - Create 1 (Unit-type of (Triggering unit)) for (Triggering player) at Temp_Point facing Default building facing degrees
          • Set Hero[(Player number of (Triggering player))] = (Last created unit)
          • Unit - Remove (Triggering unit) from the game
          • Custom script: call RemoveLocation(udg_Temp_Point)
        • Else - Actions
          • Set Hero_Selected[(Player number of (Triggering player))] = True
  • Deselct Hero
    • Events
      • Player - Player 1 (Red) Deselects a unit
      • Player - Player 2 (Blue) Deselects a unit
      • Player - Player 3 (Teal) Deselects a unit
      • Player - Player 4 (Purple) Deselects a unit
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Triggering unit) Equal to Paladin 0000 <gen>
          • (Triggering unit) Equal to Blood Mage 0003 <gen>
    • Actions
      • Set Hero_Selected[(Player number of (Triggering player))] = False
For this you will need a boolean array and a unit array. The array size must be equal to the number of players. You will need to add all the players in each of the triggers' events. Note that "Paladin 0000 <gen>" is a specific unit that has already been placed on the map, and NOT a unit-type.
 
Last edited:
Level 9
Joined
Mar 31, 2011
Messages
496
I mean, the system is, (lol it's hard explaining haha)

---> The system you made is
A hero (owned by neutral) then double click it > it will spawn the hero selected

And I want is

---> The system I don't know how to do
A unit (owned by neutral) then double click it > it will spawn the unit selected but as a hero.

*things i know is I have to make one unit and the hero for each hero, the same name, the same
model.

i'll repeat it again for better understanding,
---> A unit is spawned on a particular time, which is the one you'll pick, a "UNIT",
-->After you click the unit > click the *UNIT* again.
->then the *HERO* will be spawned...

hehe... that's all
 
Level 17
Joined
Feb 11, 2011
Messages
1,860
Oh okay. I'm sorry, I misunderstood what you were saying :eekani:

Here is the demo map. It allows the players to have only 1 hero each. The unit that is double clicked will be removed. You must obviously make your own heroes for each of the units - I have used the default heroes and units.
 

Attachments

  • Double Click Pick v2.w3x
    19.6 KB · Views: 149
Status
Not open for further replies.
Top