| 03-29-2010, 10:04 PM | #1 |
"Well son, when a man and a computer love each other very much..." So when a neutral player controls units, they obey certain hardcoded AI behaviors. For example, they remember their starting location, and if they go too far away or spend any time without orders, they return to their starting location. I didn't think this was a behavior that computer-controlled player slots did (note, player slots, not neutral slots). However, in a map I have, if a computer-player unit is ordered via trigger into the center of the map, once he sits there for a second, he runs back to his starting location. I solved this previously by saving the unit's starting location and checking to see if any orders it receives tell it to "smart" back there. Then I would tell it Ignore Guard Position and it would be fine for the rest of the game. However, this is kind of a half-assed way of solving the problem and involves doing a lot of storing and checking that seems unnecessary and sloppy. So the question is: What's making these computer-player units want to run home? It's not fresh-baked cookies, before you suggest that. |
| 03-29-2010, 10:31 PM | #2 |
Gameplay constants iirc. Even if you control them via shared unit control, they still go back to the safety of their homes once they have complied with your orders. |
| 03-29-2010, 10:47 PM | #3 | |
Quote:
|
| 03-29-2010, 11:03 PM | #4 |
There is a function IgnorePlayerGuardPostions() (something like that). Just call that once for the player and you are golden. edit: RemoveAllGuardPositions(Player) |
| 03-29-2010, 11:22 PM | #5 |
There's RemoveAllGuardPositions(player) but the description for the function says: "This action tells the AI for the given player to neither use nor replace any of its preplaced units." And it also doesn't seem to change anything when called during map init (or time elapsed zero). The units still go home. There's also RecycleGuardPosition(unit) about which it says: "This action requests that the AI recycle the guard position that once belonged to the specified unit." Which sounds perfect! Except that if I call it on units as they are created, they stop in place and don't proceed to the waypoint. Before you say "well order them individually to the waypoint then," that was my original system, but it's very useful to be able to take advantage of shift-click to set multiple waypoints, which won't work with that solution. EDIT: Interesting to note, with RemoveAllGuardPositions(player), if a unit gets to where it's ordered to go, it stays there. But if it ever can't reach it (if, for example, there's already a unit standing on the exact spot of the rally point, it tries and then gives up and returns to its origin. Is this noteworthy? |
| 03-30-2010, 05:31 AM | #6 |
creep camp return time and return range constants. natives doesnot work in way you want, they not really work at all. |
| 03-30-2010, 01:00 PM | #7 | |
Quote:
|
| 03-30-2010, 01:05 PM | #8 |
Remove the 'Unit can flee' from the units in OE and it should be solved. Had same issues before in my TD. |
| 03-30-2010, 01:13 PM | #9 | |
Quote:
|
| 03-30-2010, 01:16 PM | #10 |
I thought that too, except that it does more. It (somehow) also effect the units guarding (if I remember correctly). |
| 03-30-2010, 01:59 PM | #11 |
Hm, this also did not affect the problem. Darn, I had such high hopes for it, too. |
| 03-30-2010, 02:06 PM | #12 |
Can you tell us what exactly the units have? How many sight range, abilities, etc? Edit: What if you add "foray" with a range of 0 to them? |
| 04-05-2010, 01:53 PM | #13 |
Foray? They don't have any special sight range, nor abilities. However, they are created via the Tinker Factory spawn ability. |
| 04-05-2010, 02:55 PM | #14 |
I mean 'strife' ability. |
| 04-05-2010, 10:04 PM | #15 |
Hm, you still lost me. What ability is that? |
