Making computer player owned units prioritize attacking items on the ground

neetmaster

New Member
Reaction score
0
Hello, I've been wondering how can I make computer player's units to automatically prioritize items on the ground for attacking.

I made my map so that if a unit dies, every items are dropped. But then players can just take the dropped items later.
I want to make it so if items are dropped, computer player units will try to destroy the items.

Any ideas on how to do this?
 

istar

New Member
Reaction score
31
by default unit poses no threat and ai wont attack them
so need trigger
event-???
condition-???
action-order unit attack item in range
 

neetmaster

New Member
Reaction score
0
I tried doing that with Event - unit loses an item
and order units to attack the item being manipulated


doesnt work somehow :/
 

Baltazhar

Active Member
Reaction score
55
I don't think "Item being manipulated" will work, when the item is dropped on the ground. Perhaps "Last dropped item"?

You could try something like this (At work, so free hand trigger)
Code:
Event: Every X seconds
Condition: None
Action:
Set Temp_Group units owned by Computer
Pick all units in Temp_Group
 - Order them to attack items on the ground
Custom Script call DestroyGroup (udg_Temp_Group)

If you could post your trigger, that would be a big help.

- Baltazhar
 

FarAwaY

TH.net Regular
Reaction score
9
Every 1 second
If number of items in playable map area is greater than or equal to 1, pick every unit in all units of type ComputerItemDestroyer and do:
Issue order to picked unit to target random items in region etc..
 
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