• 🏆 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!

Attack Patterns

Status
Not open for further replies.
Level 3
Joined
Oct 2, 2013
Messages
27
How would i make it so units that just spawned within a region would go, and automatically go find players, and attack them.
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
  • Unit - Order (Last created unit) to Attack-Move To Point.
In kodo-tag they pick all enemy players of the recently spawned unit and chose a random unit from a random player. Something like this:

  • SpawnAttackers
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • -------- Here the unit is created --------
      • Set point = (Center of SomeRect <gen>)
      • Unit - Create 1 Footman for Player 12 (Brown) at point facing Default building facing degrees
      • Custom script: set udg_unit = bj_lastCreatedUnit
      • -------- Here you find a target strucutre to attack --------
      • Set force = (All enemies of (Owner of unit))
      • Set group = (Units owned by (Random player from force) matching (((Matching unit) is A structure) Equal to True))
      • Set point = (Position of (Random unit from group))
      • Unit - Order unit to Attack-Move To point
      • -------- Here the leaks are destroyed --------
      • Custom script: call DestroyGroup(udg_group)
      • Custom script: call DestroyForce(udg_force)
      • Custom script: call RemoveLocation(udg_point)
 
Last edited:
Level 4
Joined
May 9, 2015
Messages
70
my maps all have that I tell it to create time but you needs to make region a and b then just pick if you want unit just change in editor and player

145644d1432644081-attack-patterns-untitled.png


is your map all hero in one place? change move to attack-move to
 

Attachments

  • Untitled.png
    Untitled.png
    7.1 KB · Views: 83
Status
Not open for further replies.
Top