• 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] Race Combinations and Triggers

Status
Not open for further replies.
Level 2
Joined
Jul 29, 2004
Messages
12
Well I'm not really new but it's been a LONG LONG time. I have been injured and am stuck at my computer so I re-installed War3 and have been trying to remember how to do things in WE.

It's all slowly coming back to me like Han Solo's eyesight but I digress. I am pretty well versed with Triggers, variables and arrays and from what I remember (and from my development notes) I think I know what I need but just posting to see if there is an easier way to do it.

I want to have triggers search and see which Computer controlled players are which race and then assign certain custom upgrades accordingly depending on who is what at certain times during the game. Problem for me is deciding on how to have the trigger set to assign the appropriate upgrades to EACH player of the SAME race. So for instance if I start a 8 -plyr game and have lets say 4 (out of 7 computer) Orc players. Do I need to have
"For integer A 1-4" Do Actions If Integer A = 2 and Computer player = Orc kinda of setup

OR

Do I need to, say, make an array for each player slot or group then run conditions for each slot/group (Player is a computer player, Matching player is equal to Orc etc.)

This has been running around in my head for a couple days now (I'm slow, forgive me) but please chime in and let me know what you all would do.

Thanks in advance for any help.
 
Level 2
Joined
Jul 29, 2004
Messages
12
Yeah....I was worried about being vague.

Firstly (and a minor point) I know I can use the editor and have but the crux of the question is how can I using triggers have the Game essentially distinguish which Race the Computer is and then if there are 4 Comp Orc players assign an individual name and different abilities to EACH of the 4 different players AFTer the game has initialized.

Sorry for the confusion but thanks for the quick response.
 
Well, you can make it like this:
  • Upgrades Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Orc Upgrades --------
      • Set UpgradesUsed[1] = Burning Oil
      • Set UpgradesUsed[2] = Berserker Upgrade
      • Set UpgradesUsed[3] = Pillage
      • -------- Undead Upgrades --------
      • Set UpgradesUsed[4] = Stone Form
      • Set UpgradesUsed[5] = Creature Carapace
      • Set UpgradesUsed[6] = Disease Cloud
      • -------- Races --------
      • Set Races[1] = Orc
      • Set Races[2] = Undead
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • Player - Set the max research level of UpgradesUsed[(Integer A)] to 0 for Player 1 (Red)
This trigger is used for setting up the races and the upgrades each race will have disabled.
As an example, I tested it with the Orc race (and the Undead afterwards, to make sure that it works). As you can see, setting the max research level to 0 will disable the specified tech-type.
"UpgradesUsed[]" is a Tech-type variable; "Races[]" is a Race variable.

  • Upgrades
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to User
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • For each (Integer C) from 1 to 2, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Race of (Player((Integer A)))) Equal to Races[C]
                    • Then - Actions
                      • For each (Integer B) from C to (C x 3), do (Actions)
                        • Loop - Actions
                          • Player - Set the max research level of UpgradesUsed[(Integer B)] to 2 for (Player((Integer A)))
                    • Else - Actions
            • Else - Actions
The trigger above will detect the race of the player and enable the respective -for each race- upgrades.

In case you don't remember how to create these trigger samples, here is a test map:
View attachment Upgrades Test.w3x

NOTE: As a maximum upgrade level I used "2" (testing purposes, since Spiked Carapace has 3 upgrades). Use "3" or more, in case you have more than 2 levels in your upgrades.
 
Level 2
Joined
Jul 29, 2004
Messages
12
Thanks a heap, Pharaoh....

I was thinking I would either have to make triggers for each player (i.e. If P2 is Orc then run Trigger X, if P2 is Human then run Trigger Y etc.) OR run for each Player (integer A) equal to Computer and is equal to Orc then run Trigger X (separate trigger named Orc Upgrades or something like that).

Thanks for aligning my thoughts.

Question. Slightly not understanding the from Integer B to Integer Cx3 portion of the triggers. Please explain.

That is signifying the Upgradesused array correct?

Thanks for the the map and time.
 
Level 2
Joined
Jul 29, 2004
Messages
12
Thinking about this further.....

Scenario: There are 3 Orc and 2 Human Comp players that will need to be named and have distinct upgrades set for each.

Do I go about it like this:
attachment.php


OR

Should the next player should be Integer B
 

Attachments

  • Trigger1.jpg
    Trigger1.jpg
    76.9 KB · Views: 173
Level 2
Joined
Jul 29, 2004
Messages
12
Ok.

So here is the initial MI Setup
attachment.php

then........

How is this?
attachment.php


Thanks for the quick responses.

I had Integer 2-8 because I was trying to cover the other 7 potential computer players but I see my error. I don't remember but the integer A function will cycle through all numbers correct?

In any case, I am also still curious about Pharoah's usage of the Int B to Int C (Cx3) function in his example triggers.

Thanks for the quick replies, time and help fellas.....
 

Attachments

  • Triggers2.jpg
    Triggers2.jpg
    42.7 KB · Views: 104
  • MI Triggers.jpg
    MI Triggers.jpg
    57 KB · Views: 187
  • Triggers3.jpg
    Triggers3.jpg
    46.6 KB · Views: 172
Level 2
Joined
Jul 29, 2004
Messages
12
Ohh....

So maybe that is why my Map started crashing.

Thanks for the catch. I'll do more testing tomm.
 
Well, to answer your question about From C to C x 3, I have set the variables as follows:
  • -------- Orc Upgrades --------
  • Set UpgradesUsed[1] = Burning Oil
  • Set UpgradesUsed[2] = Berserker Upgrade
  • Set UpgradesUsed[3] = Pillage
  • -------- Undead Upgrades --------
  • Set UpgradesUsed[4] = Stone Form
  • Set UpgradesUsed[5] = Creature Carapace
  • Set UpgradesUsed[6] = Disease Cloud
The races, on the other hand are as follows:
  • -------- Races --------
    • Set Races[1] = Orc
    • Set Races[2] = Undead
As you can see, upgrades from 1 to 3 are Orcish, while upgrades from 4 to 6 are Undead's.
So, we detect the race as
  • For each (Integer C) from 1 to 2, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Race of (Player((Integer A)))) Equal to Races[C]
So, if the race of Player(IntegerA) is Orc, the Integer C will return 1.
If the race of Player(IntegerA) is Undead, the Integer C will return 2.

Let's say that the race of Player(IntegerA) is Orc.
We have set the upgrades for Orcs from 1 to 3.
Since Orc index is 1 (Races[] variable) and the upgrades start from 1 to 3, this means that the upgrades are C to C x 3, which, by extension means C x 1, C x 2, C x 3, which will return 1, 2, 3 respectively, since C = 1.
 
Level 2
Joined
Jul 29, 2004
Messages
12
Thanks alot for the explanation....

A couple of F/U ??? for my understanding (remember I'm slow)

1) When making the C=1 Variable could you not just do the 1 to 3 function instead or will it not go through each upgrade in succession

2) When you create an integer variable and leave it's value @ 0, it can still be used in the integer loop function (i.e. If I wanted say integer M, left it at value zero and then placed it in the action trigger "For each integer M from x to y...." or would I have to assign it's value to 1 (or some other number depending on what i wanted)


Thanks again for the examples and quick responses.
 
Status
Not open for further replies.
Top