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

Need help with trigger

Status
Not open for further replies.
Level 3
Joined
Aug 2, 2009
Messages
22
so i need a trigger wich activates xtra unit spawns for all allies of the player if the upgrade is upgraded and also upgrade it for all allies ( it got multiple lvls, or it must look like it got more levels) . Anybody got an idea or know how it is?
 
Level 3
Joined
Aug 2, 2009
Messages
22
is it like this then ?

  • Shaman
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • (Researched tech-type) Equal to Shaman Increase
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Current research level of Shaman Increase for Player 1 (Red)) Equal to 2
              • (Current research level of Shaman Increase for Player 3 (Teal)) Equal to 2
              • (Current research level of Shaman Increase for Player 5 (Yellow)) Equal to 2
              • (Current research level of Shaman Increase for Player 7 (Green)) Equal to 2
              • (Current research level of Shaman Increase for Player 9 (Gray)) Equal to 2
        • Then - Actions
          • Player - Set the current research level of Shaman Increase to 2 for Player 1 (Red)
          • Player - Set the current research level of Shaman Increase to 2 for Player 3 (Teal)
          • Player - Set the current research level of Shaman Increase to 2 for Player 5 (Yellow)
          • Player - Set the current research level of Shaman Increase to 2 for Player 7 (Green)
          • Player - Set the current research level of Shaman Increase to 2 for Player 9 (Gray)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Current research level of Shaman Increase for Player 1 (Red)) Equal to 1
                  • (Current research level of Shaman Increase for Player 3 (Teal)) Equal to 1
                  • (Current research level of Shaman Increase for Player 5 (Yellow)) Equal to 1
                  • (Current research level of Shaman Increase for Player 7 (Green)) Equal to 1
                  • (Current research level of Shaman Increase for Player 9 (Gray)) Equal to 1
            • Then - Actions
              • Player - Set the current research level of Shaman Increase to 1 for Player 1 (Red)
              • Player - Set the current research level of Shaman Increase to 1 for Player 3 (Teal)
              • Player - Set the current research level of Shaman Increase to 1 for Player 5 (Yellow)
              • Player - Set the current research level of Shaman Increase to 1 for Player 7 (Green)
              • Player - Set the current research level of Shaman Increase to 1 for Player 9 (Gray)
            • Else - Actions
              • Do nothing
 
Level 4
Joined
Aug 2, 2007
Messages
69
nonono. Right now you are saying that all of those conditions must be met. Instead, you should create variables.

for example:
set variable shaman = 0

Now when the units spawn it should look like this:
-Create Shaman number of Shaman for player

Now:
The above trigger for event and condition are fine. The action would be:
-Set the current research level of Shaman Increase to 2 for (Owner of(Triggering Unit))
-If - Owner of Triggering Unit is equal to Player 1(Red)
-Then - Set variable of ShamanRed to ShamanRed + 1
-Else - Do Nothing


Play around with it for a bit. I think you might have to make multiple variables like, shamanteal, shamanred, etc.. Once you make an action to change the variable, the amount of shamans will spawn = to the variable amount.

Edit: I added the If/Then/Else in the action above. If you keep repeating the If/Then/Else for all the other players then it should work fine.
 
Level 3
Joined
Aug 2, 2009
Messages
22
so i need a trigger wich activates xtra unit spawns for all allies of the player if the upgrade is upgraded and also upgrade it for all allies ( it got multiple lvls, or it must look like it got more levels) . Anybody got an idea or know how it is?
thts what i said, so the players you c are just 1 force

and aint the
  • Or - Any (Conditions) are true
just make it 1 it needs?

and i forgot tht i needed to make 2 action tht triggered both a different trigger tht is innitialy off something like
  • Shaman Respawn1
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Shaman for Player 11 (Dark Green (Computer)) at (Center of aRegion)facing 0.00 degrees
and another one but then with more shamans

and instead of using multiple variables it's easier to use 1 variable with arrays
 
Last edited:
Level 4
Joined
Aug 2, 2007
Messages
69
Personally I wouldn't do "Every 30 seconds of game time" as the event. Instead make an invisible repeating timer and have the event - "When timer expires"

Is your map consisting of two teams?
In that case you just need 2 shaman variables.

Team 1: Shaman1
Team 2: Shaman2

Then the following triggers would work for you. I'm copying this from my current map so you would just rename everything else.
This trigger is to make the invisible timer:
  • Spawn Timer
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Countdown Timer - Create a timer window for MonsterTimer with title Monster Spawner
    • Countdown Timer - Start MonsterTimer as a Repeating timer that will expire in 30.00 seconds
Now you want to set the two variables in this example. The variable type is "Integer". I'm going to add more units just to show you that you can add all the units you need. This is just the initial setting for your game:
  • Unit Variables
  • Events
    • Map initialization
  • Conditions
  • Actions
    • Set Shaman1 = 1
    • Set Shaman2 = 1
    • Set Grunt1 = 1
    • Set Grunt 2 = 1
    • Set Tauren1 = 0
    • Set Tauren2 = 0
Doing this will ensure that at least 1 shaman and grunt is spawned for both teams. Since the Tauren is set at 0, they will not spawn until the variable is changed.

Next is the trigger to spawn units:
  • Spawn Units
  • Events
    • Time - MonsterTimer expires
  • Conditions
  • Actions
    • Unit - Create Shaman1 Shaman for Player 1 (Red) at (Center of Team 1 Spawn <gen>) facing Default building facing degrees
    • Unit - Create Grunt1 Grunt for Player 1 (Red) at (Center of Team 1 Spawn <gen>) facing Default building facing degrees
    • Unit - Create Tauren1 Tauren for Player 1 (Red) at (Center of Team 1 Spawn <gen>) facing Default building facing degrees
Okay so now you have units. Now I will show you how to add units to the spawn with your research system. I noticed that you used "Upgrade" in your event trigger rather than "Research". There is a difference between an upgrade and a research, make sure you know what "Shaman Increase" is. I also noticed that you used a general unit event. I would use a specific unit event instead.

I'm going to assume that it is a research, so lets look at how the trigger would be displayed:
  • Increase Shaman Research
  • Events
    • Unit - Blacksmith Finishes research
  • Conditions
    • (Researched tech-type) Equal to Shaman Increase to 2
  • Actions
    • Set Shaman1 = Shaman1 + 1
Now you have 2 shaman that spawn when the timer expires.

This is trigger will work assuming, there are 2 teams. Both teams share 1 building to do research. That research will increase the spawn numbers for either team. Hopefully this will give you a better understanding of my direction. You don't have to do any actions that set the research to anything. The game will set it automatically during gameplay when you do the research.

+rep if this helps ^.^
 
Status
Not open for further replies.
Top