Mr_Bean355
Member
- Reaction score
- 10
Hello guys,
I am currently designing a map with only GUI (and a few lines of custom script to remove leaks). I also have an AI for my map which I'm busy working on. As part of their item-buying, I have to store the completed recipes they have (as a variable), remove them, buy new items, then create the stored items again.
I have four variable arrays (there are four players) and each array has a size of 6 (6 inventory slots). Currently I have to have four triggers for the AI buying items (1 for each player). It looks something like this:
Trigger 1 (Player 1):
Events
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Create AI_1_Item[(Integer A)] and give it to (entering unit)
Trigger 2 (Player 2):
Events
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Create AI_2_Item[(Integer A)] and give it to (entering unit)
Trigger 3 (Player 3):
Events
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Create AI_3_Item[(Integer A)] and give it to (entering unit)
Trigger 4 (Player 4):
Events
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Create AI_4_Item[(Integer A)] and give it to (entering unit)
The other part of the trigger isn't important. Is there a way to put all these triggers into one (without using "IF")? Just say if I need to explain more...
Thanks,
Mr_Bean
I am currently designing a map with only GUI (and a few lines of custom script to remove leaks). I also have an AI for my map which I'm busy working on. As part of their item-buying, I have to store the completed recipes they have (as a variable), remove them, buy new items, then create the stored items again.
I have four variable arrays (there are four players) and each array has a size of 6 (6 inventory slots). Currently I have to have four triggers for the AI buying items (1 for each player). It looks something like this:
Trigger 1 (Player 1):
Events
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Create AI_1_Item[(Integer A)] and give it to (entering unit)
Trigger 2 (Player 2):
Events
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Create AI_2_Item[(Integer A)] and give it to (entering unit)
Trigger 3 (Player 3):
Events
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Create AI_3_Item[(Integer A)] and give it to (entering unit)
Trigger 4 (Player 4):
Events
For each (Integer A) from 1 to 6, do (Actions)
Loop - Actions
Create AI_4_Item[(Integer A)] and give it to (entering unit)
The other part of the trigger isn't important. Is there a way to put all these triggers into one (without using "IF")? Just say if I need to explain more...
Thanks,
Mr_Bean