HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need help on this item related trigger.

03-29-2005, 08:21 PM#1
Fragmentation
Peon AI Go
Events
Conditions
Actions
For each (Integer A) from 1 to 10, do (If (((Player((Integer A))) controller) Equal to Computer) then do (Unit Group - Pick every unit in (Units of type Peon) and do (If ((Owner of (Picked unit)) Equal to (Player((Integer A)))) then do (Unit - Order (Picked unit) to Move To (Center of Peon Items))


Peon AI Acquire
Events
Unit - A unit enters Peon Items <gen>
Conditions
Actions
For each (Integer A) from 1 to 10, do (If (((Player((Integer A))) controller) Equal to Computer) then do (If ((Owner of (Entering unit)) Equal to (Player((Integer A)))) then do (Hero - Give (Random item in Peon Items <gen>) to (Entering unit)) else do (Do nothing)) else do (Do nothing))


Peon AI Return
Events
Unit - A unit Acquires an item
Conditions
(Unit-type of (Triggering unit)) Equal to Peon
Actions
For each (Integer A) from 1 to 10, do (If (((Player((Integer A))) controller) Equal to Computer) then do (Unit Group - Pick every unit in (Units in Peon Items <gen>) and do (If ((Owner of (Picked unit)) Equal to (Player((Integer A)))) then do (If ((Item_Special is owned) Equal to True) then do (Unit - Order Picked Unit to Move To Center of Peon Spawn) else do (Do Nothing)))


Peon AI Acquire and Peon AI Return are initially off

Now I made those triggers to make any computer controlled slots make their peon go to the item region get an item and return, but sometimes conflicts occur like the peon wouldn't take an item or peon would get the item but won't return with it unless they get damaged then they would move and somehow they would start going back to. These conflicts usually happen when multiple units are in the Peon Items region and grabbing items.

The items are already at the region when they arrive. I basically need to know a better way to manipulate computer controlled units to acquire an item and go to a region.

Any help?
03-30-2005, 09:32 AM#2
Anitarf
The "item is owned" boolean comparison is wierd, it works for only a specific item, but I suppose you have more of these items in the region? Anyway, if you use the boolean comparison "item - unit has item of type", I suppose it should work.
03-30-2005, 03:26 PM#3
Fragmentation
I will try the item-type boolean, how did i miss that