• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[General] Trigger - Region Array Assistance

Status
Not open for further replies.
Level 4
Joined
Aug 12, 2014
Messages
48
Have an idea for a map that I need some help with. Appreciate any ideas / help creating a trigger.

The map is like a chessboard. Each square is a region and the game is played from square to square. There are 100 squares and each one contains a resource (gold, lumber, food) or nothing. I have a test map (included) where I created the array and can trigger the creation of a unit in a random region. More or less working... but with a few critical flaws.

I need a trigger that creates a random resource inside of each square without the trigger creating more than one resource in each. So either I need some additional variables / arrays or I am going to have to trigger each and every single region. Right now, I have it set so that it picks a random region (to reduce the amount of triggers needed) but that really adds to the duplicating issue.

Surely there is an easier way?

Step by step example:
1: Game is loaded
2: 100 regions load / variables attached
3: trigger to create resources runs
4: trigger picks region 1 - creates tree
5: trigger picks region 2 - creates mine
6: trigger picks region 3 - creates nothing
7: trigger picks region 4 - creates food
8: trigger repeats until every region has had a chance at creating a resource
9: trigger ends, moves on to other map functions...
 

Attachments

Dude!!! You're awesome. I greatly appreciate you providing the triggers too, that is exactly what I was hoping for. I will go ahead and tinker with that and implement it into the full map.
 
Status
Not open for further replies.
Back
Top