• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Select a unit Event

Status
Not open for further replies.
Level 11
Joined
Jul 9, 2009
Messages
927
How can I trigger the actions only if a specific unit is selected.

I cant see any conditions which uses Selected Unit is equal to Value.

Thanks in advanced to anyone who will help :)
 
Level 11
Joined
Jul 9, 2009
Messages
927
I tried to do Triggering unit and it does not work :\

I think the problem is the unit I am trying to select has locust =.=
but that unit is a hero and I was thinking pressing F2 would trigger the select unit event.
Does it ?

here is a sample

  • Health Show Player One
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Heart[1] is selected by Player 1 (Red)) Equal to True
        • Then - Actions
          • Set Player[1] = (Player group(Player 1 (Red)))
          • Game - Display to Player[1] the text: (String((Life of (Triggering unit))))
          • Custom script: call DestroyForce(udg_Player[1])
        • Else - Actions
 
Try using 0.2 seconds.

edit

Your trigger should look like this:

  • Health Show Player One
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
    • Actions
      • Wait 0.20 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Heart[1] is selected by Player 1 (Red)) Equal to True
        • Then - Actions
          • Set Player[1] = (Player group(Player 1 (Red)))
          • Game - Display to Player[1] the text: (String((Life of (Triggering unit))))
          • Custom script: call DestroyForce(udg_Player[1])
        • Else - Actions
edit

You know what, if you want the unit selected, you could always use custom scripts and set a unit variable to GetSelectedUnit()
 
Level 11
Joined
Jul 9, 2009
Messages
927
I Tried 0.2 and 1 second and it still does not work. xD
Maybe I will come up with another solution on this. thanks for giving attention to the thread. +rep when able :)

EDIT:
Wait, I think the variable might not be set. I shall check.
 
Level 11
Joined
Jul 9, 2009
Messages
927
Thanks for the help. Credits shall be given ;)

EDIT:
The custom script does not work. xD
 
Level 11
Joined
Jul 9, 2009
Messages
927
I have the temp Unit variable, I tried the script with another variable and it is still invalid.

does get selected unit work ?
 
How does everyone ignore that the unit/hero was said to have locust. No, you cannot select locusts or trigger the event.

Yep, this is right.

Saif, what exactly do you want to happen with this trigger? Human players can not "select" units with the locust ability and therefor this trigger would never run.

I think we're missing something with what you're trying to do.
 
Level 11
Joined
Jul 9, 2009
Messages
927
I have the heroes health and mana with a different role.
I made the health as something like an energy and mana as hunger.

So I tried to make a separate unit (hero) which will be taking the role of health.
The only this is the unit should not be seeable and clickable.
And when I try to select the unit, it shows how many life points is remaining.

I thought of showing the lifepoints through multiboard but I think selecting the unit would be better.
 
Level 11
Joined
Jul 9, 2009
Messages
927
Anyway, I shall find of another solution to solve this problem. thanks for helping and giving me more information. +rep to everyone that helped :)
 
Status
Not open for further replies.
Top