• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

Tower Upgrade with Selection

Status
Not open for further replies.
Level 1
Joined
May 10, 2015
Messages
5
I am trying to make it so that you buy a blank unit from a shop and then you can click on a tower to upgrade it. Im having trouble getting WE to detect when and what type of unit is selected. Is it possible or do you need to code it in JASS?
 

Ardenian

A

Ardenian

You can make it with triggers.
Create a trigger that detects if a unit buys the blank unit.
Then you write another trigger that is only activated after you bough the blank unit.
Then , if a certain unit is selected, it will be upgraded and the upgrade trigger is deactivated.
 
Level 1
Joined
May 10, 2015
Messages
5
This is the trigger right now

Events
Unit - A unit Sells a unit
Conditions
(Unit-type of (Sold unit)) Equal to Tower Upgrade
Actions
Unit - Remove (Sold unit) from the game
Game - Display to (All players matching (((Buying unit) is in (Units owned by (Matching player))) Equal to True)) the text: Please click a basi...
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Basic Tower 0031 <gen> is selected by (Owner of (Buying unit))) Equal to True
(Basic Tower 0026 <gen> is selected by (Owner of (Buying unit))) Equal to True
(Basic Tower 0042 <gen> is selected by (Owner of (Buying unit))) Equal to True
(Basic Tower 0043 <gen> is selected by (Owner of (Buying unit))) Equal to True
(Basic Tower 0038 <gen> is selected by (Owner of (Buying unit))) Equal to True
(Basic Tower 0037 <gen> is selected by (Owner of (Buying unit))) Equal to True
Then - Actions
Else - Actions
Do nothing


I'm not sure where to go from here
 

Ardenian

A

Ardenian

Note: There is a trigger display ( like Quote) if you Go Advanced / Add Reply. You can use the option 'Copy as text' in the WE to copy it here and make it look like triggers.

I am not sure about the Display function.
Next steps depend on your choice. You can either order the tower via trigger to upgrade it, but then you have to prevent manual upgrade by players.

Or, other opportunity, you can remove the tower and create the upgrade one. This one is more difficult if you use more than one upgrade, I think it is done with hashtables or index, but I am bad with triggers, so I don't know.

Note: I don't pay attention to leaks, so may check the corresponding thread after you chose a way.
 
Level 1
Joined
May 10, 2015
Messages
5
I tried this and it does nothing I dont know how to make it wait for you to select something and then check if its the right unit type.
 

Ardenian

A

Ardenian

  • Game - Display to (All players matching (((Buying unit) is in (Units owned by (Matching player))) Equal to True)) the text: Please click a basi...
I am no expert, but it seems strange to me.

Please post the action you added.

You could try this tho:
Create a trigger that detects if a unit buys the blank unit.
Then you write another trigger that is only activated after you bough the blank unit.
Then , if a certain unit is selected, it will be upgraded and the upgrade trigger is deactivated.
So you have to make two different triggers.
 
Status
Not open for further replies.
Top