Show/Hide Unit Problem

Severon

New Member
Reaction score
7
I've got a couple of trigger design to hide a particular building and spawn a unit for that building, then after a condition is met the building is to reappear and the unit is to be removed. The triggers I have work fine when they first run, but on the second time around they don't hide the structure, but they still spawn the unit and I'm a little confused to why it won't hide them again.

Here is a look at a sample trigger:
Trigger:
  • Spawn
    • Events
    • Conditions
    • Actions
      • pick every unit in Entire map owned by any plater Required: Structure Exclude dead missile Hidden.
      • Actions
        • If
          • picked unit == marine (structure)
        • then
          • hide picked unit
          • create 1 marine (unit) for owner of picked unit at position of picked unit
        • else
    • create 10 larva for player 5 at center of region Spawn
    • variable - set flag == 1


Trigger:
  • Check Spawn
    • Events
      • every 5.0 sec Game Time
    • Conditions
      • and
        • player 5 supply == 0
        • player 10 supply == 0
    • Actions
      • if
        • flag == 1
      • then
        • pick every unit in Entire map owned by any player Exclude: dead missile, hidden, invulnerable, structure
          • actions
            • remove picked unit
        • pick every unit in Entire Map owned by any player Required: hidden Exclude: missile dead
          • actions
            • show picked unit
      • variable - set flag = 0
      • else
    • if
      • counter == 12
      • then
        • run trigger Spawn Don't Wait
      • else
        • Variable - Set counter = (counter+1)
 

Monsterous

In the Shadows, Lurking.
Reaction score
99
It looks fine to me, so heres some suggestions

One suggestion is that when the building is being shown on the second trigger, the first trigger doesnt have time to hide it as its being shown. Put a wait after the building is being shown, or before the building is being hidden, see if that works.


Another suggestion, is that you could make the structure into a variable and change all the "marine (structure)" into the variable you just made. The triggers do seem to recognise the building still though by spawning the unit, so this is unlikely to work.
 

Severon

New Member
Reaction score
7
Hmm One suggestion one I'm not sure if thats the problem as the check spawn will not happen after the spawn has gone through, until the 10 larva that were created are killed.

Also the flag variable is to keep from calling on the show unit unless the spawn trigger has ran. Once spawn runs flag is set to one every 5 seconds that player 5 or 10 doesn't have a unit it will check to see if flag is 1. If it is then it will show the units and set flag to 0 so it doesn't keep trying to show the units. if Flag is 0 it should just skip over show units.

Never the less I will try your suggest and I hope it works, but I won't understand why it works if it doesXD
 
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