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

[Trigger] need a lil help

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
I have these two triggers:
  • Events
    • Player - Player 1 (Red) types a chat message containing -st as An exact match
    • Player - Player 2 (Blue) types a chat message containing -st as An exact match
    • Player - Player 3 (Teal) types a chat message containing -st as An exact match
    • Player - Player 4 (Purple) types a chat message containing -st as An exact match
    • Player - Player 5 (Yellow) types a chat message containing -st as An exact match
    • Player - Player 6 (Orange) types a chat message containing -st as An exact match
    • Player - Player 7 (Green) types a chat message containing -st as An exact match
    • Player - Player 8 (Pink) types a chat message containing -st as An exact match
    • Player - Player 9 (Gray) types a chat message containing -st as An exact match
    • Player - Player 11 (Dark Green) types a chat message containing -st as An exact match
  • Conditions
    • (Triggering player) Equal to Host
  • Actions
    • Countdown Timer - Pause Mode_Selection
    • Countdown Timer - Destroy (Last created timer window)
    • Unit - Unpause all units
    • Set SameTeamMode = True
    • Unit Group - Pick every unit in (Units in Hero Circle <gen>) and do (Unit - Remove (Picked unit) from the game)
    • Game - Display to (All players) the message: (|cff085208SAME|r + (|cff291073TEAM|r + Mode has been chosen. |cffffcc00Computer will now generate heros.|r))
    • Unit Group - Pick every unit in (Units in Visiblity Modifier Hero <gen>) and do (Unit Group - Add (Picked unit) to All_Random)
    • Trigger - run Enable AR <gen> (checking conditions)
    • Game - Display to (All players) the message: (|cff085208ALL|r + (|cff291073RANDOM|r + has been disabled.))
    • Player Group - Pick every player in LightPlayers_Group and do (Trigger - Run SameTeam Mode <gen> (checking conditions))
    • Countdown Timer - Start Event_Timer as a One-shot timer that will expire in 140.00 seconds
    • Countdown Timer - Create a timer window for Event_Timer with title Hero Selection:
    • Countdown Timer - Start SpellCheck as a Repeating timer that will expire in 10.00 seconds
    • Trigger - Destroy (This trigger)
  • Events
  • Conditions
    • SameTeamMode Equal to True
    • (Number of units in (Units owned by (Picked player) matching (((Matching unit) is A Hero) Equal to True))) Less than 1
  • Actions
    • Set RandomUnitLight = (Random unit from All_Random)
    • Set LightSameTeam_Player = (Random player from LightPlayers_Group)
    • Set DarkSameTeam_Player = (Random player from DarkPlayers_Group)
    • Unit - Hide RandomUnitLight
    • Set UnitName = (( + ((Name of RandomUnitLight) + )))
    • Unit - Create 1 (Unit-type of RandomUnitLight) for LightSameTeam_Player at (Center of Light Teleport Base <gen>) facing (Position of (Triggering unit))
    • Set Players_Hero[(Player number of (Owner of RandomUnitLight))] = RandomUnitLight
    • Player - Set name of LightSameTeam_Player to (Stored_Players[(Player number of LightSameTeam_Player)] + UnitName)
    • Unit Group - Remove RandomUnitLight from All_Random
    • Unit - Set mana of RandomUnitLight to 100.00%
    • Unit Group - Add RandomUnitLight to LightHero
    • Set RandomUnitDark = RandomUnitLight
    • Unit - Create 1 (Unit-type of RandomUnitDark) for DarkSameTeam_Player at (Center of Brown No entry Zone <gen>) facing (Position of (Triggering unit))
    • Set Players_Hero[(Player number of (Owner of RandomUnitDark))] = RandomUnitDark
    • Player - Set name of DarkSameTeam_Player to (Stored_Players[(Player number of DarkSameTeam_Player)] + UnitName)
    • Unit - Set mana of RandomUnitDark to 100.00%
    • Unit Group - Add RandomUnitDark to DarkHero
    • Set UnitName = Empty String
    • Set RandomUnitDark = No unit
    • Set RandomUnitDark = No unit
My problem is i need this to run for every player on the light side. I don't think I triggered it right. Any help please?
 
Last edited:
Level 9
Joined
Jun 7, 2008
Messages
440
the trigger is supposed to create a hero that is exactly the same for a random player on opposite teams. the trigger itself works well. But i need to repeat it for every player (on the lightside) that is playing.
 
Level 9
Joined
Jan 17, 2009
Messages
372
first of all remove those leaks im too lazy to explain all of them so here is a linkhttp://www.hiveworkshop.com/forums/triggers-and-scripts-269/things-that-leak-35124/
Also, to check if a player is playing then you can use this
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(((Integer A) - 1))) slot status) Equal to Is playing
            • Then - Actions
              • Set Temp_Point = (Center of (Playable map area))
              • Unit - Create 1 Unit-Type for (Player(((Integer A) - 1))) at Temp_Point facing Default building facing degrees
              • Custom script: call Remove Location(udg_Temp_Point)
            • Else - Actions
That should work for whatever you are doing(i havent tested it) but you have to set the Unit-Type variable to the random hero's unit-type.
 
Level 9
Joined
Jun 7, 2008
Messages
440
i dont want each player on the one side to have the same hero. Each player on one side will have different heros, but each player on the opposite side will have the exact same heros. Basically, two players will have identical heros, those two players will not be allies
 
Status
Not open for further replies.
Top