HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

A Homing Ground Unit?

10-27-2008, 05:41 AM#1
Brash
What is the easiest way to go about this?:

I have a clockwerk unit that has no movement speed so that he cannot be moved and I want it so that he waits until a unit comes within 600 range he instantly gains 522 movement speed and is ordered to somehow arrive to that unit and blow up.

Like a homing missle, only it is a ground unit that retains all pathing.

This is proving to be harder to work out than it would seem.
10-27-2008, 06:37 AM#2
Pyrogasm
Well, instead of giving him no movement speed, give him 512 speed, but upon its being created, pause the unit. Then run a periodic check to see if there are any enemy units nearby said units and if so order the clockwerk unit to Kaboom! the enemy unit:
Trigger:
Collapse Events
Time - Every 0.15 seconds
Conditions
Collapse Actions
Custom script: set bj_wantDestroyGroup = true
Collapse Unit Group - Pick every unit in (Playable Map area) matching (Unit-type of (Matching Unit) equal to <You Unit>) and do (Actions)
Collapse Loop - Actions
Set TempPoint = Position of (Picked Unit)
Set TempGroup = (Units within 600.00 of TempPoint matching ((Matching Unit) is an enemy of (Owner of (Picked Unit)) and ((Matching Unit) is alive equal to true)))
Collapse If (All conditions are true) then do (Then actions) else do (Else actions)
Collapse If - Conditions
(Number of units in (TempGroup) greater than 0)
Collapse Then - Actions
Unit - Unpause (Picked Unit)
Unit - Order (Picked Unit) to Neutral Hostile - Kaboom! (Random unit from (TempGroup))
Else
Custom script: call DestroyGroup(udg_TempGroup)
Custom script: call RemoveLocation(udg_TempPoint)
This is, of course, assuming that your clockwerk units have an ability based upon Kaboom! on them.
10-28-2008, 04:20 PM#3
Brash
thanks, this has proven most useful and has given me a few other ideas.