Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Heroes Choosing Trigger

Discussion in 'Bug Reporting\Technical Issues' started by Steelb_l_ade, Apr 25, 2007.

  1. Steelb_l_ade

    Steelb_l_ade

    Joined:
    Apr 28, 2006
    Messages:
    188
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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?
     
  2. Urlock

    Urlock

    Joined:
    Feb 26, 2005
    Messages:
    212
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Just use Taverns, duh.
     
  3. operator

    operator

    Joined:
    Feb 9, 2006
    Messages:
    1,670
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Really, do you find that very helpfull ? Do you answer his question with that comment ? Well, you don't. My advice is to give him some real help, if you don't know how to help him though, then simply don't respond to the thread.

    ~Operator
     
  4. Urlock

    Urlock

    Joined:
    Feb 26, 2005
    Messages:
    212
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Yes, I was being helpfull. Taverns are the best Hero selection system hands-down. If he needs help with that, I'd be glad to help him; but it's very easy to do so I doubt it.
     
  5. Steelb_l_ade

    Steelb_l_ade

    Joined:
    Apr 28, 2006
    Messages:
    188
    Resources:
    1
    Maps:
    1
    Resources:
    1
    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.
     
  6. Sar'Kter

    Sar'Kter

    Joined:
    Jan 27, 2007
    Messages:
    54
    Resources:
    0
    Resources:
    0
    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.