• 🏆 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!

[Trigger] Help with trigger (please? ^_^)

Status
Not open for further replies.
Level 3
Joined
Aug 17, 2008
Messages
45
EDIT: The problem is continued below in another post. Please also see this post.

Hello, I'm working with the two triggers below to set fogs in my game. There is a gradual fog change from area to area that is player specific and these triggers are supposed to change the fogs from night to day and visa versa.

I don't know exactly what is wrong but it is not even releasing the game messages I put at the top. Might it not be triggering because of something else in my map? Or is it because something is wrong in the trigger? Whatever the solution, please help.

Thank you very much, I will really appreciate any help and I will +rep.

|| Fade Into Night ||
  • Events
    • Game - The in-game time of day becomes Equal to 18.00
  • Conditions
  • Actions
    • Set LeakPlayerGroup = (All players)
    • Game - Display to LeakPlayerGroup the text: |cFF282870Night Fal...
    • Game - Display to LeakPlayerGroup the text: Be wary of the dark.
    • Player Group - Pick every player in LeakPlayerGroup and do (Actions)
      • Loop - Actions
        • Set SpecificPlayer = (Picked player)
        • Custom script: if GetLocalPlayer() == udg_SpecificPlayer then
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • PlayerIsInArea[(Player number of (Picked player))] Equal to 2
          • Then - Actions
            • Set ColorRed = 100.00
            • Set ColorGreen = 100.00
            • Set ColorBlue = 55.00
            • For each (Integer A) from 1 to 50, do (Actions)
              • Loop - Actions
                • Set ColorRed = (ColorRed - 1.00)
                • Set ColorGreen = (ColorGreen - 1.00)
                • Set ColorBlue = (ColorBlue + 0.10)
                • Environment - Set fog to style Linear, z-start 1200.00, z-end 2700.00, density 0.00 and color (ColorRed%, ColorGreen%, ColorBlue%)
                • Wait 0.02 seconds
            • Environment - Set fog to style Linear, z-start 1200.00, z-end 2700.00, density 0.00 and color (50.00%, 50.00%, 60.00%)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • PlayerIsInArea[(Player number of (Picked player))] Equal to 1
                • PlayerIsInArea[(Player number of (Picked player))] Equal to 3
          • Then - Actions
            • Set ColorRed = 10.00
            • Set ColorGreen = 35.00
            • For each (Integer A) from 1 to 50, do (Actions)
              • Loop - Actions
                • Set ColorRed = (ColorRed - 0.20)
                • Set ColorGreen = (ColorGreen - 0.40)
                • Environment - Set fog to style Linear, z-start 600.00, z-end 2100.00, density 0.00 and color (ColorRed%, ColorGreen%, 15.00%)
                • Wait 0.02 seconds
            • Environment - Set fog to style Linear, z-start 600.00, z-end 2100.00, density 0.00 and color (0.00%, 15.00%, 15.00%)
          • Else - Actions
        • Custom script: endif
    • Custom script: call DestroyForce(udg_LeakPlayerGroup)
|| Fade Into Day ||
  • Events
    • Game - The in-game time of day becomes Equal to 6.00
  • Conditions
  • Actions
    • Set LeakPlayerGroup = (All players)
    • Game - Display to LeakPlayerGroup the text: |cFFAEE0FFDay Rises...
    • Game - Display to LeakPlayerGroup the text: (Today is: + GameDateString)
    • Player Group - Pick every player in LeakPlayerGroup and do (Actions)
      • Loop - Actions
        • Set SpecificPlayer = (Picked player)
        • Custom script: if GetLocalPlayer() == udg_SpecificPlayer then
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • PlayerIsInArea[(Player number of (Picked player))] Equal to 2
          • Then - Actions
            • Set ColorRed = 50.00
            • Set ColorGreen = 50.00
            • Set ColorBlue = 60.00
            • For each (Integer A) from 1 to 50, do (Actions)
              • Loop - Actions
                • Set ColorRed = (ColorRed + 1.00)
                • Set ColorGreen = (ColorGreen + 1.00)
                • Set ColorBlue = (ColorBlue - 0.10)
                • Environment - Set fog to style Linear, z-start 1200.00, z-end 2700.00, density 0.00 and color (ColorRed%, ColorGreen%, ColorBlue%)
                • Wait 0.02 seconds
            • Environment - Set fog to style Linear, z-start 1200.00, z-end 2700.00, density 0.00 and color (100.00%, 100.00%, 55.00%)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Or - Any (Conditions) are true
              • Conditions
                • PlayerIsInArea[(Player number of (Picked player))] Equal to 1
                • PlayerIsInArea[(Player number of (Picked player))] Equal to 3
          • Then - Actions
            • Set ColorRed = 0.00
            • Set ColorGreen = 15.00
            • For each (Integer A) from 1 to 50, do (Actions)
              • Loop - Actions
                • Set ColorRed = (ColorRed + 0.20)
                • Set ColorGreen = (ColorGreen + 0.40)
                • Environment - Set fog to style Linear, z-start 600.00, z-end 2100.00, density 0.00 and color (ColorRed%, ColorGreen%, 15.00%)
                • Wait 0.02 seconds
            • Environment - Set fog to style Linear, z-start 600.00, z-end 2100.00, density 0.00 and color (10.00%, 35.00%, 15.00%)
          • Else - Actions
        • Custom script: endif
    • Custom script: call DestroyForce(udg_LeakPlayerGroup)
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
Is there an action that turns this trigger off?
If even the text messages do not display, the trigger isn't activated, so it has to be initially off, or there must be a trigger turning it off for some reason.
As far as I see, it should work perfectly, except the thing Cokemonkey11 has mentioned (which you should really change to make it change smoothly, though I advise using 0.03 sec ^^).

And, to be honest, I think it's a pretty good idea that will probably increase the beauty of the terrain ;) (if it would work).
 
Level 3
Joined
Aug 17, 2008
Messages
45
Ok, I have both triggers responding to a periodic time event, though I'm not entirely sure this is what you guys had in mind when you said that, if its not please explain. Trigger:
  • Events
    • Time - Every 480.00 seconds of game time
They're both initially off, and I use the following triggers to turn them on.
  • FirstNight
    • Events
      • Time - Elapsed game time is 120.00 seconds
    • Conditions
    • Actions
      • Trigger - Turn on FadeIntoNight <gen>
      • Trigger - Run FadeIntoNight <gen> (ignoring conditions)
  • FirstDay
    • Events
      • Time - Elapsed game time is 360.00 seconds
    • Conditions
    • Actions
      • Trigger - Turn on FadeIntoDay <gen>
      • Trigger - Run FadeIntoDay <gen> (ignoring conditions)
Unfortunately, they still seem to be non-functional. The FirstNight runs FadeIntoNight once and the Game Message is displayed, but the Fog does not change at all. The FadeIntoNight trigger does not trigger at any time later in the game. The FadeIntoDay trigger does not trigger at all, and the game message is not displayed, even after the FirstDay trigger is supposed to run.

Again, any and all help is appreciated.

EDIT: Oh, I also increased the iteration time to 0.3 seconds though I don't believe that'd cause a problem anyways.
 
Last edited:
Level 28
Joined
Jan 26, 2007
Messages
4,789
I have made this test-map and it worked for me.
I did not use multiple fogs, or multiple players, but only 1 global fog for 1 player, so the problem might be in one of those functions.

Well, here is the test-map, if you find anything that is different (and I hope you do), then you might have solved the problem.
If not, just base it on my trigger ^^

Sidenote:
I really like the color of the fogs you have used, I think it's really a great addition to make a nice map, good job... I never thought of this myself ;)
 

Attachments

  • Day-Night.w3x
    18.6 KB · Views: 95
Status
Not open for further replies.
Top