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

[Solved] Faction Conditions

Status
Not open for further replies.
Level 1
Joined
Feb 9, 2017
Messages
5
Hey, so I'm having some issues with Triggers and I'm hopeful you guys can give me a direction to look at the very least.

So what I'm trying to do is make a scenario in which one player is randomly chosen at the start to gain extra units and power and the other players have to work together to defeat him.

I've gotten as far as making a Trigger that picks the "Overlord" as I'm calling it, but I'm not sure how to proceed. You see, in addition to wanting him to get extra power, I want to make it faction specific, so Orcs and Humans get different bonuses. My primary thought, as listed in the title of this thread would be some sort of condition based thing (If picked player is [Example_Faction] then turn on all triggers in [Example_Faction_Trigger_Folder]) which would sound doable but I'm not sure where or how to set up actions like that. Any ideas?

Thanks in advance.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
Any ideas?
There is no concept of "trigger folder" in JASS, the language GUI compiles to on save.

In JASS...
JASS:
constant native GetPlayerRace takes player whichPlayer returns race
JASS:
local player p = ...
local race prace = GetPlayerRace(p)
if prace == RACE_HUMAN then
    // human stuff
elseif prace == RACE_ORC then
    // orc stuff
endif

in GUI...
  • Example
    • Events
    • Conditions
    • Actions
      • Set p = (Random player from (All players))
      • Set race = (Race of p)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • race Equal to Human
        • Then - Actions
          • -------- human stuff --------
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • race Equal to Orc
        • Then - Actions
          • -------- orc stuff --------
        • Else - Actions
One could nest the ifs for better efficiency at the cost of nearly all readability.
 
Level 1
Joined
Feb 9, 2017
Messages
5
That looks good in theory, would there be a way to make it work for all four standard races in GUI?
 
Level 1
Joined
Feb 9, 2017
Messages
5
Finally got back to work on it, I'll make sure to let you know if it works out. Thanks for the help.
 
Status
Not open for further replies.
Top