- Joined
- May 15, 2009
- Messages
- 192
Hello Fellow Hive Workshoppers
I'm having a few troubles with a small system that I'm making. What it is supposed to do it, limit a combination of two units to 6 in total.
In other Words, instead of "Limit training of 'Unit X' for Player 1 Red to 6" I wanted to make "Limit training of 'Unit X/Unit Y' for Player 1 Red to '|X|+|Y|=6'
Hope that was clear enough, I'm not good at explaining.
Anyway, I got to the point where I could make both unit types unavailable after a total of 6 had been produced (and they were made available Again, if one of the two unit types died). The problem is getting the contructing unit to cancel ALL production, once the limit is reached.
The problem lies in the ability to cheat the system, if you queue up enough units (say, 7 or more) before the first 6 units are trained, you can go past the limit easily.
Is there a way to stop all production of a (2) unit types?
Triggers are below, in two parts.
Setting availiability:
Thank you for your time.
-Battlehound/Woodenplank
I'm having a few troubles with a small system that I'm making. What it is supposed to do it, limit a combination of two units to 6 in total.
In other Words, instead of "Limit training of 'Unit X' for Player 1 Red to 6" I wanted to make "Limit training of 'Unit X/Unit Y' for Player 1 Red to '|X|+|Y|=6'
Hope that was clear enough, I'm not good at explaining.
Anyway, I got to the point where I could make both unit types unavailable after a total of 6 had been produced (and they were made available Again, if one of the two unit types died). The problem is getting the contructing unit to cancel ALL production, once the limit is reached.
The problem lies in the ability to cheat the system, if you queue up enough units (say, 7 or more) before the first 6 units are trained, you can go past the limit easily.
Is there a way to stop all production of a (2) unit types?
Triggers are below, in two parts.
Setting availiability:
-
Check up Positive
-
Events
-
Game - EliteTotal_r becomes Less than 6.00
-
-
Conditions
-
Actions
-
Player - Make Footman Available for training/construction by Player 1 (Red)
-
Player - Make Rifleman Available for training/construction by Player 1 (Red)
-
-
-
Check up Negative
-
Events
-
Game - EliteTotal_r becomes Equal to 6.00
-
-
Conditions
-
Actions
-
Player - Make Footman Unavailable for training/construction by Player 1 (Red)
-
Player - Make Rifleman Unavailable for training/construction by Player 1 (Red)
-
-
-
Elite Unit Dies
-
Events
-
Unit - A unit owned by Player 1 (Red) Dies
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Footman
-
(Unit-type of (Triggering unit)) Equal to Rifleman
-
-
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Triggering unit)) Equal to Footman
-
-
Then - Actions
-
Set EliteDruid_r = (EliteDruid_r - 1.00)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Triggering unit)) Equal to Rifleman
-
-
Then - Actions
-
Set EliteSentinel_r = (EliteSentinel_r - 1.00)
-
-
Else - Actions
-
-
Set EliteTotal_r = (EliteDruid_r + EliteSentinel_r)
-
-
-
Elite Unit is Trained Trigger
-
Events
-
Unit - A unit owned by Player 1 (Red) Finishes training a unit
-
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
-
(Unit-type of (Trained unit)) Equal to Footman
-
(Unit-type of (Trained unit)) Equal to Rifleman
-
-
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Trained unit)) Equal to Footman
-
-
Then - Actions
-
Set EliteDruid_r = (EliteDruid_r + 1.00)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Trained unit)) Equal to Rifleman
-
-
Then - Actions
-
Set EliteSentinel_r = (EliteSentinel_r + 1.00)
-
-
Else - Actions
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(EliteDruid_r + EliteSentinel_r) Equal to 6.00
-
-
Then - Actions
-
Game - Display to (All players) the text: debug - not avail
-
Custom script: call IssueImmediateOrderById( GetTriggerUnit(), 851976 )
-
Game - Display to (All players) the text: Halted Training
-
-
Else - Actions
-
Game - Display to (All players) the text: debug - is avail
-
Game - Display to (All players) the text: Trained
-
-
-
Set EliteTotal_r = (EliteDruid_r + EliteSentinel_r)
-
-
Thank you for your time.
-Battlehound/Woodenplank