HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Advanced Tower Defense Pathing

07-18-2006, 11:42 AM#1
TFaLCoN
Hi, i am working on a Tower Defense map and have some difficulties making
a trigger for creeps to walk a specific route by using a crossroad.

Events: Unit - A unit enters START
Actions: Unit - Order (Entering unit) to Move To (Center of END)
07-18-2006, 11:57 AM#2
Captain Griffen
Use custom values on each unit to store which spawn point they came from, and then use that to decide which way to order them when they enter each region.
07-18-2006, 03:22 PM#3
TFaLCoN
Ok, ik found out howto setup a custom unit value:

Unit: Set custom value of (Last created unit) to 1

But i can't find a condition to check on the unit value when he entered crossroad, only found this :

(Unit-type of (Triggering unit)) Equal to Footman1
(Unit-type of (Triggering unit)) Equal to Footman2
(Unit-type of (Triggering unit)) Equal to Footman3

But not efficient to make a unit for each spawmpoint; if i would do that with 5 spawmpoints x 40 units i have 200 custom units
07-18-2006, 03:35 PM#4
Thunder_Eye
It's an integer comparsion
07-18-2006, 05:33 PM#5
harshateja
I like the colorful picture . Back on topic, there is a GUI function that is like Get Custom Value of Unit. And, instead of triggering unit, use entering unit. THen use the Get Custom value of Unit on the entering unit and check if its some INTEGER value.
07-18-2006, 05:55 PM#6
The)TideHunter(
Heres a example:

Trigger:
Start Blue
Collapse Events
Unit - A unit enters Blue Start <gen>
Conditions
Collapse Actions
Unit - Set the custom value of (Entering unit) to 1
Unit - Order (Entering unit) to Move To (Center of Crossroad 1 <gen>)

Trigger:
Start Yellow
Collapse Events
Unit - A unit enters Yellow Start <gen>
Conditions
Collapse Actions
Unit - Set the custom value of (Entering unit) to 2
Unit - Order (Entering unit) to Move To (Center of End Yellow <gen>)

Trigger:
Start Red
Collapse Events
Unit - A unit enters Red Start <gen>
Conditions
Collapse Actions
Unit - Set the custom value of (Entering unit) to 3
Unit - Order (Entering unit) to Move To (Center of Crossroad 3 <gen>)

Trigger:
Crossroad 1
Collapse Events
Unit - A unit enters Crossroad 1 <gen>
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Entering unit)) Equal to 1
Collapse Then - Actions
Unit - Order (Entering unit) to Move To (Center of Crossroad 3 <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Entering unit)) Equal to 3
Collapse Then - Actions
Unit - Order (Entering unit) to Move To (Center of End Blue <gen>)
Else - Actions

Trigger:
Crossroad 3
Collapse Events
Unit - A unit enters Crossroad 3 <gen>
Conditions
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Entering unit)) Equal to 1
Collapse Then - Actions
Unit - Order (Entering unit) to Move To (Center of End Red <gen>)
Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Custom value of (Entering unit)) Equal to 3
Collapse Then - Actions
Unit - Order (Entering unit) to Move To (Center of Crossroad 1 <gen>)
Else - Actions
07-18-2006, 06:05 PM#7
TFaLCoN
great reply! i have worked something out before i have read it



07-18-2006, 06:13 PM#8
Alevice
[OT]A little tip: Rather than taking a screenshot and uploading it, you can just right click in your trigger name, select copy as text, and paste it within [trigger] tags. ;)