• 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] Terrain type check problem

Status
Not open for further replies.
Level 6
Joined
Apr 28, 2005
Messages
155
I know this thing probably leaks a lot, I'll look into that later.
Why does the terrain check fail in the first loop(Terrain type at TempPoint), but not in the others? The tiles are definitely Cityscape grass where they should be.
Attaching picture, the brill aura art is just for reference.

  • Destructible - Pick every destructible in (Playable map area) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Destructible-type of (Picked destructible)) Equal to ObstructionTypes[1]
              • (Destructible-type of (Picked destructible)) Equal to ObstructionTypes[2]
              • (Destructible-type of (Picked destructible)) Equal to ObstructionTypes[3]
        • Then - Actions
          • Destructible - Remove (Picked destructible)
        • Else - Actions
          • Do nothing
  • For each (Integer C) from 0 to 6, do (Actions)
    • Loop - Actions
      • Wait 0.10 seconds
      • For each (Integer D) from 0 to 6, do (Actions)
        • Loop - Actions
          • Set TempPoint = (Point((-2560.00 + (768.00 x (Real(C)))), (-2560.00 + (768.00 x (Real(D))))))
          • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Other\GeneralAuraTarget\GeneralAuraTarget.mdl
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Terrain type at TempPoint) Equal to Cityscape - Grass
                  • (Terrain type at TempPoint) Equal to Felwood - Rough Dirt
            • Then - Actions
              • Set BlockType[0] = (Random integer number between 0 and 43)
              • For each (Integer A) from 0 to 4, do (Actions)
                • Loop - Actions
                  • For each (Integer B) from 0 to 4, do (Actions)
                    • Loop - Actions
                      • Destructible - Create a ObstructionCurrent at (TempPoint offset by ((128.00 x (Real((Integer A)))), (128.00 x (Real((Integer B)))))) facing (90.00 x (Real((Random integer number between -1 and 1)))) with scale 0.70 and variation 1
            • Else - Actions
              • Game - Display to (All players) for 5.00 seconds the text: Terrain check failed...
  • Wait 0.10 seconds
  • For each (Integer C) from 0 to 5, do (Actions)
    • Loop - Actions
      • For each (Integer D) from 0 to 6, do (Actions)
        • Loop - Actions
          • Set TempPoint = (Point((-1920.00 + (768.00 x (Real(C)))), (-2304.00 + (768.00 x (Real(D))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempPoint) Equal to Cityscape - Grass
            • Then - Actions
              • Destructible - Create a ObstructionTypes[current_level] at (TempPoint offset by (0.00, -128.00)) facing (90.00 x (Real((Random integer number between -1 and 1)))) with scale 0.70 and variation 1
              • Destructible - Create a ObstructionTypes[current_level] at (TempPoint offset by (0.00, 128.00)) facing (90.00 x (Real((Random integer number between -1 and 1)))) with scale 0.70 and variation 1
            • Else - Actions
              • Do nothing
  • Wait 0.10 seconds
  • For each (Integer C) from 0 to 6, do (Actions)
    • Loop - Actions
      • For each (Integer D) from 0 to 5, do (Actions)
        • Loop - Actions
          • Set TempPoint = (Point((-2304.00 + (768.00 x (Real(C)))), (-1920.00 + (768.00 x (Real(D))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempPoint) Equal to Cityscape - Grass
            • Then - Actions
              • Destructible - Create a ObstructionTypes[current_level] at (TempPoint offset by (-128.00, 0.00)) facing (90.00 x (Real((Random integer number between -1 and 1)))) with scale 0.70 and variation 1
              • Destructible - Create a ObstructionTypes[current_level] at (TempPoint offset by (128.00, 0.00)) facing (90.00 x (Real((Random integer number between -1 and 1)))) with scale 0.70 and variation 1
            • Else - Actions
              • Do nothing
  • Wait 0.10 seconds
  • For each (Integer C) from 0 to 5, do (Actions)
    • Loop - Actions
      • For each (Integer D) from 0 to 5, do (Actions)
        • Loop - Actions
          • Set TempPoint = (Point((-1920.00 + (768.00 x (Real(C)))), (-1920.00 + (768.00 x (Real(D))))))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempPoint) Equal to Cityscape - Grass
            • Then - Actions
              • Destructible - Create a ObstructionTypes[current_level] at TempPoint facing (90.00 x (Real((Random integer number between -1 and 1)))) with scale 0.70 and variation 1
            • Else - Actions
              • Do nothing
 

Attachments

  • Wc3Scr1.jpg
    Wc3Scr1.jpg
    270.6 KB · Views: 132
Level 6
Joined
Apr 28, 2005
Messages
155
Have you tried replacing Integers A & B with custom integers?

Another thing I've noticed:
In your first loop, you create ObstructionCurrent, while in the others you create ObstructionTypes[CurrentLevel]. Is it being set?

I just now realized that a few of the loops is expected to get a "false", 5 to be precise, which is the number of messages I get in-game. The 4 corners with the grass trim, and one in the middle that the picture doesn't show.

The reason nothing was being created, is because I forgot that I disabled he action where ObstructionCurrent was being set, so you were on the right track there! Thank you for the help.

Such silly mistakes you can make sometimes :ugly:
 
Status
Not open for further replies.
Top