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

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.
 
Level 9
Joined
Oct 17, 2007
Messages
547
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
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
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.
 
Level 8
Joined
Mar 12, 2008
Messages
437
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.
Top