Problem with 'issue order' trigger

MissKerrigan

Active Member
Reaction score
23
Hello there,

What I'm trying to make is advanced but I'll try to explain it:

- I created 64 regions in my map (8x8 regions)
- There is some space between these region, but the space between the regions is all equal
- So let's say that every field of 6x6 contains a region of 2x2 in middle of it

- At the edge of the map there are 4 long regions which are:

1. region from left bottom to left top
2. region from left bottom to right bottom
3. right top to right bottom
4. right top to left top

(got me so far? :)

Now what I want to create is that units appears in the 4 regions I just mentioned and will move to a random region in the field with 64 regions. When they arrived in this region, they must pick a random region again, repeatly till they are dead.

(the map is just like a chess board where units start outside of the chessboard and keep moving in the chessboard till they are dead)

The purpose of the map is that you must find the units within time and kill them
Every level contains 10 units and before the timer reach zero you must killed them
When you found and killed all 10 units, the timer get's to 10 minutes again and the next level is coming


My only question is:

1. How can I order the computer to move the units to a random region?

I must tell you that I already tried to make 1 big region and give them a move to a random point in region, but this is not working because the units must keep moving in the field till they are dead

Hope anyone understands what I'm trying to do

MissKerrigan
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Put all the regions in a big region variable array and give them the move command to (Center of (YourRegionArray[(Random Integer between 0 and 63)]))
 

X-maul

AKA: Demtrod
Reaction score
201
yes, so you will need a random number between 0 and 64? (0 is also a number)
If you are not familiar with it, it would look something like this when storing it (which you should do in the start of the game)
Set Region[0] = Region 0
Set Region[1] = Region 1
And so on...

Also - Variables are your best friend when triggering :) It's super simple math, and can make your life a lot easier when triggering :) (also the most triggers would be impossible without variables to store information within)
 

MissKerrigan

Active Member
Reaction score
23
well I created 1000 triggers which are all without variables in my tower defense and it works fine, the only problem is that it cost me days to crea.... (what I just said) it cost me weeks to create a map.

I know variables should be easier and I will look some tutorials soon

About your threat: so there is an action in the trigger-data 'set region'?
and how exactly do I set this to a region when it's alerady a region?

At this moment, variables are not my friend :)
 

X-maul

AKA: Demtrod
Reaction score
201
Well to expres the power of it: I created a TD with 36 levels, and all the levels (with a boss round every 5th level, which only sends 1 unit) with 3 triggers.

You will set a variable of the type region - to a region (you can also set it to a point, and set the variable to the center of the region in the first place)
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I agree with X-maul. Learning variables is a GREAT thing. I've seen the triggers in your map. You could literally reduce the amount of triggers by at least 90%
 

X-maul

AKA: Demtrod
Reaction score
201
Think of it as a border. When you set a variable, you write something on that border, and every time you refer to the variable the computer goes back to that border to check what is written there.

For an example we could take your TD.
I asume you have different units for each wave, and a set amount of waves.
Then you could have an Integer (LevelNumberInteger) variable that is set to the current level of the wave.
Then you could have a Unit Type variable with an aray of XX (the amount of different units (just set it to something high - I needed 37 different, so I set it to 50))
Then you create a trigger that is run at map initialization and do like this

Code:
Set UnitType[1] = Marine
Set UnitType[2] = Marauder
Set UnitType[3] = Roach
... (and so on)

This way you can easily change what unit is send for each wave.

Then you create 1 trigger that runs periodically (if it's every XX seconds the wave starts) and set it to create X amount of UnitType[LevelNumberInteger] at Location 1.
and then you create an action that will
Set LevelNumberInteger = LevelNumberInteger + 1

(you could also adjust the amount of units being send for each wave with a variable like the "UnitType" variable)

Hopefully this makes some kind of sense to you :) I'm willing to take some time to teach you the basics if you want to :)
 

MissKerrigan

Active Member
Reaction score
23
if I make a tower defense with 37 waves, I can easily do this without any variables, exept 1 for the timer which MUST be created
 

X-maul

AKA: Demtrod
Reaction score
201
This way would also work with 500 waves and still have the same amount of triggers.
The reason you would do it with as few triggers as possible is to spare time and keep it simple.

There is no need to build a bridge if you can jump across the river - am I right?

I got a timer for each wave in my map as well :) It also does say what wave comes next.
The text in the timer is just refering to what level comes next.
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
if I make a tower defense with 37 waves, I can easily do this without any variables, exept 1 for the timer which MUST be created
So, I just downloaded your map again. It's up at 1275 triggers. With variables, you could easily do it with less than 50. Also, the triggers wouldn't be super long either, they'd just be a little longer than yours are.
 

MissKerrigan

Active Member
Reaction score
23
If it was about 'farm defense' then, how did I organized my maps this time? I created some folders, where I stored the triggers in
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
I was talking about farm defense, yes. It was decently organized. Using folders is a good step in the right direction. However, the sheer amount of triggers is the bigger problem here.
 

X-maul

AKA: Demtrod
Reaction score
201
We are not trying to say that you are doing it wrong, we are just telling you that there is a simpler way of doing it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top