• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Trigger Leaks/Cinematic Skip

Status
Not open for further replies.
Level 5
Joined
Apr 17, 2017
Messages
46
So after reading both of the replays I remarked the trigger from zero based on the information. And yes, this is a single player map not a multiplayer, but I thank you for the additional information.

--------This is the cinematic setup--------

  • NewFirstCutsceneSetup
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set VariableSet Dalrend = Dal'rend Blackhand 0010 <gen>
      • Set VariableSet TempPoint1 = (Center of Orc First <gen>)
      • Set VariableSet TempPoint2 = (Center of Orcs Second <gen>)
      • Set VariableSet TempPoint3 = (Center of Rend First <gen>)
      • Set VariableSet UnitGroup = (Units in Orc First <gen> owned by Player 1 (Red))
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Animation - Add the cinematic animation tag to (Picked unit)
          • Unit - Set (Picked unit) movement speed to 100.00
          • Unit - Set Unit: (Picked unit)'s Real Field: Animation - Walk Speed ('uwal') to Value: 100.00
      • Unit - Set Dalrend movement speed to 100.00
      • Unit - Set Unit: Dalrend's Real Field: Animation - Walk Speed ('uwal') to Value: 100.00
      • Animation - Add the cinematic animation tag to Dalrend
      • -------- Time of day --------
      • Sound - Disable dawn and dusk sounds
      • Sound - Stop the currently playing music theme
      • Game - Set the time of day to 9.00
      • Game - Turn the day/night cycle Off
      • Environment - Set fog to style Linear, z-start 1000.00, z-end 3000.00, density 0.00 and color (100.00%, 100.00%, 100.00%)
      • Visibility - Enable black mask
      • Visibility - Enable fog of war
--------This is the cinematic--------

  • NewFirstCutscene
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Cinematic Mode ON --------
      • Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Turn cinematic mode On for (All players)
      • Wait 0.20 seconds
      • -------- Setup --------
      • Trigger - Run NewFirstCutsceneSetup <gen> (ignoring conditions)
      • Wait 0.20 seconds
      • -------- Ambience Sound --------
      • Sound - Play LordaeronSummerDay <gen>
      • Wait 1.00 seconds
      • -------- CINEMATIC BEGINS - Cinematic can be skipped after this point --------
      • Trigger - Turn on NewFirstCutsceneSkip <gen>
      • -------- First Shot --------
      • Wait 1.00 seconds
      • If (FirstCinematicSkip Equal to True) then do (Skip remaining actions) else do (Do nothing)
      • Cinematic - Fade in over 1.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Camera - Apply First Cutscene <gen> for Player 1 (Red) over 0.00 seconds
      • Unit Group - Pick every unit in UnitGroup and do (Unit - Order (Picked unit) to Move To TempPoint2)
      • Sound - Play march <gen>
      • Sound - Play Music <gen>
      • Game - Display to (All players) for 4.00 seconds the text: After 2 weeks of ma...
      • Wait 5.00 seconds
      • If (FirstCinematicSkip Equal to True) then do (Skip remaining actions) else do (Do nothing)
      • Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • -------- First Moved Units --------
      • Wait 0.10 seconds
      • If (FirstCinematicSkip Equal to True) then do (Skip remaining actions) else do (Do nothing)
      • Unit Group - Pick every unit in UnitGroup and do (Unit - Move (Picked unit) instantly to TempPoint2, facing TempPoint3)
      • Unit - Move Dalrend instantly to TempPoint3, facing TempPoint2
      • Wait 0.10 seconds
      • If (FirstCinematicSkip Equal to True) then do (Skip remaining actions) else do (Do nothing)
      • -------- Second Shot --------
      • Wait 0.10 seconds
      • If (FirstCinematicSkip Equal to True) then do (Skip remaining actions) else do (Do nothing)
      • Camera - Apply Senond Tape <gen> for Player 1 (Red) over 0.00 seconds
      • Cinematic - Fade in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Animation - Play Dalrend's Cinematic Standard Three animation
      • Game - Display to (All players) for 4.00 seconds the text: Dal'rend Blackhand ...
      • Wait 6.00 seconds
      • If (FirstCinematicSkip Equal to True) then do (Skip remaining actions) else do (Do nothing)
      • Game - Display to (All players) for 2.00 seconds the text: And with a mighty w...
      • Animation - Change Dalrend's animation speed to 50.00% of its original speed
      • Animation - Play Dalrend's Victory animation
      • Sound - Play Warcry <gen>
      • Animation - Queue Dalrend's stand animation
      • Wait 3.00 seconds
      • If (FirstCinematicSkip Equal to True) then do (Skip remaining actions) else do (Do nothing)
      • Wait 1.00 seconds
      • -------- Cinematic Mode OFF --------
      • Trigger - Turn off NewFirstCutsceneSkip <gen>
      • Wait 1.00 seconds
      • Cinematic - Fade out over 3.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait 3.00 seconds
      • Trigger - Run NewFirstCutsceneCleanupNotSkip <gen> (ignoring conditions)
--------This is the cinematic skip--------

  • NewFirstCutsceneSkip
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Set VariableSet FirstCinematicSkip = True
      • Trigger - Run NewFirstCutsceneCleanupSkip <gen> (checking conditions)
--------This is the cinematic skip cleanup--------

  • NewFirstCutsceneCleanupSkip
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Camera and orc move from cinematic --------
      • Wait 0.10 seconds
      • Cinematic - Fade out over 0.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Wait 0.10 seconds
      • Camera - Apply Senond Tape <gen> for Player 1 (Red) over 0.00 seconds
      • Wait 0.20 seconds
      • Unit Group - Pick every unit in UnitGroup and do (Unit - Move (Picked unit) instantly to TempPoint2, facing TempPoint3)
      • Unit - Move Dalrend instantly to TempPoint3, facing TempPoint2
      • Wait 0.10 seconds
      • -------- Orcs Normal Speed --------
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Animation - Remove the cinematic animation tag to (Picked unit)
          • Animation - Reset (Picked unit)'s body-part facing
          • Unit - Set (Picked unit) movement speed to 270.00
          • Unit - Set Unit: (Picked unit)'s Real Field: Animation - Walk Speed ('uwal') to Value: 270.00
      • -------- Rend movement speed And animation. --------
      • Unit - Set Dalrend movement speed to 270.00
      • Unit - Set Unit: Dalrend's Real Field: Animation - Walk Speed ('uwal') to Value: 270.00
      • Wait 0.10 seconds
      • Animation - Remove the cinematic animation tag to Dalrend
      • Animation - Reset Dalrend's body-part facing
      • Animation - Reset Dalrend's animation
      • Animation - Change Dalrend's animation speed to 100.00% of its original speed
      • -------- Remove Leaks --------
      • Wait 0.10 seconds
      • Custom script: call DestroyGroup (udg_UnitGroup)
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint3)
      • Wait 2.00 seconds
      • -------- Quests --------
      • Quest - Display to (All players) the Quest Update message: -Find a suitable lo...
      • Quest - Flash the quest dialog button
      • Quest - Mark Quest as Discovered
      • -------- Camera Reset --------
      • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
      • Cinematic - Fade in over 0.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Turn cinematic mode Off for (All players)
--------This is the cinematic normal cleanup no skiped--------

  • NewFirstCutsceneCleanupNotSkip
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • Wait 0.10 seconds
      • -------- Orcs Normal Speed --------
      • Unit Group - Pick every unit in UnitGroup and do (Actions)
        • Loop - Actions
          • Animation - Remove the cinematic animation tag to (Picked unit)
          • Animation - Reset (Picked unit)'s body-part facing
          • Unit - Set (Picked unit) movement speed to 270.00
          • Unit - Set Unit: (Picked unit)'s Real Field: Animation - Walk Speed ('uwal') to Value: 270.00
      • -------- Rend movement speed And animation. --------
      • Unit - Set Dalrend movement speed to 270.00
      • Unit - Set Unit: Dalrend's Real Field: Animation - Walk Speed ('uwal') to Value: 270.00
      • Wait 0.10 seconds
      • Animation - Remove the cinematic animation tag to Dalrend
      • Animation - Reset Dalrend's body-part facing
      • Animation - Reset Dalrend's animation
      • Animation - Change Dalrend's animation speed to 100.00% of its original speed
      • -------- Remove Leaks --------
      • Wait 0.10 seconds
      • Custom script: call DestroyGroup (udg_UnitGroup)
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint3)
      • Wait 2.00 seconds
      • -------- Quests --------
      • Quest - Display to (All players) the Quest Update message: -Find a suitable lo...
      • Quest - Flash the quest dialog button
      • Quest - Mark Quest as Discovered
      • -------- Camera Reset --------
      • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
      • Cinematic - Fade in over 0.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Turn cinematic mode Off for (All players)
Like you said I can use these temp1, temp2, temp3 and unit group many times, but to remove it after I'm done with them, this is what you meant?
 
Last edited:
Level 20
Joined
Feb 23, 2014
Messages
1,264
There are some mistakes, but overall it's not bad.

One request I have, please paste your triggers properly - right-click on its name (e.g. "FirstCutsceneEnd") in the same location as you can see for instance in Picture 2. Select "Copy as text" and paste it into your post in between these tags [trigger][/trigger].

This tutorial describes it nicely and has images! Link: How To Post Your Trigger

---

Okay, so - one consistent problem you have is that you create a point, do some action that uses it and then remove this point only to create another one, exactly the same as the one you removed, a couple lines later to do something else. There's no need. Having a point that you're using is NOT a leak - it becomes one if your point exists despite being no longer useful. The same goes for unit groups or any other thing that leaks.

For example, looking at your first trigger - you create and subsequently remove a point for Center of Rend Move <gen> three times. That's not necessary. If you're going to be using a point a couple of times, create it once (e.g. Set Variable TempPoint1 = Center of Rend Move <gen>), just before the first action that needs it, use the variable (e.g. TempPoint1) to refer to that point whenever you need to and then only remove it once it's no longer needed.

This goes for different triggers too, by the way - if you create that Center of Rend Move <gen> point in your main cinematic trigger, you can also use it in the one meant for skips. That's fine, just make sure that no matter if the cinematic plays out fully or is skipped, that point is always going to be properly created and removed :)

Other than that, in the "Start of cutscene" part of the first trigger, you're creating a unit group for Units in Orcs Move First <gen> and then you pick all units in it to do some animation/movement speed actions, which is fine, but then you remove this group, create an exact same one and pick the units again... Why not create the unit group and pick all units in it once? Also, the move order in this section is leaking a point.

---

That's it. I focused on leaks, because everything else should be easy to test.

Try fixing the things I've mentioned and post your triggers again, properly this time, so that I can take another look :)
 
Last edited:
Level 5
Joined
Apr 17, 2017
Messages
46
There are some mistakes, but overall it's not bad.

One request I have, please paste your triggers properly - right-click on its name (e.g. "FirstCutsceneEnd") in the same location as you can see for instance in Picture 2. Select "Copy as text" and paste it into your post in between these tags [trigger][/trigger].

This tutorial describes it nicely and has images! Link: How To Post Your Trigger

---

Okay, so - one consistent problem you have is that you create a point, do some action that uses it and then remove this point only to create another one, exactly the same as the one you removed, a couple lines later to do something else. There's no need. Having a point that you're using is NOT a leak - it becomes one if your point exists despite being no longer useful. The same goes for unit groups or any other thing that leaks.

For example, looking at your first trigger - you create and subsequently remove a point for Center of Rend Move <gen> three times. That's not necessary. If you're going to be using a point a couple of times, create it once (e.g. Set Variable TempPoint1 = Center of Rend Move <gen>), just before the first action that needs it, use the variable (e.g. TempPoint1) to refer to that point whenever you need to and then only remove it once it's no longer needed.

This goes for different triggers too, by the way - if you create that Center of Rend Move <gen> point in your main cinematic trigger, you can also use it in the one meant for skips. That's fine, just make sure that no matter if the cinematic plays out fully or is skipped, that point is always going to be properly created and removed :)

Other than that, in the "Start of cutscene" part of the first trigger, you're creating a unit group for Units in Orcs Move First <gen> and then you pick all units in it to do some animation/movement speed actions, which is fine, but then you remove this group, create an exact same one and pick the units again... Why not create the unit group and pick all units in it once? Also, the move order in this section is leaking a point.

---

That's it. I focused on leaks, because everything else should be easy to test.

Try fixing the things I've mentioned and post your triggers again, properly this time, so that I can take another look :)
I edited.. I'm sorry for the inconvenience. I think I didn't understand that great from other sources that I made the UnitGroup 2 times. I thought that if I make a unit group I must delete it after each unit group-action so that to prevent leaks.. That's why I make a point and unit group after each action. So I can have a temp1 point for like 5-6 action, then I can delete it and a unit group for like 6-7 action then removes the unit group?
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
So I can have a temp1 point for like 5-6 action, then I can delete it and a unit group for like 6-7 action then removes the unit group?
Yes, you can.

To help you understand it better - when you create a handle (e.g. point, unit group), it's stored in your PC's memory. By itself, this isn't a problem. A single hande occupies so little memory space that it's completely irrelevant - you could easily have hundreds or thousands of stored handles and the user wouldn't even notice it. But, I digress. What matters here is that storing data, such as handles, is a completely natural part of playing the game. As long as that data is needed, that's not an issue.

Now, what you don't want is to waste your memory on storing useless data, such as handles that you don't plan to use for anything. A special case is a situation where you create a handle, but you have no way to reference it and thus you're not able to access or remove it. In either scenario, that's a leak.

So... if you create a point and assign it to a temp1 variable then you clearly have a way to reference it. And if that point is used for something then the memory space it takes isn't wasted. Thus it is not a leak, but simply storing data that you need. And that's fine, hence my answer above.

The only thing to be mindful of here is that you don't accidentally lose reference to that stored handle by using the variable holding it for something else.

---

I trust you can improve the triggers you posted on your own, but if you want me to take another look after you do, feel free to post them again :)
 
Last edited:

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
Not removing the Points/Unit Groups can cause problems since there are Waits being used.

For example, let's say the game was multiplayer and one player could be in this cinematic while another was free to do other things. If TempPoint was used in multiple triggers, it could very easily get Set to something else during one of the Waits in the Cinematic, creating a leak AND breaking the cinematic.

Also, since the Player can Skip the cinematic, they could do so after a Point/Unit Group was Set, but before it was Removed, thus resulting in a Leak.

I would say for the sake of being safe you should remove your Unit Group/Points immediately after using them (like you were already doing). That is unless you're 100% sure that it's safe to use them between Waits, which would be the case if the Variables being used were unique to the trigger and the trigger could only have instance running at a time.
 
Last edited:
Level 20
Joined
Feb 23, 2014
Messages
1,264
let's say the game was multiplayer and one player could be in this cinematic while another was free to do other things
That's a good point. I haven't considered that it might be a multiplayer map, my mistake.

@Lloyd244 Uncle is more knowledgeable than me, so his opinion is most likely correct and you should follow his advice. I'm sorry for apparently giving you a wrong answer to your question and probably making you do some extra work! I hope you won't hold it against me and good luck with your map! :)

--- But for the sake of discussion (and perhaps learning something myself), I hope @Uncle won't mind me trying to justify my point of view in parts where I disagree with his opinion :) I'm probably signing myself up to be absolutely crushed, but heck - it's worth a try :)

Also, since the Player can Skip the cinematic, they could do so after a Point/Unit Group was Set, but before it was Removed, thus resulting in a Leak.
If we're talking about a singleplayer map, you can easily structure the triggers in a way that points/groups are removed regardless of the cinematic being skipped, can't you?

For instance, ff you call the remove functions both at the end of the main cinematic trigger and the skip trigger then there's no way that something won't be cleared. The only funky scenario you can run into is if the player skips the cinematic before a point/group is created and stored in a variable and thus the remove function at the end of the skip trigger will attempt to remove "no value", but that shouldn't break anything or be a problem, right?

if the Variables being used were unique to the trigger
They don't have to be "unique to the trigger", you just have to avoid using the same variable for something else that can occur at the same time. A good example would be having a set of dedicated temp points/groups variables just for cinematics. In a singleplayer map you don't want to have more than one cinematic running at the same time anyway, so these variables couldn't possibly have their values overwritten. In that case, you can use them for as many cinematic triggers as you want.

But, I admit that in my previous replies I haven't stressed and/or explained this enough, which - again - is my mistake.

--- Ultimately, I don't think what I said is wrong in the context of making a singleplayer map. Like, the concerns you pointed out are valid, but I feel they can be easily avoided. But then, maybe my desire to keep my triggers short isn't me trying to be smart, but just me being lazy :D
 
Last edited:

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
@MasterBlaster
I don't know about more knowledgeable, and your explanation was great, a lot of useful information in there.

There's so many small exceptions to the "triggering do's and donts" that you'd go crazy having to list all of them in a single post, and you'd probably scare away OP in the process who is just trying to get a simple answer to a simple question. But that's the nature of helping people on these forums, you often have zero clue about the map itself that OP's trigger comes from. I feel like with all of my answers over the years I've mislead people in some way, because triggering really does depend on a lot of things and those things are never brought up in the discussion.

Anyway, all of your points are valid. He could Remove the leaks after the Wait but before skipping the remaining actions, and the variables don't have to be unique to the trigger if you handle everything properly. I often mislead people in this way because I feel like telling them this will help them avoid leaks, even if it's technically not true and will bloat their list of Variables. It's also a lot easier to digest a single rule than saying "do this, UNLESS x, y, and z".

Sorry if my last post was rude or anything, I should've clarified that what you said was true and good practice. I just wanted to make sure that all of the bases were covered.
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
Sorry if my last post was rude or anything, I should've clarified that what you said was true and good practice, most of the time.
It was absolutely fine! Don't worry about it! I defended my point of view, because I like learning things and having a discussion is a great way to do so - that's all :)
 
Level 5
Joined
Apr 17, 2017
Messages
46
Yes, you can.

To help you understand it better - when you create a handle (e.g. point, unit group), it's stored in your PC's memory. By itself, this isn't a problem. A single hande occupies so little memory space that it's completely irrelevant - you could easily have hundreds or thousands of stored handles and the user wouldn't even notice it. But, I digress. What matters here is that storing data, such as handles, is a completely natural part of playing the game. As long as that data is needed, that's not an issue.

Now, what you don't want is to waste your memory on storing useless data, such as handles that you don't plan to use for anything. A special case is a situation where you create a handle, but you have no way to reference it and thus you're not able to access or remove it. In either scenario, that's a leak.

So... if you create a point and assign it to a temp1 variable then you clearly have a way to reference it. And if that point is used for something then the memory space it takes isn't wasted. Thus it is not a leak, but simply storing data that you need. And that's fine, hence my answer above.

The only thing to be mindful of here is that you don't accidentally lose reference to that stored handle by using the variable holding it for something else.

---

I trust you can improve the triggers you posted on your own, but if you want me to take another look after you do, feel free to post them again :)
Forgive me for taking so long to reply life and stuff kept me from working on the triggers and posting them, I have edited the post and copied the new trigger based on the information you talked about here. Or what I understood from it.
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
Do you use TempGroup and/or TempPoint1/2/3 in any other triggers? And if yes, can these other triggers go off during the cinematic?

For example, maybe you have a Periodic Trigger that spawns Monsters in the map, and maybe it uses TempPoint1 when spawning them. If this spawn trigger were to execute during the cinematic trigger then TempPoint1 would be Set/Removed, which could screw up the cinematic trigger since it uses TempPoint1. This is why it's risky to not clean these variables up between Waits.

You should be wary of this if you want everything to work properly. I explain in more detail in my first post.
 
Last edited:
Level 5
Joined
Apr 17, 2017
Messages
46
Do you use TempGroup and/or TempPoint1/2/3 in any other triggers? And if yes, can these other triggers go off during the cinematic?

For example, maybe you have a Periodic Trigger that spawns Monsters in the map, and maybe it uses TempPoint1 when spawning them. If this spawn trigger were to execute during the cinematic trigger then TempPoint1 would be Set/Removed, which could screw up the cinematic trigger since it uses TempPoint1. This is why it's risky to not clean these variables up between Waits.

You should be wary of this if you want everything to work properly. I explain in more detail in my first post.

No, I do not TempPoint1/2/3 and TempGroup to spawn units to attack or use them in other things I use them only for kinematics to issue a move order during the cinema, or to move them instantly. I use it in the way you say temp1/2/3 when I'm creating units for cinematic as well, I would go temp1, temp2 -create unit Grunt at temp1, Grunt looks at temp2. And then I will delete the points and create the same in a different location.

Like this. I use different points for spawning unit to attack a certain region. These TempPoints and TempGroup are used only in cinemas only.

  • Second Cinematic
    • Events
    • Conditions
    • Actions
      • Set VariableSet TempPoint1 = (Center of Orc Spawn 1 <gen>)
      • Set VariableSet TempPoint2 = (Center of Orc Look <gen>)
      • Unit - Create 1 Grunt for Player 1 (Red) at TempPoint1 facing TempPoint2
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Set VariableSet TempPoint1 = (Center of Orc Spawn 2 <gen>)
      • Unit - Create 1 Grunt for Player 1 (Red) at TempPoint1 facing TempPoint2
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Set VariableSet TempPoint1 = (Center of Orc Spawn 3 <gen>)
      • Unit - Create 1 Grunt for Player 1 (Red) at TempPoint1 facing TempPoint2
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Custom script: call RemoveLocation(udg_TempPoint2)
 
Level 20
Joined
Feb 23, 2014
Messages
1,264
Aye, that's what I meant :)

If you use these variables just for cinematics then you're most likely good :) You just don't want to run into a situation where, say, TempPoint1 stores some point for the cinematic, but while the cinematic is "waiting" something else happens that uses this variable, because that will cause bugs and leaks. My advice would be to rename your temp variables for cinematics to something like: "CinPoint" or "CinGroup" to avoid confusion and accidentally using them elsewhere.

As for your triggers, I took a quick glance at them and they look good. Kudos to you for trying to keep them well organized. There are some tiny quirks, like for instance - you end "First moved units" and start "Second shot" with a 0.1 sec wait, so you needlessly have two waits in a row, but that's just me being picky. I'd also probably prefer to condense all of this into two triggers, but if you're more comfortable having different things in different triggers than that's fine too.

Also, turning off a trigger prevents it from being run when the event happens, but doesn't stop it from being run by other triggers. In other words, if your trigger doesn't have an event (and you're not adding any later), you can start with it turned off or keep it turned on forever. It makes no difference.

---

WAIT, scratch that - there is a serious hole in your trigger:

  • If (FirstCinematicSkip Equal to True) then do (Skip remaining actions) else do (Do nothing)
  • Wait 1.00 seconds
  • -------- Cinematic Mode OFF --------
  • Trigger - Turn off NewFirstCutsceneSkip <gen>
If the player pressed ESC during the one second wait in the part above, it's still be possible to run the skip trigger because it's not yet turned off and have the cinematic trigger naturally progressing to running its own cleanup trigger regardless. Thus the cleanup trigger could be run twice. I'd recommend removing that wait.

---

The above is a great example to illustrate my next point which is that generally when it comes to waits - if you don't need to use them then don't. Like, for example:
  • Camera - Apply Senond Tape <gen> for Player 1 (Red) over 0.00 seconds
  • Wait 0.20 seconds
  • Unit Group - Pick every unit in UnitGroup and do (Unit - Move (Picked unit) instantly to TempPoint2, facing TempPoint3)
  • Unit - Move Dalrend instantly to TempPoint3, facing TempPoint2
  • Wait 0.10 seconds
  • -------- Orcs Normal Speed --------
  • Unit Group - Pick every unit in UnitGroup and do (Actions)
    • Loop - Actions
      • Animation - Remove the cinematic animation tag to (Picked unit)
      • Animation - Reset (Picked unit)'s body-part facing
      • Unit - Set (Picked unit) movement speed to 270.00
      • Unit - Set Unit: (Picked unit)'s Real Field: Animation - Walk Speed ('uwal') to Value: 270.00
  • -------- Rend movement speed And animation. --------
  • Unit - Set Dalrend movement speed to 270.00
  • Unit - Set Unit: Dalrend's Real Field: Animation - Walk Speed ('uwal') to Value: 270.00
  • Wait 0.10 seconds
  • Animation - Remove the cinematic animation tag to Dalrend
  • Animation - Reset Dalrend's body-part facing
  • Animation - Reset Dalrend's animation
  • Animation - Change Dalrend's animation speed to 100.00% of its original speed
  • -------- Remove Leaks --------
  • Wait 0.10 seconds
  • Custom script: call DestroyGroup (udg_UnitGroup)
  • Custom script: call RemoveLocation(udg_TempPoint1)
  • Custom script: call RemoveLocation(udg_TempPoint2)
  • Custom script: call RemoveLocation(udg_TempPoint3)
You could remove every single wait in this part and it wouldn't make a difference. If you're okay with two actions happening one after another then you don't need to separate them with waits. They're not going to get mixed up or cause lag or whatever. It's not a huge deal if you have some waits, but it's better not to.
 
Last edited:

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
@lloyd2422
If that's the case then you should be fine as long as you follow Master's advice.

One not so important thing. I would rename the Variables to something like "CinematicPoint1", "CinematicGroup", etc... instead of using "Temp". This way you'll know what they're for. Temp is usually reserved for Variables that you will reuse throughout all of your triggers. I know this isn't super important but it could save you a headache in the future.
 
Level 5
Joined
Apr 17, 2017
Messages
46
@Uncle @MasterBlaster

Thank you for the advices.. But one more question about the leak thing.. If I want to make a trigger in witch spawns units.. Like Unit-Create>Temp1 and loops that indefinitely every 120 seconds is that okay? Like it causes a leak, but since I need that trigger and that region I can't custom trigger destroy it..
 

Uncle

Warcraft Moderator
Level 63
Joined
Aug 10, 2018
Messages
6,456
The only cause of a leak is if you can't remove the variable (point, unit group, whatever) anymore. If you can still remove something then it's not a leak.

Anyway, you can use a permanent Point variable and set it to the center of your region and spawn units there. But you can't use the Temp variables because you're using them in the Cinematic triggers (UNLESS you do what I said about removing them before the Waits).
 
Status
Not open for further replies.
Top