• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

triggered attacks

Status
Not open for further replies.
Level 4
Joined
Jan 24, 2012
Messages
55
Hi Guys,

I wonder how you make this:

A triggered attack.

If I'm right there are 2 possibilities:
1. after every "creat unit" Action a "ignore AI guard Position" Action and after that a "move/attack" Action.

2. after every "create unit" Action a "ignore AI guard Position" Action and a "add to Group" Action. at the end of the Trigger an "order Group to move/attack" Action.

In the 1st cause I've the Problem that some Units are faster, if I let the Ai attack with 2 NE-hunters and 3 NE-archers the hunters attack ~15 seconds before the archers. It's like they are in separate waves.

In the 2nd I'v the Problem that sometimes not every unit arrives at the target, it seems that the "ignore AI guard Position" not works with a unit-group.

Any ideas about that?

greez
Vladec
 
Level 14
Joined
Nov 17, 2010
Messages
1,265
This may help. Otherwise I think there are some other AI tutorials in the tutorial section. (I assume that is what you are talking about when you say triggered attacks)
 
Level 14
Joined
Dec 12, 2009
Messages
1,027
If you're having the creeps controlled by a neutral player (Passive/Victim/Extra/Hostile) the unit will auto retreat to it's spawn location after it reaches somewhere like 40% of its HP but only if a structure is attacking it.

Player-controlled units often do the same thing.

In the gameplay constants under the advanced tab in the WE, you can set the creep guard distances to max (something like 999999999999999999999), but you'll still have the problem where they retreat if a building attacks them at low health. So, some people spawn the creeps at their destination and then move them to their start location instantly. Others just remove the building classification from their attacking buildings (I think).

The different units arriving at different times is the result of non-matching movement speeds; these can be set in the object editor with the movement speed - base field.

//\\oo//\\
 
Level 4
Joined
Jan 24, 2012
Messages
55
Thanks to both of you :)

But I'm anyway not sure how to handle my Problem.

At first: I take Player controlles Units.

2nd: Non of These Solutions works good with my (campaign)map.

@veritas; I Need a Trigger for a unit-group, the tutorial-link wasn't very usefull for that ('cause there is only worked with one hero) :(

@Boris; the creep guard distance is unmodable for me 'cause there are "normal" creeps in the same map, and they should work with a normal guard distance. About the movement-speed: I don't want to mod the unit (as example, if the AI attacks with inly a hunter this one should move like in every game ("fast")), but if they attack as a Group (created by Trigger), every unit should wait for the other.
And I don't think that the solution with the spwan and move instantly works fine, In my map you control (and have to defend) a base - the target of the attacks. If I spawn every attack in this base and move the hostile units to another Point in the map - arn't they then spotted quickly in my base? Have to try that, but not sure if it would work.

and after all, sry for eventually bad english :S ;)^


Greez
Vladec
 
Level 17
Joined
Mar 21, 2011
Messages
1,597
hmm i'm not sure what you really want to do and what your actual problem is.
anyway, if you want to have a group of units attack your base, you could move them step by step towards the target in a periodic event. you always check if all the units reached the point (or are close to it), then they can move forward to the next point, so they shouldnt reach the final location to different times. i could do an example trigger for you, but at first i should know your actual problem.
 
Level 14
Joined
Dec 12, 2009
Messages
1,027
Thanks to both of you :)

But I'm anyway not sure how to handle my Problem.

At first: I take Player controlles Units.

2nd: Non of These Solutions works good with my (campaign)map.

@veritas; I Need a Trigger for a unit-group, the tutorial-link wasn't very usefull for that ('cause there is only worked with one hero) :(

@Boris; the creep guard distance is unmodable for me 'cause there are "normal" creeps in the same map, and they should work with a normal guard distance. About the movement-speed: I don't want to mod the unit (as example, if the AI attacks with inly a hunter this one should move like in every game ("fast")), but if they attack as a Group (created by Trigger), every unit should wait for the other.
And I don't think that the solution with the spwan and move instantly works fine, In my map you control (and have to defend) a base - the target of the attacks. If I spawn every attack in this base and move the hostile units to another Point in the map - arn't they then spotted quickly in my base? Have to try that, but not sure if it would work.

and after all, sry for eventually bad english :S ;)^


Greez
Vladec

If they're created and immediately moved, they won't be spotted. In the gameplay constants, if memory serves, there's a field specifying a 0.25 second reaction time for acquiring targets.

Alternatively, if there is a path behind your base (edge of map) that can only be reached by going through your base, you can set that area as the spawn location. Just beware that retreating units will attempt to walk through death row without putting up a fight.

//\\oo//\\

Edit:
This is post number 666 for me!
 
Level 4
Joined
Jan 24, 2012
Messages
55
hmm i'm not sure what you really want to do and what your actual problem is.

Sorry, It's hard for me to be precisely 'cause my english (+Google-translator :D) is really bad ;)

I try it with a pic:



There are 3 zones "Target", "Spawn1" and "Spawn2".
Every AI-Player has am self-made melee-AI.

Every 90 secounds I wish to spawn 2 archer and 2 hunters controlled by Player "green" at "spawn 1" and send them to attack "Target".

Every 120 secounds the same at "Spawn2" with 2 gouhls and 2 fiends (Player "Blue-Grey", allied with Player "yellow").

I use 2 variables, "Attacker" (Unit/Array4) and "AttackerTwo" (Unit/Array4)

Atm:

  • Attack1
    • Events
      • Time - Every 90.00 seconds of game time
    • Conditions
      • Not necessery atm
    • Actions
      • Unit - Create 1 Archer for Player 11 (Dark Green) at (Center of Spawn1 <gen>) facing .....
      • Set Attacker[1] = (Last created unit)
      • AI - Ignore Attacker[1]'s Guard Position
      • Unit - order Attacker[1] to move/attack to (Center of Target <gen>)
      • Same with attacker[2]-attacker[4]
-And same Trigger for the Undeads.

My Problem: Sometimes all 4 unit attack at "Target", but also another time just 2 of them or just one. The other Units stands at the spawn-point or at the base of their owner. I don't know to fix - The Units have to attack at any cost in any cause (execpt the condition is not fullfilled) and they sould never retreat or go back to heal (melee-Ai is set on "no retreat" etc.).

@all the others:
Thanks for your answers, I will test them, atm I've not a lot of time, but I will post if something works on my map (tomorrow or next week) :)
Thanks for the lovely help ;)


Greez
Vladec

edit: gz for the 666 ;) Eeeeeevil :D
 
Status
Not open for further replies.
Top