How to make a trigger detect a not spawned unit?

GfameVideos

New Member
Reaction score
2
Well this is what im trying to use:


Trigger:
  • Force Recon Stats
    • Events
    • Conditions
    • Actions
      • Unit - Add Item Armor Bonus (+1) to (Triggering unit)


Then how am i supposed to add that armor bonus to a unit that aint spawned yet, which is Force Recon.???
?? BTW u choose it with a tavern.

And i do it this way cause it aint no hero, if u got a better way please say!
 

Vaius

New Member
Reaction score
19
"A Unit is Trained" only works if the unit is trained from a barracks, chimera roost, etc.

You can use this trigger if the units aren't trained from a building:

Trigger:
  • SampleTrigger
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Entering unit)) Equal to 0
        • Then - Actions
          • Unit - Add Item Armor Bonus (+1) to (Entering unit)
          • Unit - Set the custom value of (Entering unit) to 1
        • Else - Actions
          • Do nothing


Custom values is if, for example, the unit is for some reason removed from and then put back into the map.

EDIT: Also, if you want it only for a specific unit type, simply change it to this:

Trigger:
  • SampleTrigger
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Your_Unit
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Custom value of (Entering unit)) Equal to 0
        • Then - Actions
          • Unit - Add Item Armor Bonus (+1) to (Entering unit)
          • Unit - Set the custom value of (Entering unit) to 1
        • Else - Actions
          • Do nothing
 

tooltiperror

Super Moderator
Reaction score
231
I find custom values bad, and shouldn`t be used, because they may conflict with other triggers.

Structs are a good alternative if you know vJASS.
 

canons200

New Member
Reaction score
50
there are many way to detect spawn or not spawn unit, use condition boolean, food cap , upon creating of unit and etc.

but those method have to suit to your trigger.

maybe you can add the item armor + 1 upon creating of unit.
 

GfameVideos

New Member
Reaction score
2
Thx guys,

And tooltip, what you mean? inflict with other triggers?
Im making a shooter map were u choose arena/mode and play!

So that won't be a problem i think! :D
 

tooltiperror

Super Moderator
Reaction score
231
Well, if you make another trigger that uses custom values, they might bug each other.
 

GfameVideos

New Member
Reaction score
2
What does the custom value do,:

Set custom value of (unit) to 1?

Does that always need to be 1? even if i want armor higher?
 

Vaius

New Member
Reaction score
19
It can be set to whatever you want, I just used 1 because it was the most convenient at the time.
 
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