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

Blight Mode

Level 16
Joined
May 25, 2004
Messages
1,207
My son recently purchased a new laptop and installed his old Warcraft 3, and started playing with maps again.

He recently asked me how to create a map trigger that works based off player race.

He wanted to create a map that triggers undead blight across the entire map only if/when all the players are playing as Undead. He asked me and I simply thought it was simple, but I'm having trouble remembering how to make Classic Trigger that does this.
(he doesn't use Jass yet, he wants to make it using Classic Triggers)
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
  • Events
    • Time - Elapsed Game-time is 0.10 seconds
  • Conditions
  • Actions
    • Set IntVar = 0
    • Player Group - Pick every player in (All Players) and do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Then actions) else do (Else actions)
          • If - Conditions
            • ((Picked Player) slot status) Equal to Is playing
            • (Race of (Picked Player)) Not Equal to Undead
            • ((Picked Player) controller) Equal to User //this line is optional; keeping it means that Computer players don't have to be UD for this blight to exist (just human players)
          • Then - Actions
            • -------- we only care if any of the players in the game aren't undead, so if any are found that aren't UD this process should just stop, but otherwise it can continue --------
            • Set IntVar = (IntVar + 1)
          • Else - Actions
    • If (All conditions are true) then do (Then actions) else do (Else actions)
      • If - Conditions
        • IntVar equal to 0
      • Then - Actions
        • -------- getting here means everyone playing is UD --------
        • Environment - Create Blight for Neutral Hostile across (Entire map)
      • Else - Actions
Using the Neutral Hostile player to create the blight means that the blight will not respect player buildings (normally it leaves a circle around any non-ud buildings of players allied to the player that was given the blight). NH will make blight go everywhere, and NV/NE/NP don't. The use of Entire Map is questionable here since that is technically a region leak unlike Playable Map Area, but I thought it was more important to also affect the areas around the edge of the map players could still see but not get to.
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
My son recently purchased a new laptop and installed his old Warcraft 3, and started playing with maps again.

He recently asked me how to create a map trigger that works based off player race.

He wanted to create a map that triggers undead blight across the entire map only if/when all the players are playing as Undead. He asked me and I simply thought it was simple, but I'm having trouble remembering how to make Classic Trigger that does this.
(he doesn't use Jass yet, he wants to make it using Classic Triggers)
Damn, Pyro beat me to the punch...

I'll post the map I made anyway, it's basically the same as his approach and should yield a similar result. At the very least it can help you get started with implementing Pyro's design.

@Pyrogasm
I don't think you want to check Player Status during map init, could be BS but apparently it's a potential desync.
 

Attachments

  • Blight Triggers 1.w3m
    17.2 KB · Views: 6
Level 28
Joined
Dec 3, 2020
Messages
973
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Player Group - Pick every player in (All Players) and do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Then actions) else do (Else actions)
          • If - Conditions
            • ((Picked Player) slot status) Equal to Is playing
            • (Race of (Picked Player)) Not Equal to Undead
            • ((Picked Player) controller) Equal to User //this line is optional; keeping it means that Computer players don't have to be UD for this blight to exist (just human players)
          • Then - Actions
            • -------- we only care if any of the players in the game aren't undead, so if any are found that aren't UD this process should just stop, but otherwise it can continue --------
            • Skip Remaining Actions
          • Else - Actions
    • -------- getting here means everyone playing is UD --------
    • Environment - Create Blight for Neutral Hostile across (Entire map)
Using the Neutral Hostile player to create the blight means that the blight will not respect player buildings (normally it leaves a circle around any non-ud buildings of players allied to the player that was given the blight). NH will make blight go everywhere, and NV/NE/NP don't. The use of Entire Map is questionable here since that is technically a region leak unlike Playable Map Area, but I thought it was more important to also affect the areas around the edge of the map players could still see but not get to.
Shouldn't it be EQUAL to undead instead of NOT equal to undead?
 
Level 16
Joined
May 25, 2004
Messages
1,207
  • Events
    • Time - Elapsed Game-time is 0.10 seconds
  • Conditions
  • Actions
    • Player Group - Pick every player in (All Players) and do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Then actions) else do (Else actions)
          • If - Conditions
            • ((Picked Player) slot status) Equal to Is playing
            • (Race of (Picked Player)) Not Equal to Undead
            • ((Picked Player) controller) Equal to User //this line is optional; keeping it means that Computer players don't have to be UD for this blight to exist (just human players)
          • Then - Actions
            • -------- we only care if any of the players in the game aren't undead, so if any are found that aren't UD this process should just stop, but otherwise it can continue --------
            • Skip Remaining Actions
          • Else - Actions
    • -------- getting here means everyone playing is UD --------
    • Environment - Create Blight for Neutral Hostile across (Entire map)
Using the Neutral Hostile player to create the blight means that the blight will not respect player buildings (normally it leaves a circle around any non-ud buildings of players allied to the player that was given the blight). NH will make blight go everywhere, and NV/NE/NP don't. The use of Entire Map is questionable here since that is technically a region leak unlike Playable Map Area, but I thought it was more important to also affect the areas around the edge of the map players could still see but not get to.
For some strange reason this does it if anyone is UD, so even if only one person chooses UD, the entire map changes.
  • Blight Mode
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
              • (Race of (Picked player)) Equal to Undead
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
      • Environment - Create Blight for Neutral Hostile across (Entire map)
      • Environment - Change water tinting color to (0.00%, 100.00%, 0.00%) with 0.00% transparency
 
Level 28
Joined
Dec 3, 2020
Messages
973
For some strange reason this does it if anyone is UD, so even if only one person chooses UD, the entire map changes.
  • Blight Mode
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
              • (Race of (Picked player)) Equal to Undead
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
      • Environment - Create Blight for Neutral Hostile across (Entire map)
      • Environment - Change water tinting color to (0.00%, 100.00%, 0.00%) with 0.00% transparency
Worst case scenario just check for each player individually.
 
Level 16
Joined
May 25, 2004
Messages
1,207
@JCarrill0 the condition in Pyro's trigger is "(Race of (Picked player)) Not Equal to Undead"
Thank you, I did correct that, however... same thing happened.

When testing the map, the trees and Blight is everywhere while I was Human, and my opponent was Undead.

Worst case scenario just check for each player individually.
I thought about this, but his map is 6 players. Won't that means all 6 players have to be playing and all 6 players must be UD?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Thank you, I did correct that, however... same thing happened.
You should post your "fixed" trigger so we can be sure that you did it correctly.

Anyway, here's the solution I suggested earlier:
  • All Undead Blight
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Assume every player is Undead: --------
      • Set VariableSet All_Players_Are_Undead = True
      • -------- --------
      • -------- Then check to see the races of each Player. If we find any NON-Undead players then this assumption is FALSE! --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Picked player)) Not equal to Undead
            • Then - Actions
              • Set VariableSet All_Players_Are_Undead = False
            • Else - Actions
      • -------- --------
      • -------- If all players are Undead then proceed to create Blight across the map: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • All_Players_Are_Undead Equal to True
        • Then - Actions
          • Player Group - Pick every player in (All players) and do (Actions)
            • Loop - Actions
              • Environment - Create Blight for (Picked player) across (Playable map area)
        • Else - Actions
You can add/replace stuff as needed. Here's how it would look accounting for some of what Pyro suggested:
  • All Undead Blight
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Assume every player is Undead: --------
      • Set VariableSet All_Players_Are_Undead = True
      • -------- --------
      • -------- Then check to see the races of each Player. If we find any NON-Undead players then this assumption is FALSE! --------
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Race of (Picked player)) Not equal to Undead
              • ((Picked Player) slot status) Equal to Is playing
            • Then - Actions
              • Set VariableSet All_Players_Are_Undead = False
            • Else - Actions
      • -------- --------
      • -------- If all players are Undead then proceed to create Blight across the map: --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • All_Players_Are_Undead Equal to True
        • Then - Actions
          • Environment - Create Blight for (Neutral Hostile) across (Entire map)
 
Level 24
Joined
Feb 27, 2019
Messages
833
Could it be that using return within a ForForce only returns from the ForForce? Anyway Uncles trigger fixes this potential issue.
JASS:
function Trig_Untitled_Trigger_002_Func001Func001C takes nothing returns boolean
    return true
endfunction

function Trig_Untitled_Trigger_002_Func001A takes nothing returns nothing
    if ( Trig_Untitled_Trigger_002_Func001Func001C() ) then
    else
        return
    endif
endfunction

function Trig_Untitled_Trigger_002_Actions takes nothing returns nothing
    call ForForce( GetPlayersAll(), function Trig_Untitled_Trigger_002_Func001A )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_002 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_002 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Untitled_Trigger_002, function Trig_Untitled_Trigger_002_Actions )
endfunction
 
Top