Randomized Structures (Solved) and Lists (Not Solved)
First part was solved! Here's how it works.
The wait actually doesn't make it not work. The wait gives you a chance to move the units out of the way... though, I suggest changing it to something like 5, or 10.
I also had to get rid of the replace action, as that removes the mine's value. Instead, remove the unit, then create the new one you want where the old one was.
I didn't include the duplicate triggers for creating the mines. They're all the same, except they each replace the Mine into a different unit. In my case, I had three different triggers, one for each new type of mine.
The second issue wasn't solved.
First part was solved! Here's how it works.
-
Mine Array
-
Events
- Map initialization
- Conditions
-
Actions
- Set RandomMineArray[1] = Build Stone Mine <gen>
- Set RandomMineArray[2] = Build Stone Mine <gen>
- Set RandomMineArray[3] = Build Stone Mine <gen>
- Set RandomMineArray[4] = Build Coal Mine <gen>
- Set RandomMineArray[5] = Build Coal Mine <gen>
- Set RandomMineArray[6] = Build Copper Mine <gen>
-
Events
-
Mine Randomizer
-
Events
- Time - Every 5.00 seconds of game time
- Conditions
-
Actions
- Trigger - Turn off RandomMineArray[LastTriggerActivated]
- Set LastTriggerActivated = (Random integer number between 1 and 6)
- Trigger - Turn on RandomMineArray[LastTriggerActivated]
-
Events
-
Build Stone Mine
-
Events
- Unit - A unit Finishes construction
-
Conditions
- (Unit-type of (Constructed structure)) Equal to Mine
-
Actions
- Wait (Random real number between 10.00 and 30.00) seconds
- Unit - Replace (Constructed structure) with a Stone Mine using The old unit's relative life and mana
-
Events
I also had to get rid of the replace action, as that removes the mine's value. Instead, remove the unit, then create the new one you want where the old one was.
I didn't include the duplicate triggers for creating the mines. They're all the same, except they each replace the Mine into a different unit. In my case, I had three different triggers, one for each new type of mine.
Hello everyone! I really love this website, and remember the help I've gotten before. Anyway, let's get to the question!
I'm creating a map (WOH!) and want to be able to make 'randomized mines'. The idea here is this: Unit constructs Mine. Wait 30-180 seconds. Replace Constructed Building with MineTypeA, MineTypeB, MineTypeC, ETC.
I basically have this already:
I'm not sure if that would work... and it might 'leak' or something. The idea is that whenever "IronMineTrigger" or any other is on, that it will turn a regular mine into that type as long as that one is turned on. So, if I wait five seconds after the game starts, I'll be able to get a CoalMine (AKA, it's random to everyone... except for those that know what I'm doing).
I don't know if that's the best way to do it... or if it would even work at all. So, if any of you can figure it out, THANKS!
I'm creating a map (WOH!) and want to be able to make 'randomized mines'. The idea here is this: Unit constructs Mine. Wait 30-180 seconds. Replace Constructed Building with MineTypeA, MineTypeB, MineTypeC, ETC.
I basically have this already:
- Randomized Mines
- Events
- Do every 3 seconds
- Conditions
- None
- Actions
- Turn off IronMineTrigger
- Turn on StoneMineTrigger
- Wait 1 second
- Turn off StoneMineTrigger
- Turn on CoalMineTrigger
- Wait 1 second
- Turn off CoalMineTrigger
- Turn on IronMineTrigger
I don't know if that's the best way to do it... or if it would even work at all. So, if any of you can figure it out, THANKS!
The second issue wasn't solved.
The second trigger I need is a 'list'. I've tried using a scoreboard, but that doesn't quiet work right because the items on the list move around when the values change. The idea is that when I mine from a CoalMine and the unit returns the 'coal', that it'll increase the amount of coal I own in the list. Then, when I construct certain buildings, or use certain units, it will 'eat' at that value.
Again, thanks everyone! I come up with some really hard Triggers, and can't quiet get them to work right. I'm sorry for bugging all of you... thanks!
I forgot to mention, but I don't know how to make it so when unitA mines from CoalMine and returns the gold back to the townhall, the owner of unitA gains xResources. (In my map it's not really gold... it's stone. :3)
Again, thanks everyone! I come up with some really hard Triggers, and can't quiet get them to work right. I'm sorry for bugging all of you... thanks!
I forgot to mention, but I don't know how to make it so when unitA mines from CoalMine and returns the gold back to the townhall, the owner of unitA gains xResources. (In my map it's not really gold... it's stone. :3)
Last edited: