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

Unique Attacking problem

Status
Not open for further replies.
Level 11
Joined
Nov 12, 2006
Messages
765
I am in the process of making a space battle cinematic for my Mandalorian Wars campaign. I am having difficulty making units attack other. They simple don't do it. Here is the information

I have invisible Laser and Hardpoint units. They both use the model file .mdl

The Laser unit is invisible, however it and several others are placed on where the laser cannons should be on a ship (used as unit, the ship unit itself has no attack). The laser cannons are supposed to be grouped up in the specific ships "Laser Ship group". This is the same for the "Hardpoint Ship Group".

The lasers are supposed to randomly attack a random unit from the specific hardpoint group.

Their are 2 Attacking ships, 1 ship not doing anything. Each ship has its own unit groups (laser group and hard point group).

Hardpoint units have a classification of Undead
Laser units have a classification of Mechanical


Setting the hardpoints
  • Actions
    • Unit Group - Pick every unit in (Units in Star Desroyer Left <gen> matching (((Unit-type of (Picked unit)) is Undead) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to HardStarLeft
    • Unit Group - Pick every unit in (Units in Star Desroyer Middle <gen> matching (((Unit-type of (Picked unit)) is Undead) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to HardStarMid
    • -------- ------------------------------------------------------------------------------------ --------
    • Unit Group - Pick every unit in (Units in Flagship Left <gen> matching (((Unit-type of (Picked unit)) is Undead) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to HardFlagLeft
    • Unit Group - Pick every unit in (Units in Flagship right <gen> matching (((Unit-type of (Picked unit)) is Undead) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to HardFlagLeft
    • -------- ------------------------------------------------------------------------------------ --------

Setting the Lasers
  • Actions
    • Unit Group - Pick every unit in (Units in Flagship Left <gen> matching (((Unit-type of (Picked unit)) is Mechanical) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to LaserFlagLeft
    • Unit Group - Pick every unit in (Units in Flagship Left <gen> matching (((Unit-type of (Picked unit)) is Mechanical) Equal to True)) and do (Actions)
      • Loop - Actions
        • Unit Group - Add (Picked unit) to LaserFlagRight
    • -------- ------------------------------------------------------------------------------------ --------
Ordering Attack
  • Actions
    • Unit Group - Pick every unit in LaserFlagLeft and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Attack (Random unit from HardStarLeft)
    • Unit Group - Pick every unit in LaserFlagRight and do (Actions)
      • Loop - Actions
        • Unit - Order (Picked unit) to Attack (Random unit from HardStarMid)
    • -------- -------------------------------------------------------------------------------------------------------- --------
    • -------- -------------------------------------------------------------------------------------------------------- --------
    • -------- -------------------------------------------------------------------------------------------------------- --------
    • Unit - Order Laser 2 Red 500 0355 <gen> to Attack (Random unit from HardFlagLeft)
    • Unit - Order Laser 2 Red 500 0356 <gen> to Attack (Random unit from HardFlagLeft)
    • Unit - Order Laser 1 Red 630 0384 <gen> to Attack (Random unit from HardFlagLeft)
    • Unit - Order Laser 1 Red 630 0385 <gen> to Attack (Random unit from HardFlagLeft)
    • Unit - Order Laser 1 Red 630 0386 <gen> to Attack (Random unit from HardFlagLeft)
    • -------- -------------------------------------------------------------------------------------------------------- --------
    • -------- -------------------------------------------------------------------------------------------------------- --------
    • -------- -------------------------------------------------------------------------------------------------------- --------

+rep to anyone with good ideas, even if they dont work.
 
Level 11
Joined
Nov 12, 2006
Messages
765
Bump + Update

I discovered by adding game texts with numbers that all the triggers run, however none of the looped actions worked which makes none of the attacking triggers work. any ideas of what could be wrong with my variables or adding units?
my variables are basic unit groups, with no arrays.
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
you forgot to destroy groups

edit variables>new variable>variable name UNITGROP > variable type Unit Group

set = UNITGROUP = (unit group that you want)
> now you can use UNITGROUP and when you finish your action or if you want to change the UNITGROUP
Custom Script:call DestroyGroup(udg_UNITGROUP)
 
Status
Not open for further replies.
Top