• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[General] Enemy path problem

Status
Not open for further replies.
Level 8
Joined
Sep 10, 2013
Messages
372
I have a problem with this:

  • Events: Every 30 seconds of the game.
  • Conditions: None
  • Actions:
  • If All conditions are true do then actions else do else actions
  • Conditions:
  • BuildingOk equal to True
  • HeroesInArea equal to True
  • Then - Actions:
  • Unit - Create 2 [Units] for player x facing blablabla
  • Unit Group - Order units in [UnitSpawnArea] to attack-move to [UnitAttackArea]
  • Else - Actions:
  • Do nothing.
  • Wait - wait 10 seconds.
  • If All conditions are true do then actions else do else actions
  • Conditions:
  • BuildingOk equal to True
  • HeroesInArea equal to True
  • Then - Actions:
  • Unit - Create 2 [OtherTypeOfUnit] for player x facing blablabla
  • Unit Group - Order units in [UnitSpawnArea2] to attack-move to [UnitAttackArea]
  • Else - Actions:
  • Do nothing.
(I don't know how to use these tags so don't you laugh at me :ogre_rage: )

This isn't the exact trigger I'm using, but it's exactly similar. I'm actually using two of this trigger, one for each spawn location.

The idea is to spawn units for an enemy computer player in an area around two separate building [let's say a barracks], and order them to attack move\patrol to a region, only IF: The building is alive, and the player heroes are in a certain region.

The Problem isn't the trigger activity [the conditions]. When the building is destroyed or when the heroes are in another area [region], the units stop spawning. The problem is that the spawned units don't attack-move to that region, but they meet half-way with the units spawned in the opposite area, then group at one of the spawn locations. I checked the target region of the attack-move many times, it's exactly where I want them to go, but that's not where they actually do go.

Any ideas? :goblin_jawdrop:
 
Level 12
Joined
May 22, 2015
Messages
1,051
Do the units have spells? There's a bunch of weird built-in AI stuff that you can't fully control, and sometimes it interferes with the units' orders. Basically, if they cast a spell, they might forget their command and run back to where they spawned. I think this is a fairly common problem.

I think you can fix it by removing guard positions or something, but it's been a long time since I looked at that.

In my own map, I just have multiple waypoints that tell the units what to do again. I also was lucky since most units don't have any spells in my map.
 
Level 8
Joined
Sep 10, 2013
Messages
372
Do the units have spells? There's a bunch of weird built-in AI stuff that you can't fully control, and sometimes it interferes with the units' orders. Basically, if they cast a spell, they might forget their command and run back to where they spawned. I think this is a fairly common problem.

I think you can fix it by removing guard positions or something, but it's been a long time since I looked at that.

In my own map, I just have multiple waypoints that tell the units what to do again. I also was lucky since most units don't have any spells in my map.

The Units I'm spawning only have passive spells, so there's nothing there to cast, and the path isn't blocked so they shouldn't change their direction.

What do you mean by removing guard positions?

EDIT: I tried this:

  • AI - Ignore the guard positions of all Player7 Units.
But the units still meet half way with the other guys, and then wander around like idiots.
 
Level 12
Joined
May 22, 2015
Messages
1,051
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/units-return-after-attacking-215776/
http://www.hiveworkshop.com/forums/...ck-their-spawn-position-after-casting-148935/

These aren't the exact solutions, but they might be similar. Your problem sounds a bit different, though.

Anyway, there is an action. It should be under the "Unit" actions - something like "Unit - Remove guard position" or something. You can also set some values in the gameplay constants (guard return distance and I think a couple others). Check out the threads to see if they help.
 
Level 8
Joined
Sep 10, 2013
Messages
372
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/units-return-after-attacking-215776/
http://www.hiveworkshop.com/forums/...ck-their-spawn-position-after-casting-148935/

These aren't the exact solutions, but they might be similar. Your problem sounds a bit different, though.

Anyway, there is an action. It should be under the "Unit" actions - something like "Unit - Remove guard position" or something. You can also set some values in the gameplay constants (guard return distance and I think a couple others). Check out the threads to see if they help.

I don't have the same issues discussed in these two links, because the units spawned don't even get to attack anything, and don't have any spells to cast.
I'll check the unit guard distance again and see what it does.

EDIT: The only 'Guard position' actions are under the 'AI' category, and I'm already using: AI - Ignore the guard positions of all Player 7 Units.
 
Level 23
Joined
Dec 4, 2007
Messages
1,557
1) Please post your exact trigger:
Get into trigger editor, click the according trigger and under trigger functions right click your trigger name and use "copy as text".
Then simply paste it in the message box and wrap trigger tags around it.

2) Did you try to change the computer controller?
Scenario-> Player Properties -> Controller -> Change it to "neutral"

I have never experienced returning units/ignoring order issues like that.
 
Level 14
Joined
Nov 30, 2013
Messages
926
Kinda hard to read it but I optimized it for you.
  • Unit Spawner
    • Events:
      • Time - Every 30 seconds of the game.
    • Conditions:
    • Actions:
      • If (All Conditions are true) do (Then Actions) else do (Else Actions)
        • Conditions:
          • BuildingOk equal to True
          • HeroesInArea equal to True
        • Then - Actions:
          • Unit - Create 2 [Units] for player x facing X
          • Unit Group - Order units in (Last created unit group) to attack-move to (Point Target)
        • Else - Actions:
          • Do nothing.
      • Wait 10 seconds.
      • If (All Conditions are true) do (Then Actions) else do (Else Actions)
        • Conditions:
          • BuildingOk equal to True
          • HeroesInArea equal to True
        • Then - Actions:
          • Unit - Create 2 [OtherTypeOfUnit] for player x facing X
          • Unit Group - Order units in (Last created unit group) to attack-move to (Point Target)
        • Else - Actions:
          • Do nothing.
Neutral and Hostile units will return themselves immediately back to the location where they newly spawned if being ordered to move to that point. The units that being move should be only Player 1-12 as computer/player so they don't go back. (unless you ordered them to attack-move but they'll return back if they reached the point.)
If this wasn't the case, I'm unsure how unless if you shown us the exact trigger.
 
Last edited:
Level 23
Joined
Dec 4, 2007
Messages
1,557
Since your problem is still not solved, look into this map, is this how it should work?
 

Attachments

  • Biron's Problem.w3x
    15.5 KB · Views: 58
Level 14
Joined
Nov 30, 2013
Messages
926
A]mun;2790741 said:
Since your problem is still not solved, look into this map, is this how it should work?

That would work.
It's more likely that if two of the spawned unit group is belong to a Hostile or Neutral Player, it returned back into the base, meaning that's causes the problem.
I did modify it trigger by changing the owner of last created unit group to neutral and hostile and it did happen.
 
Level 23
Joined
Dec 4, 2007
Messages
1,557
Now this really bothers me actually ^^.

You are right bear_369 neutral hostile depends on gameplay constant guard distances. Setting those to ludicrous amounts fixes the issue, but then all neutral hostile units are affected, which is most probably unwanted (creep camps would not return to their camp after chasing). Too bad there is no way, at least in gui, to individually set the guard distance of any given unit.


I even tried to spawn the units for a computer player (player2) and change their ownership immediately to neutral hostile - to no avail.

I don't see a solution sadly, at least when dealing with neutral hostile unit's orders.

Many have tried before, if you google that problem:
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/returning-creeps-42972/

Conclusion:
Use neutral hostile for non-triggered creep camps.
Use a computer player for triggered creeps.
 
Status
Not open for further replies.
Top