I played around in WC3 Editor and got a basic understanding of triggers. In SC2 thiers a whole new system that i'm trying to learn slowly.
But if anyone wants to help would be greatly appreciated give me a head start in learning this.
In my game a player builds a building and the building itself will automatically start creating a set unit up to a maximum set number. If that unit dies the building will then make a another.
For example Player builds a Barracks. Barracks starts producing marines until 4 marines are in the battle field. Then they stop, the player should be able to click on the barracks and see whats building but cant build more than 4.
If a second barracks goes down, the 2 work together building marines until 8 are on the battle field.
Are you sure you want to use triggers? This can be done entirely in data.
You can use a behavior with a periodic effect issuing order to train units, while the Train ability has a requirement that requires the count of marines (QueuedOrBetter) to be less than 4 * barracks to allow training.
I would really implement that kind of stuff in data rather than triggers. Triggers is best used for "higher level" stuff.
Ok lets back up to behavior, just a bran new one, or duplicate one. Dont know what to do with it, but i think i can figure out the train unit ability (already thier :D)
a) Create a new behavior of type "buff".
b) Set behavior's period to 0.25 (or so), call the periodic effect created next step.
c) Create an effect type Issue Order, set ability to your train command, set Unit to "Source".
d) Create a new requirement for CountOfUnit(Marine) < CountOfUnit(Barracks)*4 (not quite the syntax, but you get the idea)
e) Set the train ability (new one, or a modified existing one) to take that requirement we just created to train more marines.
That's the big picture, you should manage to fill in the details, ask for more details about any specific part otherwise.
I changed the max que to 1 so one barracks wouldn't hog all the marines and have them count towards the max
One thing i can't figure out is, i changed the Command Card on the barracks, basically removed everything except rally and Train Marine, i then changed train marine to a passive. The only thing is the actual ability with the time bar on the barracks for the marine has no picture and can't figure out how to add that.
If i change the Train Marine ability back to normal on the command card the picture returns.
The other option is to remove the qued marine if the max is already obtained, if the player clicks it.
To prevent one barrack hoging all the queue, extend your requirement to also require CountOfUnit(Marine,QueuedOrBetterAtUnit) == 0 (not quite syntax again). That will ensure a barrack will not be able to queue a marine if it already has one in the queue or building.
The training bar depends on another ability of type "queue", you can define if it's visible and so on.
Well i want it to be visable, and it is, its just the Marine Icon next to the training bar on the barraks is a blue box, if i make the ability on the Command card a passive.
If i Change back to an active ability, the Marine icon returns but the player is able to click it to train more than intended. So making it a passive seemed like the best bet, but the icon missing is the only problem
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I played around in WC3 Editor and got a basic understanding of triggers. In SC2 thiers a whole new system that i'm trying to learn slowly.
But if anyone wants to help would be greatly appreciated give me a head start in learning this.
In my game a player builds a building and the building itself will automatically start creating a set unit up to a maximum set number. If that unit dies the building will then make a another.
For example Player builds a Barracks. Barracks starts producing marines until 4 marines are in the battle field. Then they stop, the player should be able to click on the barracks and see whats building but cant build more than 4.
If a second barracks goes down, the 2 work together building marines until 8 are on the battle field.
Where should I start?
Are you sure you want to use triggers? This can be done entirely in data.
You can use a behavior with a periodic effect issuing order to train units, while the Train ability has a requirement that requires the count of marines (QueuedOrBetter) to be less than 4 * barracks to allow training.
I would really implement that kind of stuff in data rather than triggers. Triggers is best used for "higher level" stuff.
Ok lets back up to behavior, just a bran new one, or duplicate one. Dont know what to do with it, but i think i can figure out the train unit ability (already thier :D)
a) Create a new behavior of type "buff".
b) Set behavior's period to 0.25 (or so), call the periodic effect created next step.
c) Create an effect type Issue Order, set ability to your train command, set Unit to "Source".
d) Create a new requirement for CountOfUnit(Marine) < CountOfUnit(Barracks)*4 (not quite the syntax, but you get the idea)
e) Set the train ability (new one, or a modified existing one) to take that requirement we just created to train more marines.
That's the big picture, you should manage to fill in the details, ask for more details about any specific part otherwise.
Worked perfect thank you!
I changed the max que to 1 so one barracks wouldn't hog all the marines and have them count towards the max
One thing i can't figure out is, i changed the Command Card on the barracks, basically removed everything except rally and Train Marine, i then changed train marine to a passive. The only thing is the actual ability with the time bar on the barracks for the marine has no picture and can't figure out how to add that.
If i change the Train Marine ability back to normal on the command card the picture returns.
The other option is to remove the qued marine if the max is already obtained, if the player clicks it.
To prevent one barrack hoging all the queue, extend your requirement to also require CountOfUnit(Marine,QueuedOrBetterAtUnit) == 0 (not quite syntax again). That will ensure a barrack will not be able to queue a marine if it already has one in the queue or building.
The training bar depends on another ability of type "queue", you can define if it's visible and so on.
Well i want it to be visable, and it is, its just the Marine Icon next to the training bar on the barraks is a blue box, if i make the ability on the Command card a passive.
If i Change back to an active ability, the Marine icon returns but the player is able to click it to train more than intended. So making it a passive seemed like the best bet, but the icon missing is the only problem