Moving them in the right direction

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Last created unit at the position of the dying unit?

Move it right away when you create the "last created unit"?

Code:
Untitled Trigger 001
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing (Position of (Triggering unit))
        Unit - Move (Last created unit) instantly to (Position of (Dying unit))

>>> Possible?
Of course.
 

Cookiemaster

New Member
Reaction score
36
I think he means moving to the point where the dying unit was order to move to.

In that case, store the ordered issue in a variable, and give the newly created unit this order. It will be hard to make it MUI though. (At least if you don't use Jass.)
 

Cookiemaster

New Member
Reaction score
36
Assuming Region B is an existing region on the map, and it doesn't involve more regions.

Set TEMP_POINT = (Center of (Region B))
Unit - Order an issue targetting a point
Move to (TEMP_POINT)


If you're using multiple regions to move around, you could use custom value's to indicate what region the unit is heading to.
 

Cookiemaster

New Member
Reaction score
36
There is an easy solution, I named it above. :x

Use custom value to determine what region the dying unit was heading to, based on that you can issue an order.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Assuming you have a list of points:
Set Points[1] = Center of <here>
Set Points[2] = Center of <there>
Set ...

You can remember what point the unit goes to as its custom value.
And the new one will simply need to go to Points[Custom value of (Dying unit)], along with a copy of that custom value to the new unit.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Well, then, maybe, it's time to fix those "some other bugs" once and for all,
so you can get back to one list that rules them all.

Or use a better custom value, that also knows what list it's from.
Like, 10 * ListNumber + Index for example.
More work though...
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Let's say your creep has been sent to "regions_blueA[2]".
That's the third list, and the point with index 2 in that list.
So the creep would get 3 * 10 + 2 = 32 as custom value.


If that poor guy doesn't make it, take its custom value, and:

copy it to the new unit:
Unit - Set custom value of (Last created unit) to (Custom value of (Dying unit))

Find out what point that was:
Set List = (Custom value of (Dying unit)) / 10 (= 3)
Set Index = (Custom value of (Dying unit)) - 10 * List (= 2)

Give the move order:
If List equal to 1 then
- Unit - Order (Last created unit) to move to regions_redA[Index]
else if List equal to 2 then
- Unit - Order (Last created unit) to move to regions_redB[Index]
else if List equal to 3 then
- Unit - Order (Last created unit) to move to regions_blueA[Index]
else ...


If, some day, one of those lists would get more than 10 points, replace all "10"s here with 100.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top