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

Units spawn - Attack random units to random player

Status
Not open for further replies.
Hi there, having some trouble with a trigger.

I want my new spawned units to attack random unit from a player-group

The Player-group works well, although the creatures that is spawned runs un-clean and not as I want. They are running everywhere.

Here is the trigger:

  • Always Run Attack
  • Events
  • Time - Every 10.00 seconds of game time
  • Unit Group - Pick every unit in (Units owned by Player 12)) and do (Unit - Order (Picked unit) to Attack-Move To (Position of (Random unit from (Units owned by (Random player from Team1)))))
What would I have to improve?
Call Destroy something?

Short said, I just want RANDOM units from Player 12 to attack random player from the group team1.

I want my spawned units to attack just as kodos in kodo-tag, short said :csmile:

Ty in advance /Redbean
 
Level 17
Joined
Jun 28, 2008
Messages
776
I think the problem is the "every 10 seconds". Just as they are going for 1 unit, they have to stop and go for another.

I think you can use this :

  • Always Attack Loop
    • Events
      • Time - Every 40.00 seconds of game time
    • Conditions
    • Actions
      • Trigger - Run Always Attack <gen> (ignoring conditions)
and

  • Always Attack
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player number of (Picked player)) Not equal to 12
            • Then - Actions
              • Player Group - Add (Picked player) to All_Players
            • Else - Actions
      • Set Active_Player = (Random player from All_Players)
      • Set Temp_Group[1] = (Units owned by Player 12 (Brown))
      • Set Temp_Group[2] = (Units owned by Active_Player)
      • Set Temp_Unit = (Random unit from Temp_Group[2])
      • Unit Group - Order Temp_Group[1] to Attack Temp_Unit
and

  • Temp Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to Temp_Unit
    • Actions
      • Trigger - Run Always Attack <gen> (ignoring conditions)
Hope it helps
 
Status
Not open for further replies.
Top