#1
Events -
A unit (Initializes the effect of an ability)
Conditions -
Ability being cast = (Animate)
*We do not need to specify the type of unit, as only the workers will have the ability.
Actions -
Set (Animator) = (Owner of casting unit)
*Here is the "Point" variable.
Set (AnimateTarget) = (Target point of ability being cast)
Dialog - Clear (DialogBox)
*As to make sure we don't have impurities in our dialog.
Dialog - Create Dialog Button for (DialogBox) labelled (Footman)
*Create Dialog Buttons for every unit, and label them as you call your units.
Dialog - Change title of (DialogBox) to (Animate units:)
Dialog - Show (DialogBox) for (Owner of casting unit)
Events -
A Dialog Button is clicked for (DialogBox)
Conditions -
Clicked Dialog Button = (FootmanButton)
Actions -
*Here is our Boolean.
Set (FootmanTrain) = True
If (Animator)'s current gold is (Inferior to 135), then (Game - Display to (Animator) the text: (Insufficient resources.)), else (Do nothing).
If (Animator)'s current gold is (Superior or equal to 135), then (Trigger - Run (TrainingMultiboard) <gen>, else (Do nothing).
*If the gold required is equal to 135.
*I'm introducing a new trigger here, TrainingMultiboard. We'll create it shortly.
Events -
*None, as the previous trigger will launch the trigger.
Conditions -
*None either.
Actions -
*Creating the Multiboard.
Multiboard - Create a multiboard with (20) colums and (2) rows, titled (TrainingMultiboard)
Set (TrainMultiboard) = (Last created multiboard)
*Changing display style.
Multiboard - Set the display style for (TrainMultiboard) item in column 0, row 1 to (Show text) and (Hide icons)
Multiboard - Set the display Style for (TrainMultiboard) item in column 0, row 2 to (Hide text) and (Show icons)
*Changing the width of the items.
Multiboard - Set the width for (TrainMultiboard) item in column 0, row 1 to 0.50% of the total screen width
Multiboard - Set the width for (TrainMultiboard) item in column 0, row 2 to 0.50% of the total screen width
*Changing the display icon. You'll have created two display icons types: one which states current progress, for example a yellow square, and another for the remaining training time, maybe a lighter yellow square. Then you convert them to BLP files using the many converters that are here in the [url=http://www.wc3sear.ch/index.php?p=Tools&sid=80fc423b85cd621d77151d5e7e993c0d]Tools Section[/url].
Set the icon for (TrainMultiboard) item in column 0, row 2 to (*\TrainProgress.blp)
*Changing the text display.
Multiboard - Set the width for (TrainMultiboard) item in column 1, row 1 to (6.00%) of the total screen width
Multiboard - Set the width for (TrainMultiboard) item in column 2, row 1 to (4.00%) of the total screen width
Multiboard - Set the text for (TrainMultiboard) item in column 1, row 1 to (Training Progress: [Footman])
*Note: Here, you need to make an If/Then/Else action for each type of unit. Yup!
If (FootmanTrain) = True, then (Multiboard - Set the text for (TrainMultiboard) item in column 2, row 1 to (String((Integer([TrainBarFootman]) + /) + (35)), else (Do nothing).
*If training time is equal to 35.
*Again, same function for every unit.
If (FootmanTrain) = True, then (Trigger - Run (TrainNumberFootman) <gen>, else (Do nothing)
Multiboard - Show (TrainMultiboard).
Events -
Time - Every (1.00) seconds of game time
Conditions -
*None, as the multiboard trigger runs this one only if the Footman is trained. If another unit is trained, then create another trigger for it with the required training time. Are you still following?
Actions -
Set (TrainBarFootman) = (TrainBarFootman) + (1.00)
*Let's add an effect!
Special effect - Create a special effect at (AnimateTarget) using (*Your choice.)
Events -
Game - (TrainBarFootman) becomes (Equal to) 35
Conditions -
*None!
Actions -
Trigger - Turn (off) (TrainNumberFootman)
Unit - Create (1) unit of type (Footman) for (Animator) at (AnimateTarget) facing (*We'll say (Random Angle))
Events -
Time - Every 0.10 seconds of game time
Conditions -
*None.
Actions -
*Icons.
For each integer A from (1) to (20), do actions:
Multiboard - Set the icon for (TrainMultiboard) item in column (Integer A), row 2 to (*Texture you chose previously.)
*Progress.
Set (TrainProgress[1]) = ((35) / (20))
Set (TrainProgress[2]) = 0.00
For each integer A from (1) to (20), do actions:
Set (TrainProgress[2]) = ((TrainProgress[2]) + (TrainProgress[1]))
If (All conditions are True), then (Do Actions), else (Do Actions):
If (TrainBarFootman) is (Superior or equal) to (TrainProgress[2])
Then Multiboard - Set the icon for (TrainMultiboard) item in column (Integer A), row 2 to (*Lighter texture you chose.)
Else Multiboard - Set the icon for (TrainMultiboard) item in column (Integer A), row 2 to (*Texture you chose previously.)
Multiboard - Set the text for (TrainMultiboard) item in column 2, row 1 to (String((Integer([TrainBarFootman]) + /) + (35))