• 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.

Need help with this trigger.

Status
Not open for further replies.
Level 4
Joined
Feb 28, 2009
Messages
73
Hi, im tying to make it so you can make your own path for a TD, so im making a unit run along and change the terrain as you will. How would i make it so a unit (Creep) would run along this path that you made to an end that you will be able to place down? Thanks.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Hah?
If I understand correctly, you want to make a unit spawn and run along a path.
Therefore, make two regions; one at the starting/spawning point and one at the end.
Given that you raised the terrian around the path or decreased the path-terrain, make one trigger:

  • Events
    • Unit - A Unit enters region Start region <gen>
  • Conditions
    • Owner of (Triggering Unit) is *your enemy player*
  • Actions
    • Set temppoint1 = (Center of End Region <gen>)
    • Unit - Order (Triggering Unit) to move to temppoint1
    • Custom script: call RemoveLocation(udg_temppoint1)
As the units are created in your start area, they'll be ordered to move towards the end.
You can as well add a nice sfx to the spawning like teleport or mirror image ^^
 
Level 4
Joined
Feb 28, 2009
Messages
73
Well the way that i want it is you have a unit. Then you activate a spell on that unit either making it grass or tiles. If it is tiles then when ever that unit runs over non tile terrain, it will make it tiled. And the same if you were to make it grass. is there anyway that like every few seconds make a region under that unit then make the creeps follow the regions? Or will that cause problems by putting to many regions on one spot? I don't really want to mess with raising the terrain. Unless i have to.
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Well the way that i want it is you have a unit. Then you activate a spell on that unit either making it grass or tiles. If it is tiles then when ever that unit runs over non tile terrain, it will make it tiled.
That's like: Unit -> Spell -> Anything it walks on changes to the fitting terrain

Urm I haven't been with wc3 in a long time, therefore I have to guess but I suppose you can't change the terrain at all in-game. o_O
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Just why do you want to do that?

It would be easier to place regions on the path and order the units to move to the next region after entering the first. Just Set temppoint1 = Center of Region 1 <gen> and copy that trigger the amount of regions you placed and then align the triggers to the regions you set.
Now Unit A will be sent to Region 1, then to 2 upon entrance, then 3 and so on..
 
Level 4
Joined
Feb 28, 2009
Messages
73
But that is so boring. I wanted to do something unique. Well i put a lot of pathing blockers and when u go over them it removes it. but its a bit glitchy cause it either removes to many or to little and the pathing gets messed up.
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
Here's the system.

Press ESC to start pathing. Move around with the unit. A periodic trigger checks the position of the unit and saves it to an array. If the position is not far enough from the previous saved position, then the position will not be stored. You don't need to save waypoints that are very close to the previous one. You can define the distance at map initialization.

When you press ESC again, a unit spawns and runs through the waypoints.

When you press ESC again, you can start pathing again. All previous waypoints will be cleared.

The dummies are spawned so you can see where the waypoints are. You can remove all lines concerning dummies from the final code.

I was too lazy to comment the triggers, if you have questions ask them in this thread.
 

Attachments

  • Path_System.w3x
    20.7 KB · Views: 42
Last edited:
Status
Not open for further replies.
Top