Hi, newbie to forums here, I signed up a while back but never got around to posting, but i have found that just reading these was a massive help. At the moment though, I cant find anything like what I'm trying to do, so thought I ought to actually ask.
What I'm aiming for is the following:
1. Barracks trains Swordsmen normally.
2. Barracks also offers upgrade called 'Generals'
3. When 'Generals' is researched, there is a 25% chance of creating a General (Mounted Swordsman) instead of the Regular Swordsman.
Is this possible? So far i have:
The Replace unit trigger (To deal with actually replacing the unit when its created, i think this works fine. This trigger is set to 'Initially disabled')
and this, the trigger to activate the first trigger. (I think this is the problem, not even sure if that variable is the right thing, but I couldn't think of anything else that would work)
Just something I'm building as part of a Blood Elf race in a map I'm making.
Any Ideas would be appreciated =] Cheers in advance! =]
What I'm aiming for is the following:
1. Barracks trains Swordsmen normally.
2. Barracks also offers upgrade called 'Generals'
3. When 'Generals' is researched, there is a 25% chance of creating a General (Mounted Swordsman) instead of the Regular Swordsman.
Is this possible? So far i have:
The Replace unit trigger (To deal with actually replacing the unit when its created, i think this works fine. This trigger is set to 'Initially disabled')
-
Upgrade Swordsmen
-
Events
- Unit - A unit Finishes training a unit
-
Conditions
- (Unit-type of (Trained unit)) Equal to Swordsman
-
Actions
- Set CaptainSpawn = (Random integer number between 1 and 4)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- CaptainSpawn Equal to 4
-
Then - Actions
- Unit - Remove (Trained unit) from the game
- Unit - Create 1 Swordsman for Player 1 (Red) at (Position of (Trained unit)) facing Default building facing degrees
-
Else - Actions
- Do nothing
-
If - Conditions
-
Events
and this, the trigger to activate the first trigger. (I think this is the problem, not even sure if that variable is the right thing, but I couldn't think of anything else that would work)
-
Research Upgrade Swordsmen
-
Events
- Unit - A unit Finishes an upgrade
-
Conditions
- (Researched tech-type) Equal to Generals
-
Actions
- Trigger - Turn on Upgrade Swordsmen <gen>
-
Events
Just something I'm building as part of a Blood Elf race in a map I'm making.
Any Ideas would be appreciated =] Cheers in advance! =]