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

My Triger don't work

Status
Not open for further replies.
This is a comand that asks every existing player if he wants creeps to be spawned or not. But I found out it's not working. Can you find my mistake?
  • start
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set IsItOk = 0
      • Set asking_players = (Number of players in (All players))
  • suggest
    • Events
      • Player - Player 1 (Red) types a chat message containing -spawns as An exact match
      • Player - Player 2 (Blue) types a chat message containing -spawns as An exact match
      • Player - Player 3 (Teal) types a chat message containing -spawns as An exact match
      • Player - Player 4 (Purple) types a chat message containing -spawns as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -spawns as An exact match
      • Player - Player 6 (Orange) types a chat message containing -spawns as An exact match
      • Player - Player 7 (Green) types a chat message containing -spawns as An exact match
      • Player - Player 8 (Pink) types a chat message containing -spawns as An exact match
      • Player - Player 9 (Gray) types a chat message containing -spawns as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -spawns as An exact match
      • Player - Player 6 (Orange) types a chat message containing -spawns as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -spawns as An exact match
      • Player - Player 12 (Brown) types a chat message containing -spawns as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in (All players controlled by a User player)) Greater than 1
        • Then - Actions
          • Game - Display to (All players) the text: (Color[(Player number of (Triggering player))] + ((Name of (Triggering player)) + |r is suggesting |c00FF8000spawns|r. If you agree type -ok, if you do not agree type -no. After no the vote will be reset!))
          • Trigger - Turn on calculating01 <gen>
          • Trigger - Turn on calculating02 <gen>
          • Trigger - Turn on calculating03 <gen>
          • Trigger - Turn on calculating04 <gen>
          • Trigger - Turn on calculating05 <gen>
          • Trigger - Turn on calculating06 <gen>
          • Trigger - Turn on calculating07 <gen>
          • Trigger - Turn on calculating08 <gen>
          • Trigger - Turn on calculating09 <gen>
          • Trigger - Turn on calculating10 <gen>
          • Trigger - Turn on calculating11 <gen>
          • Trigger - Turn on calculating12 <gen>
          • Trigger - Turn on checking <gen>
          • Trigger - Turn on no <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in (All players controlled by a User player)) Equal to 1
        • Then - Actions
          • Trigger - Turn on spawning <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • checking
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • no Equal to True
        • Then - Actions
          • Trigger - Turn off calculating01 <gen>
          • Trigger - Turn off calculating02 <gen>
          • Trigger - Turn off calculating03 <gen>
          • Trigger - Turn off calculating04 <gen>
          • Trigger - Turn off calculating05 <gen>
          • Trigger - Turn off calculating06 <gen>
          • Trigger - Turn off calculating07 <gen>
          • Trigger - Turn off calculating08 <gen>
          • Trigger - Turn off calculating09 <gen>
          • Trigger - Turn off calculating10 <gen>
          • Trigger - Turn off calculating11 <gen>
          • Trigger - Turn off calculating12 <gen>
          • Set IsItOk = 0
          • Trigger - Turn on suggest <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IsItOk Equal to asking_players
        • Then - Actions
          • Game - Display to (All players) the text: (Color[(Player number of (Triggering player))] + All agreed |c00FF8000spawns|r.)
          • Trigger - Turn on spawning <gen>
          • Trigger - Turn off suggest <gen>
          • Trigger - Turn off calculating01 <gen>
          • Trigger - Turn off calculating02 <gen>
          • Trigger - Turn off calculating03 <gen>
          • Trigger - Turn off calculating04 <gen>
          • Trigger - Turn off calculating05 <gen>
          • Trigger - Turn off calculating06 <gen>
          • Trigger - Turn off calculating07 <gen>
          • Trigger - Turn off calculating08 <gen>
          • Trigger - Turn off calculating09 <gen>
          • Trigger - Turn off calculating10 <gen>
          • Trigger - Turn off calculating11 <gen>
          • Trigger - Turn off calculating12 <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
  • calculating01
    • Events
      • Player - Player 1 (Red) types a chat message containing -ok as An exact match
    • Conditions
    • Actions
      • Set IsItOk = (IsItOk + 1)
      • Trigger - Turn off (This trigger)
  • no
    • Events
      • Player - Player 1 (Red) types a chat message containing -no as An exact match
      • Player - Player 2 (Blue) types a chat message containing -no as An exact match
      • Player - Player 3 (Teal) types a chat message containing -no as An exact match
      • Player - Player 4 (Purple) types a chat message containing -no as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -no as An exact match
      • Player - Player 6 (Orange) types a chat message containing -no as An exact match
      • Player - Player 7 (Green) types a chat message containing -no as An exact match
      • Player - Player 8 (Pink) types a chat message containing -no as An exact match
      • Player - Player 9 (Gray) types a chat message containing -no as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -no as An exact match
      • Player - Player 6 (Orange) types a chat message containing -no as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -no as An exact match
      • Player - Player 12 (Brown) types a chat message containing -no as An exact match
    • Conditions
    • Actions
      • Set no = True
  • spawning
    • Events
      • Time - Every 45.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 8 Footman for (Random player from Team_ALLY) at (Center of Alli Spawn <gen>) facing Default building facing degrees
      • Unit Group - Pick every unit in (Units of type Footman) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To (Center of Horde Spawn <gen>)
      • Unit - Create 8 Grunt for (Random player from Team_HORDE) at (Center of Horde Spawn <gen>) facing Default building facing degrees
      • Unit Group - Pick every unit in (Units of type Grunt) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Attack-Move To (Center of Alli Spawn <gen>)
 
Last edited:
Level 7
Joined
Mar 6, 2006
Messages
282
If your 'spawning' trig is not being turned on, then look at what turns it on:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • IsItOk Equal to asking_players
    • Then - Actions
      • Game - Display to (All players) the text: (Color[(Player number of (Triggering player))] + All agreed |c00FF8000spawns|r.)
      • Trigger - Turn on spawning <gen>
And see if that condition can ever be met. That should be your first clue.

IsItOk is increased for every player that voted, and asking_players seemed to be set to (All Players).

Wait a second...

t296.jpg


Bam!!
 
Thanks for noticing this, now i edited it on
  • Set asking_players = (Number of players in (All players controlled by a User player))
But still the spawning trigger seems to not turning on. Maybe the issue is somewehere else? :O

edit: I tested what is the integer with a message and it is 12?

edit 2:
  • Set asking_players = (Number of players in (All players matching (((Matching player) controller) Equal to User)))
this fixed it.

edit 3: I tested with this but somehow they dont spawn again... :( not for more than 1 users'. Maybe the problem is in the -ok vote checking?
 
Last edited:
Level 7
Joined
Mar 6, 2006
Messages
282
People actually playing the game can be filtered with:

  • ((Matching player) controller) Equal to User
  • ((Matching player) slot status) Equal to Is playing
If you go to Scenario -> Player Properties, you can see which players you have set to "User". Those are just potential player slots that may or may not be filled, so to filter the people actually in those slots, you need to check their slot with "slot status Equal to Is playing"
 
Ok, so I found out that, as DysfunctionaI said, the problem is in counting the players. So how do I count them? Every othet trigger of the function works! I tested them. I tried what he wrote, but does not seem to work.

Here you go the trigger again.
  • suggest
    • Events
      • Player - Player 1 (Red) types a chat message containing -spawns as An exact match
      • Player - Player 2 (Blue) types a chat message containing -spawns as An exact match
      • Player - Player 3 (Teal) types a chat message containing -spawns as An exact match
      • Player - Player 4 (Purple) types a chat message containing -spawns as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -spawns as An exact match
      • Player - Player 6 (Orange) types a chat message containing -spawns as An exact match
      • Player - Player 7 (Green) types a chat message containing -spawns as An exact match
      • Player - Player 8 (Pink) types a chat message containing -spawns as An exact match
      • Player - Player 9 (Gray) types a chat message containing -spawns as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -spawns as An exact match
      • Player - Player 6 (Orange) types a chat message containing -spawns as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -spawns as An exact match
      • Player - Player 12 (Brown) types a chat message containing -spawns as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in (All players matching (((Matching player) controller) Equal to User))) Greater than 1
        • Then - Actions
          • Game - Display to (All players) the text: (Color[(Player number of (Triggering player))] + ((Name of (Triggering player)) + |r is suggesting |c00FF8000spawns|r. If you agree type -ok, if you do not agree type -no. After no the vote will be reset!))
          • Trigger - Turn on checking <gen>
          • Trigger - Turn on calculating01 <gen>
          • Trigger - Turn on calculating02 <gen>
          • Trigger - Turn on calculating03 <gen>
          • Trigger - Turn on calculating04 <gen>
          • Trigger - Turn on calculating05 <gen>
          • Trigger - Turn on calculating06 <gen>
          • Trigger - Turn on calculating07 <gen>
          • Trigger - Turn on calculating08 <gen>
          • Trigger - Turn on calculating09 <gen>
          • Trigger - Turn on calculating10 <gen>
          • Trigger - Turn on calculating11 <gen>
          • Trigger - Turn on calculating12 <gen>
          • Trigger - Turn on no <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in (All players matching (((Matching player) controller) Equal to User))) Equal to 1
        • Then - Actions
          • Trigger - Turn on spawning <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions
edit: Will someone tell me will this work? what do you think?
  • suggest
    • Events
      • Player - Player 1 (Red) types a chat message containing -spawns as An exact match
      • Player - Player 2 (Blue) types a chat message containing -spawns as An exact match
      • Player - Player 3 (Teal) types a chat message containing -spawns as An exact match
      • Player - Player 4 (Purple) types a chat message containing -spawns as An exact match
      • Player - Player 5 (Yellow) types a chat message containing -spawns as An exact match
      • Player - Player 6 (Orange) types a chat message containing -spawns as An exact match
      • Player - Player 7 (Green) types a chat message containing -spawns as An exact match
      • Player - Player 8 (Pink) types a chat message containing -spawns as An exact match
      • Player - Player 9 (Gray) types a chat message containing -spawns as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing -spawns as An exact match
      • Player - Player 6 (Orange) types a chat message containing -spawns as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing -spawns as An exact match
      • Player - Player 12 (Brown) types a chat message containing -spawns as An exact match
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in (All players matching (((Matching player) controller) Equal to User))) Equal to 1
        • Then - Actions
          • Trigger - Turn on spawning <gen>
          • Trigger - Turn off (This trigger)
          • Skip remaining actions
        • Else - Actions
          • Game - Display to (All players) the text: (Color[(Player number of (Triggering player))] + ((Name of (Triggering player)) + |r is suggesting |c00FF8000spawns|r. If you agree type -ok, if you do not agree type -no. After no the vote will be reset!))
          • Trigger - Turn on checking <gen>
          • Trigger - Turn on calculating01 <gen>
          • Trigger - Turn on calculating02 <gen>
          • Trigger - Turn on calculating03 <gen>
          • Trigger - Turn on calculating04 <gen>
          • Trigger - Turn on calculating05 <gen>
          • Trigger - Turn on calculating06 <gen>
          • Trigger - Turn on calculating07 <gen>
          • Trigger - Turn on calculating08 <gen>
          • Trigger - Turn on calculating09 <gen>
          • Trigger - Turn on calculating10 <gen>
          • Trigger - Turn on calculating11 <gen>
          • Trigger - Turn on calculating12 <gen>
          • Trigger - Turn on no <gen>
          • Trigger - Turn off (This trigger)
 
Last edited:
Status
Not open for further replies.
Top