Vegas wrote:
This will disable the towers for EVERY race. Don't forget, I still need to be able to use the other races still.
Using this method, I am wondering if it would be easiest to add 200 towers to the builder, and then a trigger to randomly disable 190 towers. But I wonder if a builder can actually have 200 towers.
Yeah, i wasn't sure how your game played so i put it for all players but that is easily changed. About the unit having 200 buildings, as a test i added multiple units to the peasant, i was able to add over 200 units and it did not crash in-game when i opened the build menu for him.
So..about just disabling them, when i was testing with all the towers available and disabling them i realized that it goes by the units build order, the way you added the towers to the builder. Basically..if a number gets selected twice, one or more of the first 11 towers will always be shown... as you imagine this is a problem. So, using this method we are basically stuck until a way past this is made.
If we disable all towers then randomly enable them, if the number is picked twice there will be less than 11 towers available. And if they are enabled and randomly disabled one of the first 11 towers will always be shown. We have to find either a way to add the towers that does not rely so much on the random trigger, or see if there is a way to check to see individual integers to see if its duplicated.
I've been working out a way, which should work but its a bit of extra work..basically you got two triggers, well, three but the third can be done without much effort....First is setting each tower to a unit-type variable. Then, making an action which makes a integer variable random numbers for each player.
Code: Select all
Untitled Trigger 004 Copy
Events
Map initialization
Conditions
Actions
Set Towers[1] = Town Hall
Set Towers[2] = Keep
Set Towers[3] = Castle
Set Towers[4] = Barracks
...
For each (Integer A) from 1 to 11, do (Actions)
Loop - Actions
Set TowersIntRed[(Integer A)] = (Random integer number between 1 and 200)
For each (Integer A) from 1 to 11, do (Actions)
Loop - Actions
Set TowersIntBlue[(Integer A)] = (Random integer number between 1 and 200)
...
Then, for the second trigger, this one will get pretty big. Basically we have a set timer for .30 seconds, which is used to check if there are any duplicates, and we just use conditions to go one by one and add them in. But..you would have to copy and create one if/then/else for each other player. I just used red here, blue would go under..and so on.
Code: Select all
Untitled Trigger 005
Events
Time - Every 0.30 seconds of game time
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
TowersIntRed[1] Equal to TowersIntRed[2]
TowersIntRed[1] Equal to TowersIntRed[3]
TowersIntRed[1] Equal to TowersIntRed[4]
...
Then - Actions
Set TowersIntRed[1] = (Random integer number between 1 and 200)
Player - Make Towers[TowersIntRed[1]] Available for training/construction by Player 1 (Red)
Else - Actions
Player - Make Towers[TowersIntRed[1]] Available for training/construction by Player 1 (Red)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
TowersIntRed[2] Equal to TowersIntRed[3]
TowersIntRed[2] Equal to TowersIntRed[4]
TowersIntRed[2] Equal to TowersIntRed[5]
...
Then - Actions
Set TowersIntRed[2] = (Random integer number between 1 and 200)
Player - Make Towers[TowersIntRed[2]] Available for training/construction by Player 1 (Red)
Else - Actions
Player - Make Towers[TowersIntRed[2]] Available for training/construction by Player 1 (Red)
Its a bit of time spent, but i do not see any reason why this should not work.
The final trigger is simply one to turn off the last trigger.
Code: Select all
Untitled Trigger 006
Events
Time - Elapsed game time is 3.00 seconds
Conditions
Actions
Trigger - Turn off Untitled Trigger 005 <gen>
Hopefully you can see through the mess ive made and get it working right. Towers is a unit-type variable, array size 200 for each tower. TowerInt is integer variable, array size 11.
Edit : Forgot to add, in the trigger that adds the towers to the interger you will need to disable the towers for this one to work since we are enableing them. With the towers being added to the integer this can easily be done by adding the action
Code: Select all
Player Group - Pick every player in (All players) and do (For each (Integer A) from 1 to 200, do (Player - Make Towers[(Integer A)] Unavailable for training/construction by (Picked player)))
Edit2 : Found a few copy/paste errors in the code.