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

Spawn/attackmove problem

Status
Not open for further replies.
Level 2
Joined
Dec 2, 2014
Messages
10
Hey guys, i am having big trouble getting my spawn/attack move system done. It intends to spawn units periodically and tells them to attack a random unit from a random player in Team 1. The spawned units always seem to recalibrate their target as they just run around without being able to walk to a target straight :( . Also, the units in SpawnRight dont spawn... I hope you can help me as i really dont know what to do anymore :(

  • Variable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Force2 = (All allies of Player 12 (Brown))
      • Set Force1 = (All allies of Player 1 (Red))
  • TownTier1UnitSpawn
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set AnyPlayerForce1 = (Random player from Force1)
      • Unit - Create 1 Town Slave for Player 11 (Dark Green) at (Center of SpawnLeft <gen>) facing Default building facing degrees
      • AI - Ignore (Last created unit)'s guard position
      • Unit - Order (Last created unit) to Attack-Move To (Position of (Random unit from (Units owned by AnyPlayerForce1)))
      • Set AnyPlayerForce1 = (Random player from Force1)
      • Unit - Create 1 Town Slave for Player 11 (Dark Green) at (Center of SpawnRight <gen>) facing Default building facing degrees
      • AI - Ignore (Last created unit)'s guard position
      • Unit - Order (Last created unit) to Attack-Move To (Position of (Random unit from (Units owned by AnyPlayerForce1)))
 
Level 25
Joined
May 11, 2007
Messages
4,651
Well how many allies does Player1 and Player 12 have? As of now it will not attack-Move towards player1 but instead it's allies.

And fix the leaks, if you're going to spawn units every second the game is going to slow down after a while if you don't remove the points.
 
Level 7
Joined
Mar 16, 2014
Messages
152
Are there any other units in the way? If you order them to attack move, they will kill whatever's in the way.

Also, if you're spawning a unit every second, eventually the computer will struggle to move them all. Each player can only have 100 units or so at a time before the movement starts to get glitched due to the WC3 engine.

I cannot tell why the units in spawnright don't spawn from this trigger. Have you set what the region is?
 
Level 2
Joined
Dec 2, 2014
Messages
10
Well how many allies does Player1 and Player 12 have? As of now it will not attack-Move towards player1 but instead it's allies.

And fix the leaks, if you're going to spawn units every second the game is going to slow down after a while if you don't remove the points.

Hey thanks for helping so quickly unfortunately i dont know how to fix the leaks and for what you said first, i checked in the "ally of player" trigger it also says that the player is included.
 
Level 2
Joined
Dec 2, 2014
Messages
10
Are there any other units in the way? If you order them to attack move, they will kill whatever's in the way.

Also, if you're spawning a unit every second, eventually the computer will struggle to move them all. Each player can only have 100 units or so at a time before the movement starts to get glitched due to the WC3 engine.

I cannot tell why the units in spawnright don't spawn from this trigger. Have you set what the region is?

sorry they actually do spawn, they were just immediately killed because all the towers around them were still set to neutral hostile, my mistake... sorry and for the other part, you were right as well, they always just attacked things that were near them. But now i have another problem, the units just stop doing anything after they have killed their target and there is nothing in range anymore, is there any way to make them attack again?
 
Level 2
Joined
Dec 2, 2014
Messages
10
Oh, sorry, I didn't see.

For last question (your last post), have a trigger run when a Unit dies and check for Player Green units around it. Then order it to attack again.

Hi, if you look at my other thread in the scripts/trigger section you see we solved the problem differently, thanks for your help but were doing it with unit groups. Just ignore this thread.
 
Status
Not open for further replies.
Top