• 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 1
Joined
Oct 6, 2006
Messages
7
I'm having trouble making a group of players being able to trigger something without making lots of triggers (one for each).

For instance If a unit enters an area, unit must be a sheep and player must be one of a couple of players, player 1,2,6.
I'm thinking a little about using a "matching player" funktion since I believe it can be more than one player, but I don't know how they work... :(
 
Level 1
Joined
Oct 6, 2006
Messages
7
I'm sorry...
I'm trying to make a sheep that walks into a certain region dissapear and then felbeast appears. problem is that I wan't this to happen only if the sheep entering the region belongs to some specific players (not just anyones sheep).
 
Level 1
Joined
Oct 6, 2006
Messages
7
Do I have to make one for each player? Or can "(player X)" be more than one player?

Also here's another one I need help with, it's pretty much the same thing I think:

Code:
Charm critter
    Events
        Unit - A unit Begins casting an ability
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Ability being cast) Equal to Charm Critter (Neutral Hostile)) and ((Unit-type of (Target unit of ability :S  being cast)) Equal to charmableunit[0])
            Then - Actions
                Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color
            Else - Actions
                Do nothing
This is an attempt by me to make a charm spell that's only working on a couple of specific unit-types.
This little trigger works, if cast on a sheep it changes the control of the sheep to player owning unit casting the spell.
Though I'd like to add some more creatures.
I've made myself a variable which I call charmableunit[0-7] with all eight of the unit's I'd like to be affected by the trigger, though I can't find a way to actually checking more than one of them, like in this case "charmableunit[0]" (sheep).

This is the same problem as the last one, or? though with unit types instead of players. I'm not sure if I'm clear enough on what I want though since I'm not certain how it works...
 
Level 18
Joined
Jan 24, 2006
Messages
1,938
Gimme three minutes and a harpoon gun and I'll have you the answers.

-EDIT
Ok, for the sheep entering a region and transforming into a felbeast this should do.
  • Sheep to Felbeast
    • Events
      • Unit - A unit enters Transform
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Sheep
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Entering unit)) Equal to Player 1 (Red)
          • (Owner of (Entering unit)) Equal to Player 2 (Blue)
          • (Owner of (Entering unit)) Equal to Player 6 (Orange)
    • Actions
      • Unit - Replace (Entering unit) with a Fel Beast using The old unit's relative life and mana
And for the charm one:
  • Charm Critter
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Charm Critter
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Entering unit)) Equal to Unit-Type #1
          • (Unit-type of (Entering unit)) Equal to Unit-Type #2
          • (Unit-type of (Entering unit)) Equal to Unit-Type #3
          • (Unit-type of (Entering unit)) Equal to Unit-Type #4
    • Actions
Also, I noticed you've used Copy As Text and pasted it into
Code:
 tags, but you can use the [trigger] tags like I have, it's much prettier ^^.

-*meow*[/COLOR]
 
Last edited:
Level 1
Joined
Oct 6, 2006
Messages
7
Het, it worked! ;D
Thanks to you guys, you're awesome!
  • Charm critter
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Charm Critter (Neutral Hostile)
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to charmableunit[0]
          • (Unit-type of (Target unit of ability being cast)) Equal to charmableunit[1]
          • (Unit-type of (Target unit of ability being cast)) Equal to charmableunit[2]
          • (Unit-type of (Target unit of ability being cast)) Equal to charmableunit[3]
          • (Unit-type of (Target unit of ability being cast)) Equal to charmableunit[4]
          • (Unit-type of (Target unit of ability being cast)) Equal to charmableunit[5]
          • (Unit-type of (Target unit of ability being cast)) Equal to charmableunit[6]
          • (Unit-type of (Target unit of ability being cast)) Equal to charmableunit[7]
    • Actions
      • Unit - Change ownership of (Target unit of ability being cast) to (Owner of (Casting unit)) and Change color
      • Unit - Remove Wander (Neutral) from (Target unit of ability being cast)
  • Sacrifice Sheep
    • Events
      • Unit - A unit enters Deamon summoning <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Sheep
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Entering unit)) Equal to demon[0]
          • (Owner of (Entering unit)) Equal to demon[1]
          • (Owner of (Entering unit)) Equal to demon[2]
          • (Owner of (Entering unit)) Equal to demon[3]
          • (Owner of (Entering unit)) Equal to demon[4]
          • (Owner of (Entering unit)) Equal to demon[5]
          • (Owner of (Entering unit)) Equal to demon[6]
          • (Owner of (Entering unit)) Equal to demon[7]
          • (Owner of (Entering unit)) Equal to demon[8]
    • Actions
      • Player - Add 10 to (Owner of (Entering unit)) Current gold
      • Unit - Kill (Entering unit)
      • Unit - Create 5 Lesser Fel Beast for Player 12 (Brown) at (Center of Deamon summoning <gen>) facing 270.00 degrees
      • Unit - Create 1 Fel Beast for Player 12 (Brown) at (Center of Deamon summoning <gen>) facing 270.00 degrees
      • Special Effect - Create a special effect at (Center of Deamon summoning <gen>) using Abilities\Spells\Orc\AncestralSpirit\AncestralSpiritCaster.mdl
      • Trigger - Run Move Demons summon <gen> (checking conditions)
you can also just check if the chosen player is in a given playergroup... that's also more dynamic
That's what I couldn't get working I only found (after help here) out how to add them one and one. Well I'm not sure if I'm right, after all I've never used it...
 
Level 1
Joined
Oct 6, 2006
Messages
7
Don't just thank and compliment me, rep me ;P!

-*meow*
Don't know how to... :)

Well, I've run into another problem.
I'd like to add a new gold mine with a trigger (actually it's a couple of them but I'm using a periodic event.). The thing is, I'd like them to have very little gold in them.
I made a new goldmine ability and changed the amount of gold there to 500 but once they appear ingame they have 12500 (or something). Any ideas on how this could be solved?
 
Level 18
Joined
Jan 24, 2006
Messages
1,938
Don't know how to... :)
Hit the
reputation.gif
, just below my post count.

As for your problem, I'm guessing you've forgotten to replace the original Goldmine ability with your modified one that has 500 max gold.

-*meow*
 
Level 1
Joined
Oct 6, 2006
Messages
7

As for your problem, I'm guessing you've forgotten to replace the original Goldmine ability with your modified one that has 500 max gold.

-*meow*
I'm pretty sure I've done this, with two different ones...
I'll double check it. :smile:
 
Status
Not open for further replies.
Top