• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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