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

[Solved] Issue With a Simple Trigger

Status
Not open for further replies.
Level 2
Joined
Aug 24, 2008
Messages
5
Here is the trigger I made. It's supposed to be a custom building system done in this way for purposes I have not begun working on yet. It works, as it builds the buildings and such in the desired way, but the issue is that once the particular "Mana Wards" are done, it's supposed to add them to Player 1's Unit Group of "Manastonegroup1" as well as setting the maximum mana for all players to the current base +25. It does not, however, do this. I have no idea why.

  • Building Copy
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Constructing and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Basic Mana Ward
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Picked unit)) Less than 100.00
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with (100.00 - (Percentage life of (Picked unit)))% transparency
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 15.00)
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Items\AIil\AIilTarget.mdl
                • Else - Actions
                  • Unit - Replace (Picked unit) with a (Unit-type of (Picked unit)) using The old unit's life and mana
                  • Set ManaMax = (ManaMax + 25)
                  • If ((Owner of (Last created unit)) Equal to Player 1 (Red)) then do (Unit Group - Add (Picked unit) to Manastonegroup1) else do (Do nothing)
                  • Unit Group - Remove (Last created unit) from Constructing
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Percentage life of (Picked unit)) Less than 100.00
                • Then - Actions
                  • Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with (100.00 - (Percentage life of (Picked unit)))% transparency
                  • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 15.00)
                  • Special Effect - Create a special effect at (Position of (Picked unit)) using Abilities\Spells\Items\AIil\AIilTarget.mdl
                • Else - Actions
                  • Unit - Replace (Picked unit) with a (Unit-type of (Picked unit)) using The old unit's life and mana
                  • Unit Group - Remove (Picked unit) from Constructing
If it's not a problem with that one, it could be this much simpler one, which adds to Player 1's "Mana Pool" based on how many Wards he has:

  • Mana Part 2
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set Mana1 = (Mana1 + (Number of units in Manastonegroup1))
      • Multiboard - Set the text for Manaboard item in column 2, row 1 to (String(Mana1))
I realize my way of doing things is primitive, but it's the way I've been doing it for years, and it's the only way I know how. And honestly, I don't know what went wrong.

Also, unless I posted in some time when I was 13-14, this is my first post. Hi.

(By the way, i'm afraid i'll be gone for a while, but any help is still appreciated. And I found posts from when I was younger. Mine is the face of shame.)
 
Last edited:
Level 2
Joined
Aug 24, 2008
Messages
5
  • Unit - Replace (Picked unit) with a (Unit-type of (Picked unit)) using The old unit's life and mana
This is not needed, why do it then? Why not just keep using picked unit?

I understand your question. If I don't include that step, the building will not construct properly. I tried multiple different ways, and that one was the best one I came up with. It just replaces the un-constructed building with the constructed version. It works for my purposes.

(Also, sorry for the late response. I'm back now, though.)
 
Level 2
Joined
Aug 24, 2008
Messages
5
I don't understand what this trigger is for, but:

If
  • (Unit-type of (Picked unit)) Equal to Basic Mana Ward
is true,
and
  • (Percentage life of (Picked unit)) Less than 100.00
is false... dont use "picked unit" any more, use "replaced unit" instead.

Thanks, i'll try that.

EDIT: Thank you very much, it worked. It seems as though my brain just skipped right over the "Last Replaced Unit" part, and didn't realize it was a problem. With that, I bid you adieu.
 
Status
Not open for further replies.
Top