- Joined
- May 7, 2008
- Messages
- 346
So I'm having a bit of a difficulty sorting this out and I will try to explain it in easiest manner possible.
So I have a building that can train units (soldiers, knights) and cast abilities such as Upgrade Troops (which is basically an ability based on Berserk to allow me to immediately replace existing units with better ones) as well as having the ability to upgrade Building 1 into Building 2, etc.
Here's how Auto Training ability works in my map:
1) You press the button ''Activate Auto Train Troops'' and it activates the ability based on Mana Shield (trigger below):
This forces the building to keep training units after you've clicked on let's say Soldier and it won't stop until you deactivate it.
2) To deactivate the spell - ability you can order it via ''Deactivate Auto Train Troops'' which is also the same ability (Mana Shield), example below;
3) And finally - the auto upgrade trigger;
Everything works well except for the fact that after ''Auto Train'' trigger is activated, the triggering building blanks out all of the upgrades (as in makes them unavailable) since I think that the triggering building still thinks it is somehow training units.
Also tried using example below, it does nothing.
I tried using ''order triggering unit to stop or hold'' and it does nothing.
PS - I'm attaching a small map in case anyone wonders what exactly is the problem OR if you want to see it for yourself!
Any help is appreciated!
So I have a building that can train units (soldiers, knights) and cast abilities such as Upgrade Troops (which is basically an ability based on Berserk to allow me to immediately replace existing units with better ones) as well as having the ability to upgrade Building 1 into Building 2, etc.
Here's how Auto Training ability works in my map:
1) You press the button ''Activate Auto Train Troops'' and it activates the ability based on Mana Shield (trigger below):
-
Auto Train ON
-
Events
-
Unit - A unit Is issued an order with no target
-
-
Conditions
-
(Issued order) Equal to (Order(manashieldon))
-
-
Actions
-
-------- --------
-
Set VariableSet IsAutoTraining[(Custom value of (Triggering unit))] = True
-
-------- --------
-
Set VariableSet TempPG = (Player group((Owner of (Triggering unit))))
-
-------- --------
-
Game - Display to TempPG for 3.00 seconds the text: (You have |cff80ff80activated|r the auto training function for + (Name of (Triggering unit)))
-
-------- --------
-
Custom script: call DestroyForce (udg_TempPG)
-
-
This forces the building to keep training units after you've clicked on let's say Soldier and it won't stop until you deactivate it.
2) To deactivate the spell - ability you can order it via ''Deactivate Auto Train Troops'' which is also the same ability (Mana Shield), example below;
-
Auto Train OFF
-
Events
-
Unit - A unit Is issued an order with no target
-
-
Conditions
-
(Issued order) Equal to (Order(manashieldoff))
-
-
Actions
-
Set VariableSet IsAutoTraining[(Custom value of (Triggering unit))] = False
-
-------- --------
-
Set VariableSet TempPG = (Player group((Owner of (Triggering unit))))
-
-------- --------
-
Game - Display to TempPG for 3.00 seconds the text: (You have |cffff0000deactivated|r the auto training function for + (Name of (Triggering unit)))
-
-------- --------
-
Custom script: call DestroyForce (udg_TempPG)
-
-
3) And finally - the auto upgrade trigger;
-
Auto Train
-
Events
-
Unit - A unit Finishes training a unit
-
-
Conditions
-
IsAutoTraining[(Custom value of (Triggering unit))] Equal to True
-
-
Actions
-
-------- Order --------
-
Unit - Order (Triggering unit) to train/upgrade to a (Unit-type of (Trained unit))
-
-------- --------
-
-
Everything works well except for the fact that after ''Auto Train'' trigger is activated, the triggering building blanks out all of the upgrades (as in makes them unavailable) since I think that the triggering building still thinks it is somehow training units.
Also tried using example below, it does nothing.
-
Player - Make Surge Tower |cffff8080IV 4 Available for training/construction by Player 1 (Red)
I tried using ''order triggering unit to stop or hold'' and it does nothing.
PS - I'm attaching a small map in case anyone wonders what exactly is the problem OR if you want to see it for yourself!
Any help is appreciated!
Attachments
Last edited by a moderator: