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

Can someone please create a trigger that would let my ITEM spawn my barricade facing in a random direction.

Status
Not open for further replies.
Level 3
Joined
Sep 25, 2020
Messages
36
Hi Team,

I hope someone can help me out with my dillema. I created a a barricade that can be spawned using an item which I just modified (ITEM BUILD TINY BARACKS). The problem is whenever I use the Item every barricade is facing the same direction SOUTH and it doesnt look natural.

Can someone please create a trigger that would let my ITEM spawn my barricade facing in a random direction.

I'm planning to play my map with my sister and I think this community is pretty helpful and awesome.
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,545
You can detect when any unit is first created using this Event:
  • Unit - A unit enters (Playable map area)
This will detect trained units, sold units, summoned units, constructed structures, etc...
Note that there are specific Events for those above cases and they usually offer more control.
"A unit enters map" is a more general Event. It comes in handy when those other Events don't work.

And here's the full trigger for changing the unit's facing angle:
  • Example
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Barricade
    • Actions
      • Unit - Make (Triggering unit) face (Random angle)

(Triggering unit) refers to the unit in the Event -> A unit enters map. I highly recommend using this Event Response whenever possible, even over more specific Event Responses like (Entering unit).

The Condition is a Unit-Type comparison.

You can Search for the Action by typing "face" in the search for text bar. The search feature can be very picky so try to keep your searches short and use only one keyword. The Action is called "Make Unit Face Angle Immediately". You may not have this Action if you're on an older version of Warcraft 3. (Random angle) is a Math function that you can find when choosing a value for the angle.
 
Last edited:
Level 3
Joined
Sep 25, 2020
Messages
36
I have a problem, probably i have a much older version - but there was a trigger similiar to this.

1638546163533.png


The problem is I cant find the trigger "instantly"
 
Level 3
Joined
Sep 25, 2020
Messages
36
The barricade doesn't face at all, It was a ward and I can rotate the barricade at the editor.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,545
Buildings can't have their angles changed this way and I imagine Wards have the same issue.

Do you know which version you're on? Have you updated Warcraft 3 recently?

Pyrogasm has a solution in this thread:
You may have to remove the Ward classification.
 
Level 3
Joined
Sep 25, 2020
Messages
36
Can I make a trigger that if an item is used on the specific location (blank skill) - the barricade will be created randomly on the location
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,545
What do you mean by "created randomly"? Like facing a random direction? Unfortunately that won't work for buildings*

Does the unit NEED to be a Ward or something? Why doesn't the previous solution work?
 
Last edited:
Level 3
Joined
Sep 25, 2020
Messages
36
I made some testing and found out that the "Barracade" "ward" is facing in random direction when created with a trigger using
"periodic time event" and "unit - create facing direction"

1638550297038.png


Can you please make a trigger that when I use an Item's ability it will just trigger create the "barricade" ward in the location instead of the actual skill.
 
Level 3
Joined
Sep 25, 2020
Messages
36
Instead of an actual building I used the ward option, you can create the UNITS everywhere with a random angle. I saw this from a "zombie map"
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,545
I was under the impression that you tested a non-building Ward and it didn't work.

Both Item abilities and unit abilities use this Event:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Create Barricade
    • Actions
      • Unit - Create 1 Barricade for (Triggering player) at (Target point of ability being cast) facing (Random angle) degrees
(Triggering player) is the owner of the casting unit in this case. You want to use (Owner of (Triggering unit)) most of the time, this is a special case.

Just use a Point ability like Carrion Swarm and modify it so it doesn't do anything (no damage/art/missile/targets allowed/etc). It'd be better to use the Channel ability but it'll need to have the correct settings -> Follow Through Time: 0, Disable Other Abilities: False, Targeting Type: Point, Options: Visible.
 
Last edited:
Level 3
Joined
Sep 25, 2020
Messages
36
ITS ALIVE!!! YOU HELPED BEFORE UNCLE ITS BEEN TWO YEARS ALREADY I REMEMBER YOUR NAME IN THIS COMMUNITY +RESPECT UNCLE
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,545
ITS ALIVE!!! YOU HELPED BEFORE UNCLE ITS BEEN TWO YEARS ALREADY I REMEMBER YOUR NAME IN THIS COMMUNITY +RESPECT UNCLE
If you wanted you could even make the Barricade face the same direction as the Hero. I find this to look and feel a lot better.
  • Unit - Create 1 Barricade for (Triggering player) at (Target point of ability being cast) facing (Facing of (Triggering unit)) degrees
 
Status
Not open for further replies.
Top