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

A unit generic event

Level 4
Joined
Jan 27, 2020
Messages
51
A building/unit cannot be constructed in just any area, but only within a specific region designated for its placement. Here's the trigger for my building, which can only be built within the designated region.
  • Mortar
    • Events
      • Unit - A unit Begins construction
    • Conditions
      • (Unit-type of (Constructing structure)) Equal to Guard Tower
    • Actions
      • Floating Text - Create floating text that reads Unable to build her... above (Constructing structure) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Special Effect - Create a special effect at (Position of (Constructing structure)) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
      • Unit - Remove (Constructing structure) from the game
      • Wait 2.00 seconds
      • Floating Text - Destroy (Last created floating text)
 
Level 4
Joined
Jan 27, 2020
Messages
51
Ah, I didnt clarify about the issue. The issue is the only building can be built within the region but cannot be built by any kind of building, its like blighted building but in this case only the region where I can put but using triggers.
ok, and what issue do you have with it? It's not clear what you want from your post.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,567
There's a Boolean Condition to check if a Unit is in a Region. Add that after the Unit-Type condition.

Then learn how to properly use Floating Text so you can destroy it with ease. You can't use Waits like that without problems and the Wait is unnecessary anyway.

How do we know that after 2.00 seconds has passed the (Last created floating text) is the same text that we wanted to destroy? Remember, the (Last created floating text) literally means the last one that has been created. It could have come from an entirely different trigger, or a new instance of this same trigger. When you use Waits you create moments in time where things can change. If you are referencing global variables like (Last created floating text) after a Wait action then you're just asking for trouble.

 
Last edited:
Level 4
Joined
Jan 27, 2020
Messages
51
There's a Boolean Condition to check if a Unit is in a Region. Add that after the Unit-Type condition.

Then learn how to properly use Floating Text, you can't use Waits like that without problems and the Wait is unnecessary anyway.

How do we know that after 2.00 seconds has passed the (Last created floating text) is the same text that we wanted to destroy? Remember, the (Last created floating text) literally means the last one that has been created. It could have come from an entirely different trigger, or a new instance of this same trigger. When you use Waits you create moments in time where things can change. If you are referencing global variables like (Last created floating text) after a Wait action then you're just asking for trouble.

Thank you for clarifying what my future mistakes could be. Thank you.
 
Top