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

[Trigger] How to make only 1 building ina region upgradeat a time.

Status
Not open for further replies.
Level 4
Joined
Jul 19, 2009
Messages
100
Ok I'm making a map where each base has 8 build slots and each slot can upgrade into a building (like Halo Wars if anybody has played that) I want to make it so that if you start to upgrade some build pads into buildings, the first one you start must complete the upgrade before the next building slot starts to upgrade. Also each base has a region around it that all the build slots are inside. + rep to anybody who gets the triggger to work. :grin:
Also plz write something to bump the thread!
 
Level 10
Joined
Nov 28, 2008
Messages
655
Have you tried anything yet? If so post it?

People aren't going to do your project for you, but if you post things they will help, you would get more help if you showed and effort and just asked for a little push, instead of a putting up a clean slate...

Even if you have tried and failed, what did you try? Other people can help you to be more independent by helping you understand how to do it, so if you tell us your thoughts, then help can be given...

Otherwise, this is just a request to have something done, which is ehh, YOU are making the map, it is not a group effort from everyone online that feels like contributing something when they were bored...


Not trying to be mean, just trying to help you get better responses + more out of the community in the long run.
 
Level 4
Joined
Jul 19, 2009
Messages
100
I am trying to figure it out but so far I can't seem to figure it out. I thought it might be somethinbg like:
- when unit begins upgrade

- if triggering unit = build pad
-and # of upgrading units in region > 0

-then set upgrade progress to 0%


I can't figure out how to put in the condition "if # of upgrading buildings in region > 0 " I'm going to keep trying but I'm not super awesome at triggers. =]
 
Level 10
Joined
Nov 28, 2008
Messages
655
You could use a variable like a "token"

If upgrade = 0, then you can do it.
If upgrade = 1, then something is upgrading.

When it starts upgrading, checks to see if the "token" is free, aka it is on 0. If it is, then it sets it to 1, and does whatever it needs to. If it then finishes, it "frees" the "token", and sets it to 0.

You can then have each "base" have its own "token", maybe even devise a system to recycle the tokens to each base if they are buildable, or whatever.

Hope that helps.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
part 1
When Unit begins an upgrade.
if currentlyupgradingbase (is true) then
pause part 2
cancle the upgrade
unpause part 2
else
set currentlyupgradingbase to true
endif

part 2
unit finishes an upgrade or cancles an upgrade.
set currentlyupgradingbase to false

If your map has multiple bases, use some kind of hashtable system so that from the buildings you can get which base they belong to (an integer) which then gets a unique index for currentlyupgradingbase which logically would be an array.
 
Level 4
Joined
Jul 19, 2009
Messages
100
Ok Dr Super Good I don't quite understand but I havent updated to ver 1.24 so I don't have hashtabes in the editor. I'll try both suggestions out tomorow. Thanks!
 
Level 4
Joined
Jul 19, 2009
Messages
100
Ok I think It should work but I'm still trying to get it so that the upgrade starts but then waits for the other one to finish before the upgrade actually stats to progress. That way you can que buildings, like first build a supply depo, then a factroy, and then they build in that order.
 
Status
Not open for further replies.
Top