• 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.

[Trigger] Custom ability not working

Status
Not open for further replies.
Level 4
Joined
Jul 10, 2013
Messages
73
I have a "hotwire" ability that allows a player to steal a car from a computer player and use it.
The player can also obtain a car through the use of building it themselves with money.
My plan for this ability was to have the player use it on a car, have the car be theres while the ability they used to get it (Hotwire) goes away until the car dies.
I have two different cars in my game, one is for the computer that doesn't move and another has movement speed and more hp.
My problem right now is that nothing happens when the ability is used.

  • Hotwire
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Unit-type of (Target unit of ability being cast)) Equal to Car
      • (Ability being cast) Equal to Hotwire (C) (channel)
    • Actions
      • Set Point = (Position of (Target unit of ability being cast))
      • Unit - Remove (Target unit of ability being cast) from the game
      • Unit - Create 1 Car (F) (Human) for (Triggering player) at Point facing Default building facing degrees
      • Special Effect - Create a special effect at Point using Abilities\Spells\Human\DispelMagic\DispelMagicTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Remove Hotwire (C) (channel) from (Triggering unit)
      • Custom script: call RemoveLocation(udg_Point)
I will have 9 players who can steal cars, thus I will have 9 of these triggers below. If theres a way to have less I would interested!

  • Hotwire1
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Car (F) (Human)
      • (Level of Hotwire (C) (channel) for Hero1) Greater than 0
    • Actions
      • Unit - Add Hotwire (C) (channel) to (Hero1)
 
Level 8
Joined
Jan 28, 2016
Messages
486
You can simplify the second trigger, assuming that the neutral players (Neutral Hostile and such) along with Player 10, 11 and 12 don't have access to that unit type.

  • Simplify
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Car (F) (Human)
    • Actions
      • Unit - Add Hotwire (C) (channel) to HeroArray[(Player number of (Owner of (Triggering unit)))]
Just to be clear, the HeroArray variable is a unit array so that you won't need 9 copies of a unit variable.
 
Status
Not open for further replies.
Top