• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

Two Questions {making a unit un-selectable / detecting which type a unit upgrades to}

Status
Not open for further replies.
Level 9
Joined
Aug 1, 2008
Messages
453
I have 2 questions.

1. How do i make it so a player cannot select a unit?
2. How do i check if a unit finish's "Upgrade To", and how would i make a condition that checks what the unit "Upgrades To"

EXAMPLE) Unit A - Can Upgrade To: Unit B, Unit C, Unit D

If Unit A, upgrades to Unit B: Give triggering Player 150 gold
If Unit A, Upgrades to Unit C: Give triggering Player 200 gold
And so on.

Sidenote: I am not trying to do that action. It's just the condition part. Will +REP if helped.
 
Give the unit the "Locust" ability if you dont want players to select it.

There is no triggers like what you wrote. There is how ever something like this:

Events:
When a unit finish upgrading
Condition:
Finished Upgrade = Unit A
Action:
Give owner of triggering unit 100 gold
 
The Locust ability will make it unusable by everyone and can only be effected by triggers. If you want a unit not to be selected by specific players (which is what I think you want), make a trigger
  • Deselection
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Triggering unit) Equal to YourUnit
    • Actions
      • Selection - Clear selection for (Triggering player)
Add other players to the events or other units to the conditions to prevent those from being selected.
 
Give the unit the "Locust" ability if you dont want players to select it.

There is no triggers like what you wrote. There is how ever something like this:

Events:
When a unit finish upgrading
Condition:
Finished Upgrade = Unit A
Action:
Give owner of triggering unit 100 gold

I'm pretty sure that "upgrade" refers to research; use this instead:
  • Strawberry cheesecake
    • Events
      • Unit - A unit finishes construction
    • Conditions
      • (Constructed structure) equal to Unit B/C/D
    • Actions
      • Player - Add X gold to (Owner of (Constructed structure))
Alternatively, you can use an If/Then/Else system, or use custom values.

The Locust ability will make it unusable by everyone and can only be effected by triggers. If you want a unit not to be selected by specific players (which is what I think you want), make a trigger
  • Deselection
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Triggering unit) Equal to YourUnit
    • Actions
      • Selection - Clear selection for (Triggering player)
Add other players to the events or other units to the conditions to prevent those from being selected.

The only downside is that Clear selection causes delay, I think there's som jass action that has the same effect without the delay (I don't know it, however).
 
Status
Not open for further replies.
Back
Top