- Joined
- Mar 21, 2007
- Messages
- 155
Hello, i'm trying to give everybody a tech level in my game, they start with tech level 10, and every time they tech up, (type in the command "tec up", and have the money required e.c.t.) thier tech level increases by 10. These are my triggers, players are differed by arrays, but in game they seem to bug up a lot, e.g. when a trigger comes up that looks at the tech level and sees if they can do this (e.g like increase a units hp and attack), its quite odd and unstable, can anybody shed some light? Ty. Sorry for the spam
Max Unit level = my tec level
Player = Player 1, 2 e.c.t.
player = just keeps a number at the start of all my triggers that call the tech variable, to see which player is the one who started the trigger
My initialization trigger, sets the variables
Max Unit level = my tec level
Player = Player 1, 2 e.c.t.
player = just keeps a number at the start of all my triggers that call the tech variable, to see which player is the one who started the trigger
My initialization trigger, sets the variables
-
initialization
-
Events
- Map initialization
- Conditions
-
Actions
- Set Player[1] = Player 1 (Red)
- Set Player[2] = Player 2 (Blue)
- Set Player[3] = Player 3 (Teal)
- Set Player[4] = Player 4 (Purple)
- Set Player[5] = Player 5 (Yellow)
- Set Player[6] = Player 6 (Orange)
- Set Player[7] = Player 7 (Green)
- Set Player[8] = Player 8 (Pink)
- Set Player[9] = Player 9 (Gray)
- Set Player[10] = Player 10 (Light Blue)
- Set Player[11] = Player 11 (Dark Green)
- Set Player[12] = Player 12 (Brown)
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
- Set Max_Unit_Level[(Integer A)] = 10
-
Loop - Actions
-
Events
-
teching up
-
Events
- Player - Player 1 (Red) types a chat message containing -tec up as An exact match (and so on with all the other players)
- Conditions
-
Actions
-
For each (Integer B) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Triggering player) Equal to Player[(Integer A)]
-
Then - Actions
- Set player = (Integer A)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Triggering player) Current gold) Greater than or equal to (Max_Unit_Level[player] x 10)
- ((Triggering player) Current lumber) Greater than or equal to (Max_Unit_Level[player] x 10)
-
Then - Actions
- Player - Set (Triggering player) Current gold to (((Triggering player) Current gold) - (Max_Unit_Level[player] x 10))
- Player - Set (Triggering player) Current lumber to (((Triggering player) Current lumber) - (Max_Unit_Level[player] x 10))
- Set Max_Unit_Level[player] = (Max_Unit_Level[player] + 10)
- Game - Display to (All players) for 10.00 seconds the text: ((Name of (Owner of (Triggering unit))) + ( has teched up, his tec level is now + (String(Max_Unit_Level[player]))))
-
Else - Actions
- Game - Display to (Player group((Triggering player))) for 10.00 seconds the text: You don't have enou...
-
If - Conditions
-
For each (Integer B) from 1 to 12, do (Actions)
-
Events
-
units power up
-
Events
- Unit - A unit Begins casting an ability
-
Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Ability being cast) Equal to Gain Power (normal)
- (Ability being cast) Equal to Gain Power (dmg)
- (Ability being cast) Equal to Gain Power (TANK)
- (Ability being cast) Equal to Gain Power (archer)
- (Ability being cast) Equal to Gain Power (wall)
-
Conditions
-
Or - Any (Conditions) are true
-
Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Owner of (Triggering unit)) Equal to Player[(Integer A)]
-
Then - Actions
- Set player = (Integer A)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Ability being cast) Equal to Gain Power (normal)
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Ability being cast) Equal to Gain Power (normal)
- ((Owner of (Triggering unit)) Current gold) Greater than or equal to 10
- ((Owner of (Triggering unit)) Current lumber) Greater than or equal to 10
- (Integer((Max life of (Triggering unit)))) Less than (Max_Unit_Level[player] x 100)
-
Then - Actions
- Player - Set (Owner of (Triggering unit)) Current gold to (((Owner of (Triggering unit)) Current gold) - 10)
- Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) - 10)
- Unit - Add Inventory (6 slot) to (Triggering unit)
- Hero - Create Unit Power up (20) and give it to (Triggering unit)
- Hero - Order (Triggering unit) to use (Last created item)
- Hero - Create Unit HP up (100) and give it to (Triggering unit)
- Hero - Order (Triggering unit) to use (Last created item)
- Unit - Remove Inventory (6 slot) from (Triggering unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Owner of (Triggering unit)) Current gold) Less than 10
- ((Owner of (Triggering unit)) Current lumber) Less than 10
-
Then - Actions
- Floating Text - Create floating text that reads You do not have eno... above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Integer((Max life of (Triggering unit)))) Greater than or equal to (Max_Unit_Level[player] x 100)
-
Then - Actions
- Floating Text - Create floating text that reads (You need to Upgrade your Tech)
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Events