HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Ordered units not responding properly

08-01-2007, 05:35 AM#1
burnt_pizza
I have a trigger in my map that creates a number of units at a certain point, and then orders them to Attack-Move to a random spot on the map. Problem is, after they reach their destination, they turn around and go right back to where they started, which I don't want.

It may be relevent to add that the spawned units are owned by a Computer slot, and that they have the Wander ability.

Help would be appreciated. I would post trigger code, but I'm not sure how to on these forums.

EDIT: Problem solved, thanks Ammorth for the solution (Ignore Unit Guard Positions. (either for the unit, or for the player will work)) and Pyrogasm for helping.
08-01-2007, 05:44 AM#2
PenguinEmperor
I have the same question. I've wondered why they do that too.
08-01-2007, 06:19 AM#3
Pyrogasm
Quote:
Help would be appreciated. I would post trigger code, but I'm not sure how to on these forums.
Right-click your trigger in the Trigger Editor and click "Copy As text". Then, when posting here, click the "Trigger" button in the reply box and then press Ctrl+V to paste your trigger between the tags.

How about ordering them to Hold Position when they reach their target?
08-01-2007, 07:58 AM#4
burnt_pizza
Ok, here's the trigger then:

Trigger:
Respawn
Collapse Events
Time - Every 60.00 seconds of game time
Collapse Conditions
DeathToll Greater than or equal to 1
Collapse Actions
Game - Display to (All players) the text: (Now respawning + ((String(DeathToll)) + zombies.))
Collapse For each (Integer A) from 1 to DeathToll, do (Actions)
Collapse Loop - Actions
Set OneShotPoint = (Random point in ZombieSpawnPoints[(Random integer number between 1 and 8)])
Unit - Create 1 ZombieSpawnTypes[(Random integer number between 1 and 10)] for Player 12 (Brown) at OneShotPoint facing Default building facing degrees
Custom script: call RemoveLocation(udg_OneShotPoint)
Set OneShotPoint = (Random point in (Playable map area))
Unit - Order (Last created unit) to Attack-Move To OneShotPoint
Custom script: call RemoveLocation(udg_OneShotPoint)
Set DeathToll = ((Random integer number between 1 and 5) + Diff)

As far as variables go, ZombieSpawnPoints is an array of regions, ZombieSpawnTypes is an array of units. Unit is created and told to move to a random spot, with nothing suggesting it should return. I don't want make units hold when they reach their location, as they should still be able to wander and acquire targets. Any ideas?
08-01-2007, 08:08 AM#5
Pyrogasm
Did you disable the AI? I think that's your problem; the AI is ordering the units back.

We'll have to get Moyack in here to explain how to create an AI that does nothing, as I know he's explained it before. Or you can try a search for "Disable AI" and all of its variants.
08-01-2007, 08:11 AM#6
Ammorth
Ignore Unit Guard Positions. (either for the unit, or for the player will work)
08-01-2007, 08:17 AM#7
Pyrogasm
Isn't that only for creeps?
08-01-2007, 08:54 AM#8
burnt_pizza
Quote:
Originally Posted by Pyrogasm
Did you disable the AI? I think that's your problem; the AI is ordering the units back.

We'll have to get Moyack in here to explain how to create an AI that does nothing, as I know he's explained it before. Or you can try a search for "Disable AI" and all of its variants.
Do you have to specifically disable something? I was under the impression that a Computer slot wouldn't do anything unless you ran some sort of AI script or otherwise forced it to.
08-01-2007, 09:20 AM#9
Pyrogasm
It will still auto-use abilities and maybe do some things with guard positions if you've managed to set things up correctly. A disabled AI will do absolutely nothing.
08-01-2007, 09:39 AM#10
burnt_pizza
Quote:
Originally Posted by Pyrogasm
It will still auto-use abilities and maybe do some things with guard positions if you've managed to set things up correctly. A disabled AI will do absolutely nothing.
Well I've searched around a bit and haven't found anything, any suggestions as to where I could look, or even some sort of workaround? It's pretty essential to my map that this works correctly.

EDIT: Just tried Ammorth's suggestion, and it seems to work. Thanks all!
08-01-2007, 09:47 AM#11
Pyrogasm
Here is the thread I was thinking of. Look for Moyack's replies.