• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Several Questions, Uncontrollable Units and AI

Status
Not open for further replies.
Level 3
Joined
May 1, 2007
Messages
29
First of all, how do you make a unit uncontrollable by a player that owns the unit? It is a summoned unit that is supposed to act on its own.

Secondly, I'm trying to make the unit do these actions. Can I do them through triggers?

After being summoned in
-Wait 3 seconds
-Activate burrow
-Wait for enemy to come within acquisition range
-Unborrow
-Attack enemy

If you're wondering, it's a spider mine that a vulture deploys. :emote_cool: I have it already set up to summon in a spider mine with the burrow ability and the explode ability.
 
Level 7
Joined
Jun 4, 2006
Messages
127
Unselectable? Try this

  • Unselectable
    • Events
      • Player - Player selects a unit [something like that]
    • Conditions
      • (Unit type of (Triggering Unit)) Equal to (SPIDER GUY)
    • Actions
      • Selection - Remove (Triggering Unit) from selection
Also make your unit, Can't Raise, Does not Decay

  • Summon SPIDER GUY
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (Summon)
    • Actions
      • Set Point = (Position of (Casting Unit))
      • Unit - Create 1 SPIDER GUY for (Owner of (Casting Unit)) at Point facing Default facing degrees
      • Set SpiderGuy = (Last Created Unit)
      • Custom Script: call RemoveLocation(udg_Point)
      • Unit - Add a 30.00 second Generic Expiration Timer for SpiderGuy
      • Wait 3.00 second
      • Unit - Order SpiderGuy to Undead Crypt Fiend - Burrow
      • Turn On - Attack - SpiderGuy
Create a Unit Group Variable

  • Attack - SpiderGuy
    • Events
      • Unit - A unit comes within 200 for SpiderGuy
    • Conditions
    • Actions
      • Trigger - Turn Off (this trigger)
      • Set SGLoc = (Position of (SpiderGuy))
      • Set Victim = (Units within 200 of SGLoc matching (((Matching unit) belong to an enemy of (Owner of (SGLoc))) Equal to True)
      • Custom Script: RemoveLocation(udg_SGLoc)
      • Unit - Order SpiderGuy to Undead Crypt Fiend - Burrow
      • Wait 1.00 seconds
      • Unit Group - Pick Every Unit in (Victim) and do (Unit - Order SpiderGuy to Attack (Picked Unit))
      • Wait 6.00 seconds
      • Unit - Order SpiderGuy to Undead Crypt Fiend - Burrow
      • Wait 1.00 seconds
      • Custom Script: call DestroyGroup(udg_Victim)
      • Trigger - Turn On (this trigger)
I'm not sure if this works but just try it..
 
Level 3
Joined
May 1, 2007
Messages
29
Several questions. First, it seems I have to pick a player that "selects a unit." Is there a way to make it so the one event watches all players, or do I need to add 10 events?

Second, for the event "Unit - A unit comes within 200 for SpiderGuy" I have to set the "Spider Guy Unit" part to one of the units on the map. Is there a way to make it so I can have it be all units of a type? There might be like 10 spider mines on the map at once. That's one of the reasons this is more difficult.

Third, the "no select" thing works, but it doesn't work until the spider mine burrows. Is there any other way of making it so the spider mine cannot be issued orders by the player?

Thanks so much! I've made significant headway. :)
 
Level 7
Joined
Jun 4, 2006
Messages
127
1> You have to make ten events, that's it.. You don't need to make 10 triggers for each event...

2> Wait, do you mean, it creates multiple Spider Mines at one time? Then yes, we can fix that. If not, it is not possible in my knowledge (in GUI).

If creating multiple spider mines then use these actions
  • Actions
    • For each (Integer A) from 1 to (Level of (Ability) for (Casting Unit)
      • Loop - Actions
        • Set Point = (Position of (Casting Unit))
        • Unit - Create 1 SPIDER GUY for (Owner of (Casting Unit)) at Point facing Default facing degrees
        • Set SpiderGuy[Integer A] = (Last Created Unit)
        • Custom Script: call RemoveLocation(udg_Point)
      • Unit - Add a 30.00 second Generic Expiration Timer for SpiderGuy[1]
      • Unit - Add a 30.00 second Generic Expiration Timer for SpiderGuy[2]
      • Unit - Add a 30.00 second Generic Expiration Timer for SpiderGuy[3]
      • Unit - Add a 30.00 second Generic Expiration Timer for SpiderGuy[4]
      • Wait 3.00 second
      • Unit - Order SpiderGuy[1] to Undead Crypt Fiend - Burrow
      • Unit - Order SpiderGuy[2] to Undead Crypt Fiend - Burrow
      • Unit - Order SpiderGuy[3] to Undead Crypt Fiend - Burrow
      • Unit - Order SpiderGuy[4] to Undead Crypt Fiend - Burrow
      • Trigger - Turn On - Attack - SpiderGuy
Also in the Attacking Trigger

  • Events
    • Unit - A unit comes within 200 for SpiderGuy[1]
  • Conditions
  • Actions
    • Trigger - Turn Off (this trigger)
    • Set SGLoc[1] = (Position of (SpiderGuy[1]))
    • Set Victim[1] = (Units within 200 of SGLoc[1] matching (((Matching unit) belong to an enemy of (Owner of (SpiderGuy[1]))) Equal to True)
    • Custom Script: call RemoveLocation(udg_SGLoc[1])
    • Unit - Order SpiderGuy[1] to Undead Crypt Fiend - Burrow
    • Wait 1.00 seconds
    • Unit Group - Pick Every Unit in (Victim[1]) and do (Unit - Order SpiderGuy[1] to Attack (Picked Unit))
    • Wait 6.00 seconds
    • Unit - Order SpiderGuy[1] to Undead Crypt Fiend - Burrow
    • Wait 1.00 seconds
    • Custom Script: call DestroyGroup(udg_Victim[1])
    • Trigger - Turn On (this trigger)
In here, you have to create 1 trigger for every unit created by changing the arrays of the variables. Remember the first trigger will create 1 x Level of ability Spider Mines..
In that triggers, there is 4 levels.

3> In the conditions, put
  • Conditions
    • Or (Any Conditions are true)
      • (Unit type of (Triggering Unit)) Equal to Spider Mine
      • (Unit type of (Triggering Unit)) Equal to Spider Mine (Burrowed)
The Spider Mine does morph into another unit, right? If not then change the conditions to the variable, not the unit name..
 
Status
Not open for further replies.
Top