• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Trigger help

Status
Not open for further replies.
Level 7
Joined
Jul 11, 2008
Messages
104
Hey guys, I'm having some problems with some triggers. I'll go step-by-step.

First off, I need help with this one:

  • Events
    • Unit - A unit finishes casting an ability
  • Conditions
    • (Ability being cast) equal to XXX
  • Actions
    • Unit - Change ownership of XXXUnit (gen) to (Owner of (Casting Unit)) and change color
    • Game - Display to (All Players) the text: (XXX + ((Name of (Owner of (Casting Unit))) + XXX))
What I want it to do is: When a unit uses a certain ability, it will give control of another certain unit, and display that text, however, nothing happens when I use the ability.

Help would be appreciated.
 
Level 7
Joined
May 21, 2009
Messages
289
Hmm, well I tried this trigger with the spell Blizzard using an archmage and the footman I used to change colors did and the text displayed. So in other words it worked for me. You sure your using the same spell that is configured in the trigger? And if so, can you show your actual trigger instead of that trigger?

EDIT:
My bad, I didn't notice that your trigger posted could be your actual trigger, it is kind of misleading though....
 
Level 7
Joined
Jul 11, 2008
Messages
104
Hmm, well I tried this trigger with the spell Blizzard using an archmage and the footman I used to change colors did and the text displayed. So in other words it worked for me. You sure your using the same spell that is configured in the trigger? And if so, can you show your actual trigger instead of that trigger?

EDIT:
My bad, I didn't notice that your trigger posted could be your actual trigger, it is kind of misleading though....

That is my actual trigger. The spell I'm using is sleep, and I'm using it on a building. The sleep has a 5 second cast time and no effect (As intended), but when the hero is finished casting sleep, nothing happens.
 
Level 7
Joined
Jul 11, 2008
Messages
104
Channeling works, thanks guys. ^^

Another trigger I need help with, I don't know how to make it:

I would like it so that when a player controls the unit, he and his teammates all gain +1 lumber per second. And if a player from another team takes control of the unit, they gain +1 lumber per second, and the opposing team doesn't.
 
Level 7
Joined
May 21, 2009
Messages
289
I have a trigger for this-
  • house
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add (Number of living Lumber House units owned by (Picked player)) to (Picked player) Current lumber
This will add 1 lumber every 1 second per unit to the owner of that kind of unit. This what you looking for?
 
Level 7
Joined
Jul 11, 2008
Messages
104
I have a trigger for this-
  • house
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Player - Add (Number of living Lumber House units owned by (Picked player)) to (Picked player) Current lumber
This will add 1 lumber every 1 second per unit to the owner of that kind of unit. This what you looking for?

Perfect. Thank you.

This might be the last one I need help with:

I have a tavern with heroes. How do I make it so that it teleports all the heroes to a certain location, frozen, and once everyone picks a hero, it unfreezes them?

Thanks. ^^
 
Level 6
Joined
Feb 18, 2010
Messages
153
Well i know how to make unit move to specific location but cant figure out how to make it check if played owns unit

  • Tele
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Selling unit)) Equal to Hero Tavern
    • Actions
      • Unit - Move (Sold unit) instantly to (Center of Region <gen>)
and i think the check triger is somet like this

  • ChecHero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • Unit - Suspend corpse decay for (Sold unit)
      • Wait until Conditions HERE, checking every 1.00 seconds
      • Unit - Resume corpse decay for (Sold unit)
just dunno

anyways good luck
 
Level 8
Joined
Apr 30, 2009
Messages
338
Change event to:

starts the effect of an ability

Change (Owner of (Casting Unit)) to:

Owner of (Triggering Unit)
 
Level 8
Joined
Jan 8, 2010
Messages
493
why not try adding a counter to check if the number of heroes in the certain location is the same as the number of playing heroes? something like:

  • Check
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to HeroTavern
    • Actions
      • Unit - Move (Sold unit) instantly to (Center of HeroWaitingArea)
      • Unit - Pause (Sold unit)
      • Set HeroCounter = (HeroCounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HeroCounter Equal to PlayingPlayers
        • Then - Actions
          • Unit Group - Pick every unit in (Units in HeroWaitingArea) and do (Actions)
            • Loop - Actions
              • Unit - Unpause (Picked unit)
        • Else - Actions
and uhh be sure to remove any leaks in that trigger. it's just a sample. :eek:
 
Status
Not open for further replies.
Top