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

[General] Simple questions about triggers and regions, cinematics etc.

Status
Not open for further replies.
Level 1
Joined
Dec 12, 2016
Messages
4
Hello fellow map makers,

1. I'm making a map in which I need to detect if all the units from Blue team are dead in one specific region. If that's true, an action should trigger, but I don't know how to make the script. (the trigger is to add an ability to all units from a certain unit-type, which I also don't know how to make)

2. Another thing, in the map I'm making you're sieging a castle, and I have this movable wall, behind which the catapults should stay (yeah, stupid but w/e). I want to make it so the enemy archers only focus the wall, and not the catapults (they attack the catapults only atm, unless they're out of range). Also, how can I make the wall not able to get passed through by units?

3. Can I use the pitch black fog that is used in single player campaign missions? If yes, how?

4. In a certain cinematic, I have a hero and a captain discussing something. But since its just after a big fight in which the captain can die, when the cutscene triggers (which orders the captain and the hero to go to a certain point noninstantly) and the captain is dead, he just doesn't go there and doesn't talk or if its an instant movement, his corpse gets teleported there. Is there a way to set it so that no matter if the captain dies or not, he is alive in the cutscene?

5. I want to spawn units in a region using a trigger, but I want them to say dialogue after they're spawned. But since I can't just select an exact unit in the editor (as they get spawned after the trigger runs), I don't know how to make them talk.

6. I want to make a Castle doodad, but since you can't set animation tags in doodads, you need to make a dummy unit with the Castle model. Problem is, that if you don't have direct vision of the dummy unit it disappears, so in my example, the castle also disappears. Any way to keep the dummy unit visible forever?

7. Last question, in cinematics, there's this annoying black fog in the background (example provided as an uploaded file). Is there a way to remove it?

Sorry for the long post, but I just want to get all the questions out there.
 

Attachments

  • dgh.png
    dgh.png
    2.6 MB · Views: 48
Level 45
Joined
Feb 27, 2007
Messages
5,578
1. When a unit dies, pick all units in the region owned by blue team (is that multiple players, or just player 2 blue?) and count them. If there are 0 units then they've all died and you can do what you need to do. Generally speaking "Unit Group - Pick" is your friend for doing things to mass numbers of units at once.

2. Each unit has a priority value in the OE that determines if units try to attack it or something else 'more valuable' nearby. You can set the walls to a high priority and the catapults to a low # and that should direct them to attack the wall first if it hasn't been broken yet.

3. You mean Fog of War in undiscovered areas? You can apply an arbitrary mask to the game screen for 1/more players with one of the Environment commands.

4. Check if the captain is dead (<Captain unit> is alive equal to false), and if so just make a new one in his place for the cinematic. Remove the unit after. Or you can catch when the captain dies with an event and then revive, pause, and hide him. Just unhide before the cinematic.

5. Last Created Unit is your friend. And probably some unit variables too.

6. Without creating vision in the area? not that I know of. Maybe with a destructible you can set the animation tag?

7. Hold Ctrl and scroll and you can change where that black fog starts. It's just an Editor thing so it doesn't draw too much on the screen for shitty computers. You can set the environmental fog to start at 9999 and end at 10000 in one of the map settings menus.
 
Level 1
Joined
Dec 12, 2016
Messages
4
Thanks for the answer dude, but there are still a few things that i need to clear out

1. I'm a newbie, sorry, so could you please send me a tutorial on how to do that, or maybe you could explain it here?

2. The priority value you're talking about only affects the priority in which the unit is picked in the unit frames in the middle bottom of the screen (ill attach an example)

3. Could you tell me which Environment command specifically?

5. I've made a Last Created Unit trigger and it works fine, but I don't understand what variables are. How could I make them help me make better cinematics?

6. Sadly, as far as I know, you can't set animation tags on destructibles, so I guess I'm stuck with dummy units. How about me setting vision to 0 on the unit and adding it in my team? Would that work?

The rest of the advice worked very nicely, for which I'm very thankful.
 

Attachments

  • asdasd.png
    asdasd.png
    4.3 MB · Views: 59
Level 14
Joined
Nov 30, 2013
Messages
926
1. This trigger below.
  • Test
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
    • Conditions
      • (All units of (Units in <Region> Owned by (Player 2)) are dead) Equal to True
    • Actions
      • -------- Actions Here! --------
3. One of the Map Options in Scenario -> Map Options -> "Masked areas are partially visible" Checkbox.

7. You have to use this action during the cinematic
  • Actions
    • -------- Before Cinematic --------
    • Cinematic - Turn cinematic mode On for (All players)
    • -------- After Cinematic --------
    • Cinematic - Turn cinematic mode Off for (All players)
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
1. Well, Pyrogasm told you everything you need to do. I would do it like this:

  • Check units
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
    • Conditions
    • Actions
      • -------- The variable below will count how many alive units are in your region --------
      • -------- For now, we just tell the game to set it to 0 --------
      • Set Integer = 0
      • -------- The next one makes sure that the unit group be destroyed and removed from the memory ram when it's done checking the units in the area --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in YourRegion <gen> owned by Player 2 (Blue)) and do (Actions)
        • Loop - Actions
          • -------- Check if unit is alive; we don't want to count dead units. --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is dead) Equal to False
            • Then - Actions
              • -------- Unit Group has spotted an alive unit that belongs to player 2. So, we add 1 to the variable "Integer". --------
              • Set Integer = (Integer + 1)
            • Else - Actions
      • -------- Now that our Unit Group is done checking units in that region, we will use our Integer variable and see how many alive units we've got. --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer Equal to 0
        • Then - Actions
          • -------- It looks like the Integer variable hasn't been modified, which means there's no alive units in that region at the moment --------
          • -------- This is what you want; do your actions here --------
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units owned by Player 2 (Blue) of type UNIT_TYPE_THAT_WILL_RECEIVE_THE_ABILITY) and do (Actions)
            • Loop - Actions
              • Unit - Add ABILITY to (Picked unit)
        • Else - Actions
          • -------- Integer is storing another value other than 0. There is, at least, one unit alive --------

5. Variables keep/store information that we need for a later use. As you can see in the example above, I used the Integer variable to store the number of units in a certain area, then later I needed to know how many units I have in that area.

Another example would be: You create two units at once in the middle of a cinematic, and, a few moments later, you wish to add some effects to the first unit and also make it teleport or hide. Well, this time you can't simply use "Last Created Unit" because the second one is now stored in it. You have to create a new unit variable and tell it to store the first unit the moment you've created it.

  • Cinematic Scene 1
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Peasant for...
      • Set FirstUnit = (Last created unit)
      • Wait 0.50 seconds
      • Unit - Create 1 Footman for...
      • Wait 1.50 seconds
      • -------- I can't use Last Created Unit to create a new effect and attach it to the Peasant. That would attach the effect to the footman --------
      • Special Effect - Create a special effect attached to the overhead of FirstUnit using Abilities\Spells\Other\TalkToMe\TalkToMe.mdl
      • Set SpecialEffect = (Last created special effect)
      • Wait 0.30 seconds
      • Unit - Move FirstUnit instantly to somewhere
      • -------- Add an explosive effect under the footman --------
      • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Other\Incinerate\FireLordDeathExplode.mdl
      • Special Effect - Destroy (Last created special effect)
      • -------- Kill footman --------
      • Unit - Kill (Last created unit)
      • Wait 0.30 seconds
      • -------- I did the same thing for the special effects. I want to destroy the first one now, but Last created special effect variable will tell me that it's pointing to the second one. --------
      • Special Effect - Destroy SpecialEffect

6. I don't know if I misunderstood you or something, but I had created a Castle as a doodad and added the animation to it normally.
VSYHAcl.jpg

  • Castle Animation
    • Events
      • Time - Elapsed game time is 0.50 seconds
    • Conditions
    • Actions
      • Animation - Play the stand work upgrade second animation for all doodads of type Castle within Castle <gen>
The animation loops normally.
 
Last edited:
Level 45
Joined
Feb 27, 2007
Messages
5,578
Thanks for the answer dude, but there are still a few things that i need to clear out

1. I'm a newbie, sorry, so could you please send me a tutorial on how to do that, or maybe you could explain it here?

2. The priority value you're talking about only affects the priority in which the unit is picked in the unit frames in the middle bottom of the screen (ill attach an example)

3. Could you tell me which Environment command specifically?

5. I've made a Last Created Unit trigger and it works fine, but I don't understand what variables are. How could I make them help me make better cinematics?

6. Sadly, as far as I know, you can't set animation tags on destructibles, so I guess I'm stuck with dummy units. How about me setting vision to 0 on the unit and adding it in my team? Would that work?

The rest of the advice worked very nicely, for which I'm very thankful.


2. My bad, I thought it worked for unit acquisition too. I swear there's a setting for that in the editor. You could try making the walls hero units and the catapults basic units because I know heroes have increased combat priority.

3. I meant Cinematic - Advanced Filter or pretty much anything under Visibility, depending on what it is you actually want to do (I'm still unclear on that-- maybe show with a screenshot?)

6. BloodSoul showed how to play a desctructable's animation manually, but otherwise yes. 1 or 0 vision range and the "locust" ability will probably provide vision of the castle to players allied with it. Perhaps it should be owned by neutral passive.
 
Level 1
Joined
Dec 12, 2016
Messages
4
Hello all

Thanks for the responses, they were all very helpful.

Another quick question, I want to remove all units from a certain region, any idea how to do that?
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
If you want to try to do something, I suggest typing a couple keywords into the "search for text" box in the add new event/condition/action window and you will usually see the line that you need to use.

In this case
Unit Group - Pick units in region
Unit - Remove
 
Status
Not open for further replies.
Top