• 🏆 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] Terrain type condition

Status
Not open for further replies.
Level 5
Joined
Jul 19, 2019
Messages
72
Hi.

I need help with a trigger I can't get it working.

  • prevent temple build
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Constructing structure)) Equal to Temple
    • Actions
      • Set C_Loc = (Position of (Constructing structure))
      • Set C_Type = (Terrain type at C_Loc)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • C_Type Not equal to Barrens - Desert
        • Then - Actions
          • Unit - Explode (Constructing structure)
          • Game - Display to (Player group((Owner of (Triggering unit)))) for 3.00 seconds the text: |c00ff0000You can't...
          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
        • Else - Actions
      • Custom script: call RemoveLocation ( udg_C_Loc )
I want a structure to be built only on certain terrain type.
The above trigger works, but it works so well, its not allowing the structure
to be build anywhere. I don't know if the terrain type condition is not working
or if I am doing something wrong.

I am using a custom tileset "Ashenvale" but I am using other terrain from other tilesets,
specifically "Barrens - Desert". Is it not working for custom tilesets?
 
Why not just specify which terrain types you don't want your structure to be built? Like this?

  • Melee Initialization
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Barracks
    • Actions
      • Set C_Loc = (Position of (Triggering unit))
      • Set C_Terrain = (Terrain type at C_Loc)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • C_Terrain Equal to Lordaeron Summer - Grassy Dirt
              • C_Terrain Equal to Lordaeron Summer - Grass
        • Then - Actions
          • Unit - Explode (Triggering unit)
          • Game - Display to (All players) the text: Cant build here
          • Player - Add 100 to (Owner of (Triggering unit)) Current gold
        • Else - Actions
      • Custom script: call RemoveLocation(udg_C_Loc)
This should'nt allow the structure to be built in Grassy Dirt and Grass, only other tiles apart from these two.
 

Attachments

  • testmap.w3x
    18.4 KB · Views: 12
Level 5
Joined
Jul 19, 2019
Messages
72
Thanks for response. I tried the same trigger on an empty map,
and it worked. So I think it doesn't work for custom tilesets
only default ones.

I did try it like you said, only different triggers.
Got it working but thanks
 
Level 5
Joined
Jul 19, 2019
Messages
72
No that's false, it has nothing to do with custom tilesets because it'a just a terrain reskin, the problem is the condition you did there, but good to know it's solved.

However unbelievable it may be to you, that's exactly the problem and I tested and that's how I fixed it.

I used "Barrens - Desert" inside "Ashenvale" tileset. The condition doesn't recognize it.
Its only after I switched towards a native tileset in the Ashenvale it worked like a charm.

You explain it if you can, but that's exactly what happened.

I will be releasing the map soon, the one I told you about in your map thread.
You can then try it out, see that it works with the default tiles.
 
Status
Not open for further replies.
Top