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!
i am working on a custom training system where units trsin into other units by targetting buidings with channel. the triggers for each version of the ability is more or less the same but only one of them works. i have set different base order ids for each. please help me out.
For "Unit stops casting an ability" event there is no "Target unit of ability being cast". Since "Target of ability being cast" returns null, the condition fails and your unit is not replaced.
Change the event to "Unit starts an effect of an ability" and you will see it works just fine.
no it will not work fine. then the unit will be replaced right away. i want it to be replaced when it is done channeling. please help me accomplish that.
Unit starts casting an ability: If targeted unit == any of the specified units you want, index the unit into unit array, under same index number index the unit-type into which the unit is supposed to.
Unit stops casting an ability: Find the unit in the unit array and change it into unit-type you saved under same index.
Look at the pseudo-code
Code:
Events
Unit starts casting
Conditions
Ability = Basic train ability
Actions
If - Conditions
Target = barracks or ..
Actions
Set Index = Index + 1
Set TrainingUnit[Index] = (Triggering unit)
Set NewUnit[Index] = Grunt //determine this your own way into which he should morph)
/////
Events
Unit stops casting
Conditions
Or - Conditions
Ability = Basic train ability
Ability = Improved train ability
Ability = Best train ability
Actions
For each loop_int from 1 to Index
Loop
If - Conditions
(triggering unit) Equals to TrainingUnit[loop_var]
Actions
Change TrainingUnit[loop_var] into NewUnit[loop_var]
...deindex here ...
The second pseudo-trigger can take care of all your training units, since he just checks if the caster is in the TrainingUnit array and just changes it to the unit-type you set in first trigger.
Also I would change the event from "Unit stops casting an ability" to "Unit finishes casting an ability" - difference is that the first one fires when your unit is interrupted. For example instead of 30 second "training", if your unit got stunned after 2 seconds, he would change immediately.
Here look into my edits, i think it all works like you would want it.
Nevermind, the uploading of files doesn't work... The following error occurred
The uploaded file is empty.
training system-edit.w3x
Well then have a look at the triggers (where did the trigger editor format go in this forum?):
BasicTrainingInit
Events
Unit - A unit Begins channeling an ability
Conditions
Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to (==) basic unit training
Then - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Multiple ConditionsOr - Any (Conditions) are true
Conditions
(Unit-type of (Target unit of ability being cast)) Equal to (==) Great Hall
(Unit-type of (Target unit of ability being cast)) Equal to (==) Barracks
Then - Actions
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Training started!
Else - Actions
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Wrong building!
Wait 1.00 seconds
Unit - Pause (Triggering unit)
Unit - Unpause (Triggering unit)
Else - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to (==) improved unit training
Then - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Multiple ConditionsOr - Any (Conditions) are true
Conditions
(Unit-type of (Target unit of ability being cast)) Equal to (==) Stronghold
(Unit-type of (Target unit of ability being cast)) Equal to (==) Barracks
Then - Actions
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Training started!
Else - Actions
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Wrong building!
Wait 1.00 seconds
Unit - Pause (Triggering unit)
Unit - Unpause (Triggering unit)
Else - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to (==) Advanced unit training
Then - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Multiple ConditionsOr - Any (Conditions) are true
Conditions
(Unit-type of (Target unit of ability being cast)) Equal to (==) Fortress
(Unit-type of (Target unit of ability being cast)) Equal to (==) Barracks
Then - Actions
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Training started!
Else - Actions
Game - Display to (Player group((Owner of (Triggering unit)))) the text: Wrong building!
Wait 1.00 seconds
Unit - Pause (Triggering unit)
Unit - Unpause (Triggering unit)
Else - Actions
BasicTrainingFin
Events
Unit - A unit Finishes casting an ability
Conditions
Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to (==) basic unit training
Then - Actions
Unit - Replace (Triggering unit) with a Grunt using The old unit's relative life and mana
Else - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to (==) improved unit training
Then - Actions
Unit - Replace (Triggering unit) with a Troll Headhunter using The old unit's relative life and mana
Else - Actions
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Ability being cast) Equal to (==) Advanced unit training
Then - Actions
Unit - Replace (Triggering unit) with a Raider using The old unit's relative life and mana
Else - Actions
You just have to nest these triggers. You can also use an indexing system like Nichilus wrote. This would be recommended if you plan on using a multitude of units.
the thing is that the system needs to check what building it targets and the ability being used. basic training for example creates grunt while advanced training creates a different unit.
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.