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

Replicate Player Units With Neutral Units System

Status
Not open for further replies.
Level 1
Joined
Jan 20, 2019
Messages
3
Hello, in my map, you make units and while they are in a area they can be sent via a spell to attack a target. When they are sent to attack a target, the units themselves don't attack (think Pokemon Defense or Legion TD type of system), but neutrals of the same units spawn to attack move to the point. I would also need it to add/remove the units correctly when they are inside or outside the corresponding area.

The main issue I have so far is properly creating the exact units that should be in the group (or box in the map). It creates the right amount, just not the right units.

Here's the basis of what I have so far:

  • Green Setup
  • Events
  • Unit - A unit enters Green Spawn <gen>
  • Conditions
  • ((Entering unit) belongs to an ally of (Owner of (Entering unit))) Equal to True
  • Actions
  • Set Temp_Unit = (Entering unit)
  • Unit Group - Add Temp_Unit to GreenSummon_Group
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • (Clicked dialog button) Equal to Dialog_Buttons2[1]
  • Then - Actions
  • Set Point_Green = (Center of Green Autospawns <gen>)
  • Set Point_Green2 = (Center of Red Mage Spot <gen>)
  • Unit - Create (Number of units in GreenSummon_Group) (Unit-type of Temp_Unit) for Player 15 (Turquoise) at Point_Green facing Default building facing degrees
  • Unit Group - Order (Last created unit group) to Attack-Move To Point_Green2
  • Unit Group - Remove all units from (Last created unit group)
  • Custom script: call RemoveLocation(udg_Point_Green)
  • Custom script: call RemoveLocation(udg_Point_Green2)
  • Custom script: call DestroyGroup(udg_UnitGroup_Green)
  • Else - Actions
  • Do nothing
  • Green Leave
  • Events
  • Unit - A unit leaves Green Spawn <gen>
  • Conditions
  • Actions
  • Unit Group - Remove (Leaving unit) from GreenSummon_Group

These are three different triggers.

Thanks in advance for the help, I greatly appreciate it.
 
Last edited:
  • if.gif
    ((Entering unit) belongs to an ally of (Owner of (Entering unit))) Equal to True
You proably want do ask something different in that condition, Owner is always ally of its own units.


Use the Unit Group Loop Action to iterate over all units contained in the unit group.
Inside the Loop - Actions use picked Unit to address/access the current iterated unit beeing member of the group.
That way you can clone unit for unit.
  • Unit Group - Pick every unit in YourGroup and do (Actions)
    • Loop - Actions
      • Set tempUnit = (Picked unit)
      • Unit - Create 1 (Unit-type of tempUnit) for Player 5 (Yellow) at Loc facing Default building facing degrees
      • Unit - Order (Last created unit) to Attack-Move To Loc2
 
Status
Not open for further replies.
Top