Unit Pathing Issue

sevensc

New Member
Reaction score
8
If a unit is issued an order to go to a point, and a player then builds or sells a tower altering the units original path, the unit will often walk the entire path that it "thought" it could have originally walked before realizing that the path is no longer valid.

Is there a value that I can change that will force units to check their path more often, or do I need to reissue movement orders periodically or when a tower is built/sold?
 

Drakethos

Preordered Sc2 ftw!
Reaction score
56
i believe you will have to make it reissue the order every time a tower is built.
 

sevensc

New Member
Reaction score
8
I guess I'll have to go test how much of a hit my game takes when re-issuing dozens of units for a number of different players.
 

sevensc

New Member
Reaction score
8
I seem to have run into an issue.

There are 6 players, each with a playable region in an array (udg_playerRegions[]). In each region, there are 3 smaller regions that units are ordered to - these regions are also in arrays (udg_left[], udg_right[], udg_left[]).

When a player sells a unit, I can determine which playerRegion[] that unit was in by using IsUnitInRegion checks (getting the array index) but when I try to re-issue orders to the units in the playerRegion[], I have been unable to issue them orders based on that same index (which is what I want to do).

If I use:
Code:
call ForGroupBJ( GetUnitsInRectAll(udg_playerPlayable[i]), function Trig_Sell_FuncOrder )

I can select all the units I want to reorder with that action, but I can't seem to use the same index value, i, for sending the units to target regions.

QUESTION: How do I use the index to reissue the units? Do I need a vars handle system? Is there another action I can use?

Any help would be, um, helpful.
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
You would probably have to store an integer as to what region the unit is heading towards somewhere on the unit. A typical way of doing it, is using a unit's custom value.

If you can't use the custom value because another system is using it, you'll have to use an attachment system.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top