• 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.

[Trigger] My units that spawned won't attack

Status
Not open for further replies.
Level 4
Joined
Oct 12, 2008
Messages
64
Hiya!

Ive just been using triggers to spawn units which attack-move to a certain location, the movement has been working fine (as far as I know) except the spawned units will not attack my player controlled buildings, the just stand there in front of them for a while and walk away (while being attacked by towers). The spawned enemies attack actual units (not buildings) just fine.

I'm really sorry I had to attach my images because i couldnt figure out how to put them here (It would only accept a URL!!!). Call me stupid but at least I tried.

Can you help me???

Any Help Will Have Uber +rep :D
Regards, Slashbang:infl_thumbs_up:
 

Attachments

  • Spawning Trigger Example.jpg
    Spawning Trigger Example.jpg
    35.1 KB · Views: 132
  • Movement Trigger Example.jpg
    Movement Trigger Example.jpg
    28.9 KB · Views: 142
Level 7
Joined
Sep 5, 2006
Messages
333
first of all, make sure your building can be attacked (no invul) , and your unit can attack a building and have a attack with a melee or more range. Also you can merge the 2 trigger, by making unit spawn in X place, and use pick all unit in X place and order to attack move
 
Level 4
Joined
Oct 12, 2008
Messages
64
Believe Me, i made sure that nothing was invunrible or bad attack range. I tested the unit myself and it attacked fine. And about the triggers, i don't wanna merge because they pretty much move in 'waypoints'. These are not the problem.
 
Level 4
Joined
Oct 12, 2008
Messages
64
Thx testing now, it is actually on neutral hostile...YES BY GUM YOUVE DONE IT (mmmmmm gum) MUCHOS REP FO U
 
Last edited:
Level 12
Joined
Aug 22, 2008
Messages
911
"A unit enters region" doesn't include units that are created in the region, that's your problem mate.
You should include the action in the first trigger "Trigger - Run Creep Movement Left (you decide if checking or ignoring conditions)", or include the actions of the Creep Movement Left trigger in the first trigger. Hope it helped.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
"A unit enters region" doesn't include units that are created in the region, that's your problem mate.
You should include the action in the first trigger "Trigger - Run Creep Movement Left (you decide if checking or ignoring conditions)", or include the actions of the Creep Movement Left trigger in the first trigger. Hope it helped.

If I create a unit inside a region, he still enters it. Thus it works, I have made it before.
Just don't use creep movement just make the units for player 12 or any other slot that can be used by a computer.
 
Level 12
Joined
Aug 22, 2008
Messages
911
If I create a unit inside a region, he still enters it. Thus it works, I have made it before.
Just don't use creep movement just make the units for player 12 or any other slot that can be used by a computer.

I would've loved it to work, but I tried it on my computer and it didn't work.
Instead, all the actions should be put in the same trigger, in my opinion, and the units that were created will be referred to as (Last created unit), NOT (Last created unit group).
EDIT: You said it worked... Please link your resource here! Thanks.
 
Level 17
Joined
Jun 12, 2007
Messages
1,261
I would've loved it to work, but I tried it on my computer and it didn't work.
Instead, all the actions should be put in the same trigger, in my opinion, and the units that were created will be referred to as (Last created unit), NOT (Last created unit group).
EDIT: You said it worked... Please link your resource here! Thanks.

Here it works perfectly fine for me. Just 2 simple triggers.

  • Spawn
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of Region1 <gen>) facing Default building facing degrees
  • Move
    • Events
      • Unit - A unit enters Region1 <gen>
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to Attack-Move To (Center of Region2 <gen>)
The triggers leak though, but I'm to lazy to clean them for something minor as this.
 
Spawn
Events
Time - Every 2.00 seconds of game time
Conditions
Actions
Unit - Create 1 Footman for Player 1 (Red) at (Center of Region1 <gen>) facing Default building facing degrees
Unit - Order Last created unit to attack-move to targetloc


that would be much better and more efficient, isnce othe units might enter ur region too....

EDIT: If u want more units to spawn (i think 4 it was, or sth?) use

for each integer from 1 to (in this case 4) 4 do multiple actions
loop - actions
create unit
make unit move


and so on
 
Status
Not open for further replies.
Top