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

Attack movement system!? Help

Status
Not open for further replies.
Level 11
Joined
Nov 1, 2008
Messages
828
Alright so i have this, how would i make it so it always "Attack-Move" to the position of the heroes? I know there is a trigger for it, not "Attack" but "Attack-Move"... Thanks.

  • For each (Integer A) from Spawn_Min to Spawn_Max, do (Actions)
    • Loop - Actions
      • Unit - Create 1 Spawn_Basic[(Random integer number between 1 and 2)] for Player 12 (Brown) at Spawn_Point[(Integer A)] facing Default building facing degrees
      • AI - Ignore (Last created unit)'s guard position
      • Unit Group - Add (Last created unit) to Zombies
      • Set Number_of_Zombies = (Number_of_Zombies + 1)
      • Set TempLoc = (Position of (Random unit from Alive_Heroes))
      • Unit - Order (Last created unit) to Attack-Move To TempLoc
      • Custom script: call RemoveLocation(udg_TempLoc)
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
  • asd
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Set asd = (Last created unit)
      • Unit - Create 1 Footman for Player 2 (Blue) at (Player 1 (Red) start location) facing Default building facing degrees
      • Unit - Order (Last created unit) to Right-Click asd
the "Right-Click" order will follow the unit and attack when monster gets near the unit, and follow you again when the monster dies. this requires you to create unit for other player and make them allies, or else you can move the unit and make the unit stop following.

P.S : i don't clean the leaks, you should be able to do it...
 
Level 11
Joined
Nov 1, 2008
Messages
828
  • asd
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Ally with shared vision
      • Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
      • Set asd = (Last created unit)
      • Unit - Create 1 Footman for Player 2 (Blue) at (Player 1 (Red) start location) facing Default building facing degrees
      • Unit - Order (Last created unit) to Right-Click asd
the "Right-Click" order will follow the unit and attack when monster gets near the unit, and follow you again when the monster dies. this requires you to create unit for other player and make them allies, or else you can move the unit and make the unit stop following.

P.S : i don't clean the leaks, you should be able to do it...

Very smart, but the map can involve up to 300 units at a time. Not sure this is going to work. I had tried the kodotag attack move system, but aparantly it's not working.
 
Level 9
Joined
Aug 7, 2009
Messages
380
how about taking a look at this
It's my pet system which use your method to make the pet follow
(Attack-move to position)
and about the max 300 units? :-? i don't think it will get that bad with the system's function: auto teleport if far from range
P/S: Don't care about the "Needs fix" cause the mod's comment is about the variable set up thing so till now there's no leaks or... problem i guess. If there is, PM me, thanks
Goodluck
 
Level 11
Joined
Nov 1, 2008
Messages
828
how about taking a look at this
It's my pet system which use your method to make the pet follow
(Attack-move to position)
and about the max 300 units? :-? i don't think it will get that bad with the system's function: auto teleport if far from range
P/S: Don't care about the "Needs fix" cause the mod's comment is about the variable set up thing so till now there's no leaks or... problem i guess. If there is, PM me, thanks
Goodluck

I had selected a pet, it died. I couldn't select another one o.o. kept saying "You already have a pet" 10 times in a row but anyway. The system could work but it could be noticable that i'm using it in my map. There has to be an easier way.
 
Level 9
Joined
Aug 7, 2009
Messages
380
Guess clearing the hashtable keys is the problem to that.
Add this to Pet Die trigger, below the SP_ID2 Set action:
  • Set SP_ID = (Custom value of (Load 2 of SP_ID2 in SP_Hash))
and it will be fine :p
In case you are still wanting to use it :ogre_haosis:
Edit: there was some mistake in the action i gave so... check it again
 
Level 11
Joined
Nov 1, 2008
Messages
828
Guess clearing the hashtable keys is the problem to that.
Add this to Pet Die trigger, below the SP_ID2 Set action:
  • Set SP_ID = (Custom value of (Load 2 of SP_ID2 in SP_Hash))
and it will be fine :p
In case you are still wanting to use it :ogre_haosis:
Edit: there was some mistake in the action i gave so... check it again

Yeahh, i don't think it will work on my map. Maybe i could do something like this,

Order last created unit to "attack" Hero:
Hero comes close to unit = hero
-attack hero

Edit: Not sure how i would code this though.
 
Last edited:
Level 12
Joined
Sep 11, 2011
Messages
1,176
The enemy needs to "attack-move" to position of "hero". But if the hero moves to a different location. The enemy gets stuck and does a loop. It needs to follow the hero in "attack-move" so if another object is in the hero's way the enemy kills it.

hard to be achieved.. it's like a very smart AI.. people usually just use "attack to random unit" instead of "attack move to position of unit".. maybe it's doable with jass...
 
Status
Not open for further replies.
Top