• 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.

Question about Upgrade Buildings

Status
Not open for further replies.
ok, for some unknown reason no1 bothered 2 look at my last post =\
anyway
I have 3 buildings, lets call them
BUILDING A
BUILDING B
BUILDING C
so BUILDING A can upgrade 2 either BUILDING B or BUILDING C
but only one of them (building b or building c) can be upgraded at a time
so wat that means is, once i click on the "upgrade into building b" button, the "upgrade 2 building c" button will disappar untill my "building b is destroyed

(plz note that there can be multiple BUILDING A on the map at a time, so once u click on the "upgrade 2 building b" button, ALL the "upgrade 2 building c" button from ALL the BUILDING A's control panel will disappear)

i tried 2 make a trigger but can't find the correct... condition and action
need help on it

the ideal ... "vision" of this trigger is something like this (if its possible)

event (i wonder if this is nesecary)
-a unit begin upgrade

condition
-upgrade building = building b

action
-disable avaibility of building c

(or something like that)

thx 4 all ... info
 
Level 6
Joined
Apr 20, 2007
Messages
232
Upgrading units doesn't require triggering. You can do this from Object Editor
in the bottom (Techtree - Upgrades to). When you upgrade to building C the B one will be gone , because this building will be another one , which you must create in object editor.
 
Level 5
Joined
Jul 11, 2007
Messages
152
You could make another building and when that one starts upgrading remove all other buildings of that type and immediately replace them with the same building that only has that option.

So it'll be like:
Building A starts upgrading to building B
Replace all other building As besides the one upgrading with building D, which only has the option to upgrade to B
and likewise for building C
 
Level 5
Joined
Jul 11, 2007
Messages
152
Good catch, here's how to do it without leaking

  • Set Unit_Switch_A = Units of Type (Building A) not equal to upgrading unit
  • Pick every unit in (Units in Group (Unit_Switch_A) and do Kill picked unit
Then you replace them with the D type of building.
Hope that works, if there's anything else I'll check back soon.
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
[trigger="That leaks This doesnt"]
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units of Type (Building A) not equal to upgrading unit) and do Kill picked unit[/trigger]
 
Status
Not open for further replies.
Top