• 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.

Triggers: Unit Spawning help

Status
Not open for further replies.
Level 10
Joined
Jul 1, 2008
Messages
453
So I've finally decided to really start learning as much as I can about the Sc2 Editor and I want to start by making a practice map. I've decided to start some-what big (maybe too big) with a DOTA style map. So far I've create a complicated (at least to me) system of spawning marines on two sides and having them run down three different lanes.

Because I want it to seem more realistic I used 3 different regions for the outside lanes and one region for the center lane. I've also made it so once one marine dies, another unit is instantly created back at its respected base and sent down a random lane.

I don't know if it's just my computer, but it seems to lag pretty bad and I'm thinking it has to do with my horrible trigger set-up. If anyone could take a look at my map and give me some advice I'd greatly appreciate it!

cheers! =)
 

Attachments

  • DOTA1.SC2Map
    929 KB · Views: 63
Level 9
Joined
Dec 21, 2006
Messages
490
it doesn't lag for me and triggers seem to be correct. i am not using the fastest computer at all so i guess your settings are too high or something else eats all your cpu power.


btw telling from my xp with mapping the best start with any bliz editor is creating a TD because it has all basics without crazy depths.
 
Level 12
Joined
Apr 15, 2008
Messages
1,063
Yeah maybe that's why b.net is full of crappy TDs :grin:
Otherwise the triggers shouldn't cause any problems, there are some tricks you could use to improve them though. For example spawning trigger: You don't need a ton of IFs for that.
  • General - If (Conditions) then do (Actions) else do (Actions)
    • If
      • Marine Random Direction == 1
    • Then
      • Unit - Create 1 Marine for player 11 at (Random point in Marine Base) using default facing (No Options)
      • Unit - Order (Last created unit) to ( Attack targeting (Random point in Marine Left)) (Replace Existing Orders)
    • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • Marine Random Direction == 2
        • Then
          • Unit - Create 1 Marine for player 11 at (Random point in Marine Base) using default facing (No Options)
          • Unit - Order (Last created unit) to ( Attack targeting (Random point in Center )) (Replace Existing Orders)
        • Else
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • Marine Random Direction == 3
            • Then
              • Unit - Create 1 Marine for player 11 at (Random point in Marine Base) using default facing (No Options)
              • Unit - Order (Last created unit) to ( Attack targeting (Random point in Marine Right)) (Replace Existing Orders)
            • Else
First of all, if you use IFs like that, you can leave out the third one, as that is the only possibility (if it's not 1 or 2, it is 3 and you don't have to test it)
  • General - If (Conditions) then do (Actions) else do (Actions)
    • If
      • Marine Random Direction == 1
    • Then
      • Unit - Create 1 Marine for player 11 at (Random point in Marine Base) using default facing (No Options)
      • Unit - Order (Last created unit) to ( Attack targeting (Random point in Marine Left)) (Replace Existing Orders)
    • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • Marine Random Direction == 2
        • Then
          • Unit - Create 1 Marine for player 11 at (Random point in Marine Base) using default facing (No Options)
          • Unit - Order (Last created unit) to ( Attack targeting (Random point in Center )) (Replace Existing Orders)
        • Else
          • Unit - Create 1 Marine for player 11 at (Random point in Marine Base) using default facing (No Options)
          • Unit - Order (Last created unit) to ( Attack targeting (Random point in Marine Right)) (Replace Existing Orders)
Also, you could move the Unit - Create action outside the IF's, it's always the same.
  • Unit - Create 1 Marine for player 11 at (Random point in Marine Base) using default facing (No Options)
  • General - If (Conditions) then do (Actions) else do (Actions)
    • If
      • Marine Random Direction == 1
    • Then
      • Unit - Order (Last created unit) to ( Attack targeting (Random point in Marine Left)) (Replace Existing Orders)
    • Else
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • Marine Random Direction == 2
        • Then
          • Unit - Order (Last created unit) to ( Attack targeting (Random point in Center )) (Replace Existing Orders)
        • Else
          • Unit - Order (Last created unit) to ( Attack targeting (Random point in Marine Right)) (Replace Existing Orders)
And last, you should use arrays.
  • Init
  • Set MoveReg[1] = Marine Left
  • Set MoveReg[2] = Marine Right
  • Set MoveReg[3] = Marine Center
  • Unit - Create 1 Marine for player 11 at (Random point in Marine Base) using default facing (No Options)
  • Unit - Order (Last created unit) to ( Attack targeting (Random point in Move[Random Direction])) (Replace Existing Orders)
Well as you can see there was some room for imprevement....
 
Status
Not open for further replies.
Top