• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Unit Cage Spawning

Status
Not open for further replies.

OriginalNameTutko

O

OriginalNameTutko

Can someone pls tell me how to do this i know how to spawn it for a specific player using triggers but not for the player that destroyed the cage. If there is a way please tell me.

P.S. It doesnt need to be a cage just a doodad when "killed" drops a unit
 
Basically it just has to be triggered to create a unit when a certain destructible dies.
  • Cage Dies
    • Events
      • Destructible - Cage 42272 <gen> dies
    • Conditions
    • Actions
      • Set TempLoc = (Position of (Dying destructible))
      • Unit - Create 1 Footman for Player at TempLoc facing Default building facing (270.0) degrees
      • Custom script: call RemoveLocation(udg_TempLoc)
 
If you want to do this for EVERY cage without having to manually add them, you can do this at the start of the map:

  • Untitled Trigger 002
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Entire map) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Equal to Cage
            • Then - Actions
              • Trigger - Add to Cage Dies <gen> the event (Destructible - (Picked destructible) dies)
            • Else - Actions
And you can make different cages in the object editor and have them spawn different units, of course.
 
I assume "killing unit" does not work for destructable death events? If not then it is not really possible to do what you want.

Best compromise would be to weigh up possible killing units and choose which is the most likely. For example if a player has 50 units near it and another player only has 1 then give it to the player with 50 units as he is most likely to have killed it as he most likely has area control. applying weights to units might help so that 1 hero is worth more for the calculation than 5 trash units.
 
Status
Not open for further replies.
Back
Top