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

[TRIGGER]Morphing buildings and triggers

Status
Not open for further replies.
Level 2
Joined
Oct 30, 2009
Messages
20
Hey guys,

I've been working on a map for a while using the melee units and stuff. Recently I've came across a problem that has bothered me for a couple of hours or so.

Its like this. I have code that basically sets up tech buildings for unit spawning later, using triggers. This is all well and good when I go to use the exact same code (with small modification) to make a roach warren, baneling nest, and hydralisk den using a drone and orders. But for some reason, the actual building doesn't delay the actual setup of the Tech Buildings array, hence spawning the brood lords without the actual building being complete. I have tried using progress bars, training ques and everything, but I just cant seem to detect the progress of the Greater spire. The actual building does start to morph, it only doesn't pickup and progress.

Thanks in advance!

Roach Warren: (works fine)
  • General - If (Conditions) then do (Actions) else do (Actions)
    • If
      • Turns >= 15
      • Events[3] == false
    • Then
      • UI - Create a tip with title (Format tip "Zerg Units" as Normal Tip), description "You have progressed far enough in t...", alert text "Zerg Units" and icon Assets\Textures\btn-tips-research.dds for (All players)
      • Variable - Set Events[3] = true
      • Player - Modify player 15 Minerals: Add 1000
      • Player - Modify player 15 Vespene: Add 1000
      • Tech Tree - Disable tech tree requirements for player 15
      • Unit - Create 1 Drone for player 15 at Roach Warren using default facing (No Options)
      • Unit - Order (Last created unit) to (Drone - Mutate into Roach Warren targeting Roach Warren) (Replace Existing Orders)
      • General - Wait 0.25 Game Time seconds
      • Unit Group - Pick each unit in (Roach Warren units in (Entire map) owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
        • Actions
          • Variable - Set Roach Warren = (Picked unit)
      • UI - Display "Uh Oh, Kerrigan Has Ordered A Roach..." for (All players) to Subtitle area
      • Ping - Ping the minimap at Roach Warren for (All players) over 5.0 seconds, using the color (100%, 0%, 0%)
      • UI - Display boss bar 2 with title "Roach Warren Completion", portrait Assets\Textures\btn-building-zerg-roachwarren.dds and maximum value 100 for (All players)
      • UI - Set boss bar 2 maximum value to 100 (Do refresh the boss bar)
      • UI - Move boss bar 2 to Top of screen with offset (0, 150)
      • UI - Set boss bar 2 race to Zerg (Do refresh the boss bar)
      • UI - Show boss bar 2
      • General - While (Conditions) are true, do (Actions)
        • Conditions
          • (Roach Warren is under construction) == true
        • Actions
          • UI - Set boss bar 2 current value to (Integer((Progress of Roach Warren slot 1))) (Do refresh the boss bar)
          • General - Wait 0.125 Game Time seconds
      • General - Wait for (Conditions), checking every 1.0 Game Time seconds
        • Conditions
          • Or
            • Conditions
              • (Roach Warren is alive) == false
              • And
                • Conditions
                  • (Roach Warren is alive) == true
                  • (Roach Warren is under construction) == false
      • UI - Hide boss bar 2
      • Variable - Set Unit Increment[2] = 3.0
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Roach Warren is alive) == true
          • (Roach Warren is under construction) == false
        • Then
          • Variable - Set Tech Buildings[1] = true
        • Else
    • Else
Brood Lords: (Somewhat works, but doesn't delay the brood lords with the actual building)
  • General - If (Conditions) then do (Actions) else do (Actions)
    • If
      • Turns >= 55
      • Events[11] == false
      • Tech Buildings[4] == true
        • Then
      • Variable - Set Events[11] = true
      • Tech Tree - Disable tech tree requirements for player 15
      • Player - Modify player 15 Minerals: Add 1000
      • Player - Modify player 15 Vespene: Add 1000
      • Unit Group - Pick each unit in (Spire units in (Entire map) owned by player 15 matching Excluded: Missile, Dead, Hidden, with at most Any Amount) and do (Actions)
        • Actions
          • Variable - Set Greater Spire = (Picked unit)
      • General - Wait 0.25 Game Time seconds
      • Unit - Order Greater Spire to (Spire - Mutate into Greater Spire) (Replace Existing Orders)
      • General - Wait 1.0 Game Time seconds
      • UI - Display "Uh Oh, Kerrigan congratulates you o..." for (All players) to Subtitle area
      • Ping - Ping the minimap at Spire for (All players) over 5.0 seconds, using the color (100%, 0%, 0%)
      • UI - Display boss bar 6 with title "Greater Spire Completion", portrait Assets\Textures\btn-building-zerg-greaterspire.dds and maximum value 100 for (All players)
      • UI - Set boss bar 6 maximum value to 100 (Do refresh the boss bar)
      • UI - Move boss bar 6 to Top of screen with offset (0, 150)
      • UI - Set boss bar 6 race to Zerg (Do refresh the boss bar)
      • UI - Show boss bar 6
      • General - While (Conditions) are true, do (Actions)
        • Conditions
          • (Greater Spire is under construction) == true
        • Actions
          • UI - Set boss bar 6 current value to (Integer((Progress of Greater Spire slot 1))) (Do refresh the boss bar)
          • General - Wait 0.125 Game Time seconds
      • General - Wait for (Conditions), checking every 1.0 Game Time seconds
        • Conditions
          • Or
            • Conditions
              • (Greater Spire is alive) == false
              • And
                • Conditions
                  • (Greater Spire is alive) == true
                  • (Greater Spire is under construction) == false
      • UI - Hide boss bar 6
      • Variable - Set Unit Increment[5] = 6.0
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Greater Spire is alive) == true
          • (Greater Spire is under construction) == false
        • Then
          • Variable - Set Tech Buildings[5] = true
        • Else
    • Else
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
You will need to eithor provide the map or to post the full triggers involved.

Currently a lot of important information is missing about your system. Such as the events and the part which actually spawns the unit.

What I can say is you have alot of procedural coupling which can result in more accidental programming errors (such as referencing the wrong variable or value).

Tech Tree - Disable tech tree requirements for player 15
Do you ever enable them again for player 15? If not, you could optimize a tad by calling the function only once.
 
Level 2
Joined
Oct 30, 2009
Messages
20
Thanks for replying super good :) I've managed to fix it by just checking what sort of unit it is (Greater Spire variable) either a Spire or Greater Spire, and just manually updating the progress bar because it takes 100 seconds, 1 per second. Works fine now :)
 
Status
Not open for further replies.
Top