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!
Hey guys, my first post and also my first map build attempt.
So I'm creating a TD and I want to downgrade groups of towers together and then keep the selection on the group. I can only achieve selecting the last replaced unit which is one. Here's my code:
I don't think triggers are required in this case, or I misunderstood your problem.
In classic Warcraft III, selecting multiple Ziggurats (for example) and clicking the "Upgrade to Spirit Tower" button will upgrade them while keeping the group selected. To do so, you need to add the downgraded unit to your original tower's "Techtree - Upgrades to" value in the Object Editor
Or did I misunderstand ?
PS : Next time, copy your trigger using "Copy as text" and copy that text between [trigger ][ /trigger] banners
1. don't use do nothing actions they are just there to look ugly leave it blanc.
2. use [ trigger ] [ / trigger ] tags to post the triggers
3. you use some weird way of triggering tell me what you need and I can see if I can create something for you
And the actions that I want to do are:
-downgrade the group of towers.
-return the money of the last upgrade(sum).
-select the selection the triggering player had.
Hey thanks for trying to help me, but I think you didn't understand what I need.
The main thing I want to do is to group downgrade the towers and after that, maintain the selection of the group selected.
To make myself clear, let's say I have three Air towers LVL3 and I want to downgrade them. I select them all and click the downgrade button, the action does happen, but then it just selects the one of the three towers.
I hope I made myself clear,
thanks again guys for the replies!
Custom script: set bj_lastCreatedUnit = CreateUnit(GetTriggerPlayer(), udg_TempInt, GetUnitX(GetEnumUnit()), GetUnitY(GetEnumUnit()), 270.)
Selection - Add (Last created unit) to selection for (Triggering player)
Custom script: endif
Else - Actions
The reason I choose this method, is so it doesn't have to loop through all the possible building types it could be.
It just picks the building and changes it (if possible), no loops.
The setup goes as following: call SaveInteger(udg_Hashtable, 'hcas', 0, 'hkee') saves the downgraded building. call SaveInteger(udg_Hashtable, 'hcas', 1, 800) saves the gold cost.
All those things between apostrophes you see are Raw Id's. Go to the object editor and press CTRL + D, all object names will now be 4-character 'strings' (they're actually integers, but that aside).
In the code, the first part is the building that gets downgraded. In the examples above, this is the Human Castle ('hcas').
The second part is the value that gets saved. The building that gets saved is the Human Keep ('hkee'), the gold cost is 800 (random value ).
I've attached a demo-map for easier copying.
(The comments are to make it easier, you don't have to write it out for each building ^^).
Edit: oops, the spell should have "Unique Cast" enabled (fixed).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.