- Joined
- May 7, 2009
- Messages
- 21
I'm making a TD based off of Final Fantasy Tactics. The general idea is you get 5 towers and each start off at one of two classes then as you upgrade, more classes become available, yadda yadda yadda. But, in order to keep it so each tower has to fulfill requirements for a new class (example: Player 3's Tower 2 has upgraded to Monk Level 3, so it can change its class to Geomancer Level 1, but Player 3's Towers 1, 3, 4, and 5 are only Monk levels 1 and 2 so therefore cannot upgrade to the Geomancer class yet), I've made a big list of variables that are constantly being checked.
Partial example for changing Tower 1 to the Archer Job Class:
Now, normally I would just have a variable for each Tower+Level, and use a boolean to check if, say,
Basically, my question is, does anyone have any advice on how to implement a loop system to cut down these enormous triggers? Not to mention having to make 5 of each? Don't get me wrong, so far everything works without a hitch, but it's taking an assload of time. I haven't been able to figure out a loop system because there's 40 towers but only 8 levels per tower, so I can't make IntegerA match up. Hmmmm.... as I'm writing this... maybe IntegerA divided by 5 might work somewhere....
Partial example for changing Tower 1 to the Archer Job Class:
-
Change Archer 1
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Archer
- (Triggering unit) Equal to Tower1[(Player number of (Triggering player))]
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- EnabledArcher8[(((Player number of (Triggering player)) x 5) - 4)] Equal to True
-
Then - Actions
- Unit - Replace (Triggering unit) with a Archer (Mastered) using The old unit's relative life and mana
- Set Tower1[(Player number of (Triggering player))] = (Last replaced unit)
- Selection - Select (Last replaced unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- EnabledArcher7[(((Player number of (Triggering player)) x 5) - 4)] Equal to True
-
Then - Actions
- Unit - Replace (Triggering unit) with a Archer (Level 7) using The old unit's relative life and mana
- Set Tower1[(Player number of (Triggering player))] = (Last replaced unit)
- Selection - Select (Last replaced unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- EnabledArcher6[(((Player number of (Triggering player)) x 5) - 4)] Equal to True
-
Then - Actions
- Unit - Replace (Triggering unit) with a Archer (Level 6) using The old unit's relative life and mana
- Set Tower1[(Player number of (Triggering player))] = (Last replaced unit)
- Selection - Select (Last replaced unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- EnabledArcher5[(((Player number of (Triggering player)) x 5) - 4)] Equal to True
-
Then - Actions
- Unit - Replace (Triggering unit) with a Archer (Level 5) using The old unit's relative life and mana
- Set Tower1[(Player number of (Triggering player))] = (Last replaced unit)
- Selection - Select (Last replaced unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- EnabledArcher4[(((Player number of (Triggering player)) x 5) - 4)] Equal to True
-
Then - Actions
- Unit - Replace (Triggering unit) with a Archer (Level 4) using The old unit's relative life and mana
- Set Tower1[(Player number of (Triggering player))] = (Last replaced unit)
- Selection - Select (Last replaced unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- EnabledArcher3[(((Player number of (Triggering player)) x 5) - 4)] Equal to True
-
Then - Actions
- Unit - Replace (Triggering unit) with a Archer (Level 3) using The old unit's relative life and mana
- Set Tower1[(Player number of (Triggering player))] = (Last replaced unit)
- Selection - Select (Last replaced unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- EnabledArcher2[(((Player number of (Triggering player)) x 5) - 4)] Equal to True
-
Then - Actions
- Unit - Replace (Triggering unit) with a Archer (Level 2) using The old unit's relative life and mana
- Set Tower1[(Player number of (Triggering player))] = (Last replaced unit)
- Selection - Select (Last replaced unit)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- EnabledArcher1[(((Player number of (Triggering player)) x 5) - 4)] Equal to True
-
Then - Actions
- Unit - Replace (Triggering unit) with a Archer (Level 1) using The old unit's relative life and mana
- Set Tower1[(Player number of (Triggering player))] = (Last replaced unit)
- Selection - Select (Last replaced unit)
-
Else - Actions
- Game - Display to Player 1 (Red), at offset (0.00, 0.00) the text: The Archer Job Clas...
-
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)
-
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)
-
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)
-
Events
- Conditions - Archer5 [Player Number of (Triggering Player)] = True
- Conditions - EnabledArcher5[(((Player number of (Triggering player)) x 5) - 4)] Equal to True
- Conditions - EnabledArcher5[(((Player number of (Triggering player)) x 5) - 3)] Equal to True
- Conditions - EnabledArcher5[(((Player number of (Triggering player)) x 5) - 2)] Equal to True
Basically, my question is, does anyone have any advice on how to implement a loop system to cut down these enormous triggers? Not to mention having to make 5 of each? Don't get me wrong, so far everything works without a hitch, but it's taking an assload of time. I haven't been able to figure out a loop system because there's 40 towers but only 8 levels per tower, so I can't make IntegerA match up. Hmmmm.... as I'm writing this... maybe IntegerA divided by 5 might work somewhere....