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

Heroes Choosing Trigger

Status
Not open for further replies.
Level 9
Joined
Apr 28, 2006
Messages
187
In old versions of ROTG there was a different trigger to choose every hero. This is because heroes are chosen by entering regions.
This is not practical as theres 30 heroes. This is the new trigger im working on for choosing any hero.

  • Hero1 working Copy
    • Events
      • Unit - A unit enters Hero1 <gen>
      • Unit - A unit enters Hero2 <gen>
      • Unit - A unit enters Hero3 <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Spirit (Hero Picker)
    • Actions
      • Trigger - Turn off (This trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Hero1 <gen> contains (Triggering unit)) Equal to True
        • Then - Actions
          • Set HeroINTEGER = 1
          • Game - Display to (All players) the text: (String(HeroINTEGER))
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Hero2 <gen> contains (Triggering unit)) Equal to True
            • Then - Actions
              • Set HeroINTEGER = 2
              • Game - Display to (All players) the text: (String(HeroINTEGER))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Hero3 <gen> contains (Triggering unit)) Equal to True
                • Then - Actions
                  • Set HeroINTEGER = 3
                  • Game - Display to (All players) the text: (String(HeroINTEGER))
                • Else - Actions
                  • Do nothing
      • Set HeroINTEGER = 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Hero_Taken[HeroINTEGER] Equal to 0
              • Or - Any (Conditions) are true
                • Conditions
                  • ((Owner of (Triggering unit)) is in Team1) Equal to True
                  • ((Owner of (Triggering unit)) is in Team2) Equal to True
        • Then - Actions
          • Set Hero_Taken[HeroINTEGER] = 1
          • Set PickingPlayer[HeroINTEGER] = (Owner of (Triggering unit))
          • Unit - Remove (Triggering unit) from the game
          • Sound - Play HeroChosen <gen> at 100.00% volume, located at (Position of Hero[HeroINTEGER]) with Z offset 0.00
          • Special Effect - Create a special effect at (Position of Hero[HeroINTEGER]) using Abilities\Spells\Other\Monsoon\MonsoonBoltTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Hide Hero[HeroINTEGER]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (PickingPlayer[HeroINTEGER] is in Team1) Equal to True
            • Then - Actions
              • Unit - Create 1 HeroType[HeroINTEGER] for PickingPlayer[HeroINTEGER] at (Center of Team1StartZone <gen>) facing 0.00 degrees
              • Set PlayerHero[(Player number of PickingPlayer[HeroINTEGER])] = (Last created unit)
              • Camera - Pan camera for PickingPlayer[HeroINTEGER] to (Center of Team1StartZone <gen>) over 1.00 seconds
            • Else - Actions
              • Unit - Create 1 HeroType[HeroINTEGER] for PickingPlayer[HeroINTEGER] at (Center of Team2StartZone <gen>) facing 180.00 degrees
              • Set PlayerHero[(Player number of PickingPlayer[HeroINTEGER])] = (Last created unit)
              • Camera - Pan camera for PickingPlayer[HeroINTEGER] to (Center of Team2StartZone <gen>) over 1.00 seconds
          • Game - Display to (All players) for 9.00 seconds the text: (PlayerColor[(Player number of PickingPlayer[HeroINTEGER])] + (((Name of PickingPlayer[HeroINTEGER]) + |r) + ( has chosen + (PlayerColor[(Player number of PickingPlayer[HeroINTEGER])] + ((Name of PlayerHero[(Player number of PickingPlayer[HeroINTEGER])]) + |
          • Set ChosenTextPG = (Player group(PickingPlayer[HeroINTEGER]))
          • Game - Display to ChosenTextPG for 9.00 seconds the text: |C0099CC99You may r...
          • Game - Display to ChosenTextPG for 9.00 seconds the text: |C0099CC99You can t...
          • Custom script: call DestroyForce(udg_ChosenTextPG)
          • Hero - Create |c007EBFF1Mercenary Contract|r and give it to PlayerHero[(Player number of PickingPlayer[HeroINTEGER])]
          • Selection - Select PlayerHero[(Player number of PickingPlayer[HeroINTEGER])] for PickingPlayer[HeroINTEGER]
          • Sound - Play HeroSpawned <gen> at 100.00% volume, attached to PlayerHero[(Player number of PickingPlayer[HeroINTEGER])]
          • Special Effect - Create a special effect attached to the origin of PlayerHero[(Player number of PickingPlayer[HeroINTEGER])] using Abilities\Spells\Other\Awaken\Awaken.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set Random_Count = (Random_Count - 1)
        • Else - Actions
          • Do nothing
However, I need to know whitch region is being entered so i can know whitch hero to give them (hero integer) any ideas?
 
Level 9
Joined
Apr 28, 2006
Messages
187
Thanks for your replys fellas,
I'm right int he middle of working on the system, which has been revised considerably since this post, i'll post when its done to see if members of the community can improve it further.

Due to the nature of the map taven hero picking is definatly not viable.
 
Level 3
Joined
Jan 27, 2007
Messages
54
Try to use it,

  • Events
    • Unit - A unit enters Hero1 <gen>
    • Unit - A unit enters Hero2 <gen>
    • Conditions
    • (Unit-type of (Triggering unit)) Equal to Spirit (Hero Picker)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Hero1 <gen> contains (Triggering unit)) Equal to True
    • Then - Actions
    • Unit - Create 1 XXX for (Owner of (Triggering Unit) at (center of Hero1Spawn <gen>) facing xxx Degrees
  • Unit - Remove (triggering unit) from the game
    • Else - Actions
    • Do Nothing
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Hero2 <gen> contains (Triggering unit)) Equal to True
    • Then - Actions
    • Unit - Create 1 XXX for (...)
  • Unit - Remove (triggering unit) from the game
    • Else - Actions
    • Do Nothing
And You shouldn't turn off this trigger, becouse when 1st player will choose hero, rest of players won't be able to do it
And you can add more actions. I have tested it about 5 minutes ago and it was working correctly. I hope this will help you.
 
Status
Not open for further replies.
Top